Re:Rhombus Language
by Jtsummers on Tuesday March 18, 2025 @03:35PM
(#43403958)
Your version would expect a list of two elements, you use & to indicate that you're collecting the remainder of the list as in:
fun flip_all([Posn(x, y), & rest]):
You'd need to amend the logic of the function body to iterate or recurse over the remainder. You'd also ended up with a nested list using your version but you can use & again to splice in the result, so if you wanted a recursive version of that it would be something like (skipping the base case):
If you really want flip_first it'd be: