Kaz Kylheku
4/6/2016 5:14:00 AM
On 2016-04-05, Chris Vine <chris@cvine--nospam--.freeserve.co.uk> wrote:
> On Tue, 5 Apr 2016 05:04:36 -0700 (PDT)
> Jim Newton <jimka.issy@gmail.com> wrote:
>> >
>> > > 4.2.9. Case-lambda
>> > > (case-lambda â?¨clauseâ?© . . . ) case-lambda library syntax
>> > > Syntax: Each â?¨clauseâ?© is of the form (â?¨formalsâ?© â?¨bodyâ?©), where
>> > > â?¨formalsâ?© and â?¨bodyâ?© have the same syntax as in a lambda
>> > > expression.
>> >
>> > I'm not sure how that is not clear.
>> >
>>
>> The reason it was not clear to me is that I didn't know what
>> <formals> was. It is clearly at least a list of symbols indicating
>> variable names, but whether <formals> allows other syntax such as
>> optional arguments, or keywords, or destructuring is something a
>> schemer would readily know, and is likely described elsewhere in the
>> language specification.
>
> There is no destructuring. There is just matching by argument numbers.
>
> Incidentally in scheme it is a list of identifiers rather than a list
> of symbols: see the first paragraph of section 3.1 of R7RS. Identifiers
> denote symbols when they appear as or within a literal (section 2.1).
We could call this a list of "idiotifiers".
> Not that it makes any practical difference - the effect is the same and
> it is just semantics. Scheme avoids mixing the implementation with the
> specification.
Is there no practical difference?
Look, either there is a purpose behind it or there isn't.
If there isn't, it is purposeless twaddle that should be moved
to an appendix---which could then be subject to a swift, benign
appendectomy.
If there is a purpose to the separation, it could only be so that so
syntax and its identifiers could be implemented *other* than with
symbols. For example, some goddamned YYLVAL nodes in a Yacc parser where
identifiers are "char *" strings coming out of strdup, or whatever.
(Haskell-envying garbage, basically). In any case such a thing is done,
it is undeniably a practical difference. It's a difference, and it's put
into practice.
A Lisp dialect should be specified so that such is explicitly ruled out.
If there is any threat of such a thing creeping in, a defensive move
must be made. For instance, a *parser-hook* mechanism can be defined
such that every piece of syntax can pass through a user-defined
function, which can validate that every identifier in the structure is
in fact a symbol object.