And how would the last line look if the previous one didn't end in a colon?
The global project might be nice, but in this particular case it's kind of opt for worst of all pre-existing conventions while trying to please everyone. The challenge is tough, so that's no wonder it will have hard time matching the goal.
fun is_sorted(list):
match list:
| []: #true
| [_]: #true
| [head, next, ...]:
head .<= next && is_sorted([next, ...]) $ raco pkg install rhombus --auto
which should work if you have some vaguely recent install of racket on your machine and handle the dependencies without prompting.(I started installing this several hours ago on a slow machine but it's still going.)
Please file a bug report so this can be tracked down.
In that case, I make it quick - and refrain from any followup questions.
Did you by chance pick the "Minimal Racket" distribution?
If so, your command essentially compiled large parts of Racket and generated the entire set of documentation.
The distribution "Full Racket" is the recommended distribution for most purposes. It comes with everything pre-compiled.
https://github.com/termux/termux-packages/blob/master/packag...
I just installed the package called `racket` from Termux's upstream, and it seems that they're using racket-minimal for that. Bit of a gotcha, but at least it doesn't seem like there's a bug. Thanks for the tip.
I'll contact the Termux people and ask if the choice of `racket-minimal` was intentional.
~ $ racket -I rhombus
Welcome to Racket v8.13 [bc].
> fun is_sorted(list):
match list:
| []: #true
| [_]: #true
| [head, next, ...]:
head .<= next && is_sorted([next, ...])
; readline-input:6:19: next: cannot use repetition binding as an expression
; in: next
; [,bt for context]
From there I got to "repetition binding" in the docs: https://plt.cs.northwestern.edu/pkg-build/doc/rhombus/Repeti...From what I can understand, the "..." isn't independent of the previous expression in the list (as I would have expected from e.g. Prolog or Haskell). Instead you are defining a kind of pattern to reuse later, so tail gives a name to the rest of the list (so that it doesn't get associated with next).