On Sun, May 3, 2015 at 12:29 AM, Keean Schupke <[email protected]> wrote:
> I would not allow top level let's at all. In terms of parsing, let is an
> expression (it has a non-monadic type). Top level declarations have a
> monadic type (or can't be part of an expression). Something like for a
> minimal definition of an expression:
>
> var = alpha, {alnum}
> abs = '\', var, '.', expr
> let = 'let', var, '=', expr
> expr = var | abs | let
> decl = var, '=', expr
> program = decl, {decl}

indeed, fwiw there there is a copy of ML's BNF here:
http://www.cse.buffalo.edu/~regan/cse305/MLBNF.pdf

F# seems to consider it a keyword.

i'm rather rusty on parsing in general, so this is more likely to be
completely broken, not to mention incomplete, hopefully it explains
what I was thinking...

...
decls = DECL | DECL';' DECL
block = let DECLS
blocks =  BLOCK | BLOCK '&' BLOCK
expr = BLOCKS in EXPR end | ...

so let is still only usable in an expression
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to