Ah!

Thank you for pointing this out. I've always thought that `else' is
treated as a keyword in `match' just as what `cond' does. That
explains everything.

On Mon, Feb 25, 2019 at 6:35 PM Sam Tobin-Hochstadt
<sa...@cs.indiana.edu> wrote:
>
> This is because 'case' expects a particular binding for 'else', but you 
> shadowed it with 'match', which does not treat 'else' differently than any 
> other identifier.
>
> Sam
>
> On Mon, Feb 25, 2019, 7:33 PM Shu-Hung You 
> <shu-hung....@eecs.northwestern.edu> wrote:
>>
>> When using a case expression with an else clause in inside a match
>> expression, the expander complains about case having a bad syntax.
>> However, the use of case expressions outside of match are fine. Is
>> there anyway to get around this?
>>
>> Currently, I just replace it with another match.
>>
>> #lang racket/base
>>
>> (require racket/match)
>>
>> (match 6
>>   [else
>>    (case 5
>>      [else 7])])
>>
>> #|
>> unsaved editor:8:6: case: bad syntax (not a datum sequence) at: else
>> in: (case 5 (else 7))
>>   #(78 4)
>> |#
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to