[racket-dev] P4P: A Syntax Proposal

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Thu Jul 29 11:47:29 EDT 2010

Responding to Everett's suggestion:

>> I don't understand why not write a lexer, since replacing "do: ()" with
>> "{}" is the most natural and readable thing to do.
> I really don't want to touch the lexer level.
> Until this morning, I didn't know how to check for { ... }, which is
> why I had the do: keyword.   It appears that I can get rid of it.   I
> have to decide now whether I want to.   I'll think about that.

I can't get rid of it.  Currently,

  do: { f(x) }

is unambiguously a single-statement/expression begin, without having
to look at subsequent context.  If I make it optional, then the same
phrase could be either the interpretation above, or a begin with a
single expression, but where that expression is an application, whose
function position is a complex expression (namely, f(x)).

In general, I am very wary of anything optional.


Posted on the dev mailing list.