Wing Hei Chan
Wing Hei Chan
It seems to me that this pseudo-contract has two problems: 1. The ellipsis `...` actually *identifies* - the number of arguments the procedure accepts, and - the number of elements...
Just for reference, I think this issue is asking for an equivalent of this Typed Racket program in terms of contracts: ```racket #lang typed/racket/base (: my-apply (All (t s ...)...
Yes, this is expected. Maybe the example can be adjusted to be less confusing, but generally examples are run in a REPL-like setting, and things can work differently between modules...
For those who are new to Racket/Rhombus: `map[key]` and `map.get(key)` desugar to `(hash-ref map key)`, which throws if the `key` isn’t in the `map`. To supply a default value, you...
Another bug is that the predicate expression should’ve been subject to the weird `for/fold` scope, but did not. This can be seen in the expansion of `for/and`, `for/or`, and `for/first`....
The ambiguity is unfortunate, but I think here’s a good place to use function shorthands. ``` class Hello(a) Hello(_).map([1, 2, 3]) ``` This is only three characters longer than the...
`start ..= end` ranges also work as sequences, so I’d write ``` for List (i in Char"a".to_int() ..= Char"z".to_int()): Char.from_int(i) ``` This is still sub-optimal, admittedly. Ideally, `(Char"a" ..= Char"z").to_list()`...
The original issue is no longer relevant due to 6da9a74. I’ll keep this open as one thing to consider in the definition macro protocol, i.e., cooperation with an “enclosing” form.
I see why one would want to do this, but I’m not sure adding yet more special cases is the best idea—function headers already have a rather sugary grammar as...