[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scheme-reports] R7RS 1st draft, parameterize body; guard macro definition



Here's more of my little concerns about the draft.

4.2.6 Parameterize looks like it should have a <body>, like the let
family has, in ImmutableParametersCowan it has a <body>, yet the draft
report has (parameterize ((param value) ...) <expr1> <expr2> ...). At
least give it the <body>.

But the entry needs more work: it talks about a /converter/ without
telling what that is (say something like "the converter of param / of
the parameter object"), and the entry head has _param_ and _value_ in
typewriter (use italics? or BNF angle brackets?) The text in
ImmutableParametersCowan is better.

A general style observation, which I intend to make just this once:
this and many other entries in the draft have awkward language like
"result(s) ...  is(are)". I think all of these should say simply that
"results ... are". See case-lambda, where the bare plural is used and
works quite well without calling needless attention to itself.

6.4, make-parameter, points to parameterize, which is good; the
section number (4.2.6) should also be given. ImmutableParametersCowan
has text that I would find helpful in the report: converter "can be
used to coerce init to a suitable type or to signal an error".

In 6.4, the example implementation of make-parameter handles optional
arguments twice. It should use case-lambda for this, both for greater
cohesion now that we have case-lambda, and because it's better that
way. Like so:

(define make-parameter
  (case-lambda
    ((init) (make-parameter init (lambda (x) x)))
    ((init converter)
     (let ((value (converter init)))
        (case-lambda
          (() value)
          ((tag) converter)
          ((tag old-value)
           (set! value old-value)))))))

(It can check those tags or not. Perhaps it can serve as an example of
exceptions, too.)

Guard (4.2.7) is not given a macro definition in the report, as far as
I can see. Maybe define it in 7.3 Derived expression types?

The example at the end of 6.5 looks typographically like it should be
associated with the entry for error, but it is not. (Oh, and the entry
for error would read better with a verb or two added.)

To help us readers find our way around the report, please have 6.5
Exceptions point to 4.2.7., where guard is. And add guard to the
index!

7.3 Derived expression types should point to 6.4 where parameterize is
given a definition. If guard gets defined elsewhere, point to it. And
point to quasiquote, even if the macro definition continues to be
omitted. The section already points to delay but not to the new items
or quasiquote.

And the formal grammar should have parameterize, guard, and
case-lambda added in 7.1.3 under <derived expression>.

Amazing how one thing leads to another.


_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports