Verified Commit 7a5deb59 authored by Camil Staps's avatar Camil Staps 🚀

Fix previous commit:

- Fix syntax, code style, comment alignment
- Changed cleanjs_start from macro (???) to rhs
- Move example of let in ZF to bs_zf instead of bs_let
- Revert change to syntax_code in bs_let
parent 42ffee8a
Pipeline #18103 passed with stages
in 19 minutes and 26 seconds
......@@ -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,8 +487,6 @@ 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 =
......@@ -860,12 +858,17 @@ bs_zf =
, 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)"
, "zip xs ys = [(x,y) \\\\ x <- xs & y <- ys] // Pairwise zip through the lists"
, "filter f xs = [x \\\\ x <- xs | f x] // Guard to add conditions"
, "catMaybes ms = [x \\\\ Just x <- ms] // Pattern matching in the selector"
, "zip xs ys = [(x,y) \\\\ x <- xs & y <- ys] // Pairwise zip through the lists"
, "filter f xs = [x \\\\ x <- xs | f x] // Guard to add conditions"
, "catMaybes ms = [x \\\\ Just x <- ms] // Pattern matching in the selector"
, "triangle = [(x,y) \\\\ x <- [1,2,3], y <- [1..x]] // Reusing x in the next generator: (1,1), (2,1), (2,2), (3,1), (3,2), (3,3)"
, "arrToList a = [x \\\\ x <-: a] // <-: to draw elements from an array"
, "listToArr l = {x \\\\ x <- l} // {..} to create an array"
, "castList xs = [|x \\\\ x <|- xs] // The two pipe characters make both xs and the result overloaded lists"
, "arrToList a = [x \\\\ x <-: a] // <-: to draw elements from an array"
, "listToArr l = {x \\\\ x <- l} // {..} to create an array"
, "castList xs = [|x \\\\ x <|- xs] // The two pipe characters make both xs and the result overloaded lists"
] ++
[ add_imports ["StdEnv"] $ EXs "rhs" $
"[ sx \\\\ x <- [0..]\n" +
"\t, let sx = toString x // The let must end with a newline\n" +
"\t]"
]
}
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