Commit 42ffee8a authored by Mart Lubbers's avatar Mart Lubbers Committed by Camil Staps

Add notion of local definitons in ZF

parent ecd561ca
......@@ -474,7 +474,7 @@ bs_layout_rule =
bs_let =
{ syntax_title = "let expression"
, syntax_patterns = map exact ["let", "in", "let in"]
, syntax_code = ["let ... in ..."]
, syntax_code = ["let ... [in ...]"]
, syntax_description = "An expression that introduces new scope."
, syntax_doc_locations = [CLR 5 "3.5.1" "_Toc311798003"]
, syntax_examples =
......@@ -487,6 +487,8 @@ bs_let =
add_bootstrap "expression = undef" $
EXs "macrorhs"
"let // Multi-line let expressions\n\tfunction args = body\n\tselector = expr\n\t// ...\nin expression"
, EXs "macro"
"[z\\x<-[0..]\n,let (y,z) = fun x\n] //the let MUST end with a newline"
]
}
bs_let_before =
......@@ -849,12 +851,12 @@ bs_with =
bs_zf =
{ syntax_title = "list comprehension"
, syntax_patterns = map exact ["ZF-expression", "ZF", "zf", "*comprehension", "<-", "<\\|-", "<-:", "\\\\\\\\", ",", "&", "\\|"]
, syntax_patterns = map exact ["ZF-expression", "ZF", "zf", "*comprehension", "<-", "<\\|-", "<-:", "\\\\\\\\", ",", "&", "\\|", "let"]
, syntax_code =
[ "[... \\\\ ... <- ...]"
, "{... \\\\ ... <- ...}"
]
, syntax_description = "Constructs a list or array composed of elements drawn from other lists or arrays."
, syntax_description = "Constructs a list or array composed of elements drawn from other lists or arrays. It is possible to use local definitions as well (see {{`let`}})."
, syntax_doc_locations = [CLR 6 "4.2.1" "_Toc311798024", CLR 6 "4.4.1" "_Toc311798032"]
, syntax_examples = map (add_imports ["StdEnv", "StdMaybe"] o EXs "macro")
[ "cartesian = [(x,y) \\\\ x <- [1,2,3], y <- [10,20]] // Cartesian product: (1,10), (1,20), (2,10), (2,20), (3,10), (3,20)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment