-
Notifications
You must be signed in to change notification settings - Fork 38
Spread anywhere feature #692
Changes from all commits
0447df1
3f77897
769d719
b34ec30
3459747
cefe805
4733641
72409f1
362fca5
f14b41e
9a81c95
00226bf
ecc4d40
001501f
0e005c0
61ac172
e71a61a
839d3e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,13 @@ let x = list{} | |
let x = list{1} | ||
let x = list{1, 2} | ||
let x = list{1, 2, 3} | ||
let x = xs | ||
let x = list{1, ...xs} | ||
let x = list{xs, ...ys} | ||
let x = list{...xs, ...ys} | ||
let x = list{...xs, 1, ...ys} | ||
let x = list{1, 2, ...xs, 3, ...xs} | ||
let x = Belt.List.concatMany([list{1, 2, ...x}, [list{3, ...x}]]) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could this be improved? print it as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could be, but just by changing the printer can cause some problems. For example, list{. . x, . .y} and Belt.List.concatMany([x, y]) will be printed as the same thing. I am still trying to solve this problem. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add an attribute to Belt.List.concatMany to avoid accidental simplifications? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what is done for string templates, I believe, to differentiate from normal string concatenation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check what There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for all your suggestions, I'll learn more about that. |
||
let x = list{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add some more test cases, some edge cases like: let x = list{ ...xs}
let x = list{1, ...xs}
let x = list{xs, ... ys}
let x = list{ ...xs, ... ys} |
||
superLoooooooooooooooooooooooooooooongIiiiiiiiiideeeentifieeeeeeeeeeeeeeeeer, | ||
|
@@ -17,3 +24,23 @@ let x = list{ | |
superLoooooooooooooooooooooooooooooongIiiiiiiiiideeeentifieeeeeeeeeeeeeeeeer, | ||
...superLoooooooooooooooooooooooooooooongListHere, | ||
} | ||
|
||
let x = Belt.List.concatMany([ | ||
list{ | ||
superLoooooooooooooooooooooooooooooongIiiiiiiiiideeeentifieeeeeeeeeeeeeeeeer, | ||
superLoooooooooooooooooooooooooooooongIiiiiiiiiideeeentifieeeeeeeeeeeeeeeeer, | ||
...superLoooooooooooooooooooooooooooooongListHere, | ||
}, | ||
list{ | ||
superLoooooooooooooooooooooooooooooongIiiiiiiiiideeeentifieeeeeeeeeeeeeeeeer, | ||
...superLoooooooooooooooooooooooooooooongListHere, | ||
}, | ||
]) | ||
|
||
let x = list{ | ||
superLoooooooooooooooooooooooooooooongIiiiiiiiiideeeentifieeeeeeeeeeeeeeeeer, | ||
superLoooooooooooooooooooooooooooooongIiiiiiiiiideeeentifieeeeeeeeeeeeeeeeer, | ||
...superLoooooooooooooooooooooooooooooongListHere, | ||
superLoooooooooooooooooooooooooooooongIiiiiiiiiideeeentifieeeeeeeeeeeeeeeeer, | ||
...superLoooooooooooooooooooooooooooooongListHere, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we may need update the docs about pattern in later commits, it is not supported since it is not deterministic