Shiro Kawai:
> Will #1=f(#1#) mean (#1=f #1#) or #1=(f #1#)?
Great question!
> Since 'f(x) => (quote (f x)), I guess the latter is more
> consistent (that is, after seeing #1=, the reader recurses
> to gather the longest <datum> and then labels it.)
Agreed. Anyone disagree?
> But I'm not sure the current draft spec is clear enough,
> for, according to srfi-38, the "#1=f" part consists a <datum>.
The expression f(x) is a datum in neoteric-expressions, since it's just another way of writing (f x). It certainly should NOT stop reading after it reads f if an open paren follows immediately.
But I think you're absolutely right, the spec isn't clear enough. Great catch. So how do we make it clearer? I think we can clarify this by tweaking the definition and giving an example.
First, in the neoteric-expression definition, change:
"A “<dfn>neoteric-expression</dfn>” or “<dfn>n-expression</dfn>”
is a curly-infix-expression, with the following modifications where
<var>e</var> is any datum expression:"
to:
"A “<dfn>neoteric-expression</dfn>” or “<dfn>n-expression</dfn>”
is a curly-infix-expression, but with the following additional syntaxes for a datum where
<var>e</var> is any datum expression:"
With this change, it's clear we're defining datums.
Then let's add the given example:
#1=f(#1#)
maps to
#1=(f #1#)
Would that work? Is there a better way? Any objections?
--- David A. Wheeler