[bitc-dev] Syntax Poll: Scoping Syntax
Pal-Kristian Engstad
pal_engstad at naughtydog.com
Thu Mar 5 13:58:44 EST 2009
Jonathan S. Shapiro wrote:
> On Thu, Mar 5, 2009 at 1:38 PM, Zorg 421 <zorglub421 at gmail.com> wrote:
>
>> Hmm does'nt Jonathan used curly braces in this particular thread to
>> mean "optional", not curly braces?
>>
>
> Yes. I was using a BNF-like notation. It's hard to do that in an
> ascii-only syntax.To make matters worse, I chose the conventions of
> the OCaml doc, which do not follow the usual conventions.
>
> Where grammar fragments are being discussed, we should use curly
> braces to denote grouping. All uses of grouping will be followed by +
> (one or more) * (zero or more) or ? (zero or one). When curly brace is
> intended to be a token it should be quoted or written out.
>
> So with the rules stated, I was proposing:
>
> let BINDING
> { and BINDING }* in
> expr
> end
>
> That is; I did not intend the curly braces literally.
>
> shap
> _______________________________________________
> bitc-dev mailing list
> bitc-dev at coyotos.org
> http://www.coyotos.org/mailman/listinfo/bitc-dev
>
>
I actually like this idea. In OCaml it is always hard to see when a
definition ends and this would help it.
It would preclude the OCaml-ish style:
let _ = printf ... in
let _ = printf ... in
let _ = printf ... in
()
Because this must now be written (using let's):
let _ = printf ... in
let _ = printf ... in
let _ = printf ... in
()
end
end
end
I've always considered that style a bit perverse, so it is perhaps a
good thing.
PKE.
--
Pål-Kristian Engstad (engstad at naughtydog.com),
Lead Graphics & Engine Programmer,
Naughty Dog, Inc., 1601 Cloverfield Blvd, 6000 North,
Santa Monica, CA 90404, USA. Ph.: (310) 633-9112.
"Emacs would be a far better OS if it was shipped with
a halfway-decent text editor." -- Slashdot, Dec 13. 2005.
More information about the bitc-dev
mailing list