Anonymous functions examples in docs don’t run
Ivo-Balbaert opened this issue · comments
Describe the bug
Example 1: on Windows / Playground
export fn main argv:
[1 2 3]
-> * n: n * 2
-> * n: console.log n
export fn main argv:
[1 2 3]
-> * n: n * 2
^
Expecting one of symbol, parameter, number, array, string, formattedString, hashmap, propertyAccess, range, rangeFull, rangeBy, byRange, ranger, slice, set, wrapped, awaited, parallelFn, null, true, false, inCheck, group, math, comparison, logical, logicalNot, call, arrowAssignment, lineBreak, ender but encountered colon
PS D:\Clio\own_projects\anonfun1>
Example 2: on Windows / Playground
export fn main argv:
[1 2 3 4 5 6]
-> .filter (n: n > 2)
-> console.log
- Compiling source...Parsing error at main.clio[3:15]
export fn main argv:
[1 2 3 4 5 6]
-> .filter (n: n > 2)
^
Expecting one of symbol, parameter, number, array, string, formattedString, hashmap, propertyAccess, range, rangeFull, rangeBy, byRange, ranger, slice, set, wrapped, awaited, parallelFn, null, true, false, inCheck, group, math, comparison, logical, logicalNot, call, arrowAssignment, lineBreak, ender but encountered wrappedOpen
To Reproduce
Steps to reproduce the behavior:
- Run
...
- See error
Expected behavior
Example 1: 2 4 6
Example 2: 1 2
Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
• OS: Windows 10
• Clio: 0.8.1
• Node: v14.16.1
• NPM: 6.14.12
Possible solutions
- Update dependency
x
- Fix function
y
Additional context
Add any other context about the problem here.
This is fixed in the new documentation, for some reason Gitbook was picking up the examples from old Clio versions, don't know why, the Gitbook's build source didn't match the one we have on dev branch.