[racket-dev] P4P: A Syntax Proposal

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Thu Jul 29 12:27:41 EDT 2010

> That's only true if {} count as parens too.  ¡  My suggestion was that
> they ONLY count as a begin statement.

So what do I do in the case of expressions-in-function-position?
Currently that is the one source of ambiguity in the language, so it
is essential that I deal with that.  Using {...} in the function
position addresses it.  [It's fugly, but rather rarely seen in code.]

> ¡  I could live with "do: {}", I
> was just trying to reduce the typing and number of keywords a bit.

Understood, and I greatly appreciate the suggestions.

> Which basically means P4P syntax is not indentation based, it just
> has an extra style checker component added into the
> parser.   (Personally I think the style checker should be part of the
> IDE, not enforced by a compiler since it has nothing to do with
> whether a program is parsable.)

I've never said it is indentation-based.  You won't find that phrase
anywhere in the document.  Indeed, the documentation repeatedly says
that indentation does not play the role people think, precisely to
ward off misunderstandings like Mike's.  Finally, the documentation
even says how and why one might turn the indentation off.

If your point is that this design conflates two things -- paren
reduction and indentation -- you're right.  But turning off the
indentation checking is trivial: make two (soon to be three, with the
next release) predicates -- or the higher-order predicate invoker --
always return true.  It would take under 10 lines to define that
language and use it instead.  So I'd rather put the effort into the
harder language.  It seems to me an interesting experiment to
understand this intermediate point in the design space, where
indentation is enforced without impacting the semantics.  As an
end-user, when I stick my students in front of such a language, I
really want both aspects.

Shriram


Posted on the dev mailing list.