You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following on from #229, we should probably make some effort to make the let and recursive let syntax more familar. We should be able to support:
nested let for the non-recursive form as well as the recursive form, so we can write let x = 5; y = 6; ... – although one challenge here is that it will not be obvious why you can’t add a recursive definition to such a block, but instead have to start a new (recursive) let block (we could reintroduce the rec keyword to make this explicit)
in “modules”
in let expressions
in as the delimiter in expressions
but not in “pretend modules”
replace many by sepBy and some by SepBy1, turning semicolon into delimiter rather than terminator – needs sepBy1_try
in to separate list of defs from expr in defsExpr
semicolon to terminate list of defs in module – needs sepBy_try
replace letDefs and recDefs parser by new defsExpr parser, which folds a list of variable and function definitions and a terminal expression into a tree of Let or LetRec expressions
keyword “blah” should be a fatal error if “blah” is not a keyword
None of this is as straightforward as one would like, though, especially if both familiarity and non-verbosity are desiderata.
The text was updated successfully, but these errors were encountered:
Following on from #229, we should probably make some effort to make the
let
and recursivelet
syntax more familar. We should be able to support:let
for the non-recursive form as well as the recursive form, so we can writelet x = 5; y = 6; ...
– although one challenge here is that it will not be obvious why you can’t add a recursive definition to such a block, but instead have to start a new (recursive)let
block (we could reintroduce therec
keyword to make this explicit)let
expressionsin
as the delimiter in expressionsmany
bysepBy
andsome
bySepBy1
, turning semicolon into delimiter rather than terminator – needssepBy1_try
in
to separate list of defs fromexpr
indefsExpr
module
– needssepBy_try
letDefs
andrecDefs
parser by newdefsExpr
parser, which folds a list of variable and function definitions and a terminal expression into a tree ofLet
orLetRec
expressionskeyword “blah”
should be a fatal error if“blah”
is not a keywordNone of this is as straightforward as one would like, though, especially if both familiarity and non-verbosity are desiderata.
The text was updated successfully, but these errors were encountered: