Skip to content

(select case ...) does not evaluate test clauses #10

@jarcane

Description

@jarcane

This is a limitation, apparently, of the Racket version. Racket's (case ...) quotes its matching clauses, so they are not actually evaluated, just compared to the value expression with equal?

So this works:

(select case (mod 5 2)
  ((1) 'foo)
  ((0) 'bar))

; returns 'foo

But this doesn't:

(select case 1
  ((mod 5 2) 'foo)
  ((mod 2 2) 'bar))

; expect 'foo, but falls through instead.void

I think the case can be made for writing our own (select case ...) to allow for this usage. It's a common enough behavior in other language's case statements, so if it's possible to do with Racket's macros I think it's worth implementing.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions