Email list hosting service & mailing list manager


Re: Does this change identifiers (variables) or only symbols? Keith Wright 26 Jul 2005 17:58 UTC

> From: bear <xxxxxx@sonic.net>
>
> On Thu, 21 Jul 2005, Keith Wright wrote:
>
> > [Matt Flatt's comment] seems to imply that srfi-75 is meant to
> > change the syntax of identifiers.  The word "identifier" does
> > not occur in the text of the srfi,
>
> When scheme code is read as data, variable names are read
> as symbols.  To change the syntax of symbols without also
> changing the syntax of variable names is not sensible
> in the context of a lispy language.

Well, nobody seems to be rushing to contradict you, so I
assume you are right about the intention.  The point remains
that if that is the intention, then the SRFI ought to say
so explicitly.  There is no necessary logical relation between
changing the string library and changing the syntax of
a program.

> John Cowan answers:
>
> For a long time there's been an odd disconnect between the
> official and effective syntaxes of Scheme.  The BNF does not
> actually allow an expression like "(+ 2 . (3))", but I can't
> imagine a Scheme that would fail to accept it.

Maybe R6RS will fix this by using character string based BNF
only to define a <datum>, and then defining a <program> as a
kind of <datum> generated by an S-expression based grammar.
In the meantime, a SRFI should be written as an extension
to R5RS, which is all we have now.

Is there anybody who does not allow comments in a <datum>?
(This seems not to be required by R5RS.)

In R5RS, <symbol> is defined as <identifier>, not the
the other way around, so to change both of them, the SRFI
(strictly speaking) should propose a new syntax for
identifiers, not symbols.  It would suffice to mention
identifiers somewhere.

I think I should now be able to rejoice in e.e.cumming's
purely irresistible truth[1]

  (define |2| 5/2)
  (+ |2| |2|)  ==>  5

although I am not sure the SRFI actually allows it, since
an <identifier> must begin with a <letter> or <special initial>.

Also (eq? 'A '|\x41|)  ==>  #t, and
     (|+| 2 2)  ==>  4, right?

In other nit picking:

> srfi-75, under Issues, says:
>
> Finally, it may not be necessary to place symbols in one-to-one
> correspondence (which ...).

This is mathematically, if not grammatically, a sentence fragment.
Symbols are in one-to-one correspondence with what?

[1] e.e.cummings "Is 5" (1926), reprinted in
   "Complete Poems", Harcourt Brace Jovanovich, pp 221-306

--
     -- Keith Wright

Programmer in Chief, Free Computer Shop
 ---  Food, Shelter, Source code.  ---