Closed AlexKnauth closed 9 years ago
What do you think about this?
I'm hesitant to add a special case so I'm not sure yet. I wonder if there is a good pattern to deal with keywords like this?
Ok.
I could just put all keyword arguments on a separate line, but that would take up a lot of unnecessary space. Or I could make a language with a redefined #%app
that would treat (#%app foo (#:kw kw-arg))
like (#%app foo #:kw kw-arg)
, and with redefined versions of syntax/parse forms that would do similar things, etc, but since #:keywords normally shouldn't be wrapped in parens, it might make sense to make this a special case. I agree that special cases are not a particularly good thing, but it might be worth it.
Ok, I'm fine with merging it since there doesn't seem to be a better way to handle keywords.
The tests/rest-arg.rkt
test seems to fail for me though. Does it work for you?
Oh. It fails for me too, but both on this and on master. So I'm guessing I probably broke it in https://github.com/takikawa/sweet-racket/commit/3dd16f5009d318aee07551781431c78aa42670c7.
check-equal?(thrush(+ add1)(3) 4)
is reading to
(check-equal? (thrush (+ add1) 3) 4)
When it should be reading to
(check-equal? ((thrush + add1) 3) 4)
Right?
closes https://github.com/takikawa/sweet-racket/issues/4
Is it a good idea to start special-case-ing like this though?