Opened 5 years ago

Closed 5 years ago

#398 closed defect (wontfix)

Allow repeated keys in `case`

Reported by: cowan Owned by: alexshinn
Priority: major Milestone:
Component: WG1 - Core Keywords:


R5RS says it's an error for a key to appear in more than one clause of case (or twice in the same clause, but that's trivial). R6RS allows the same key to appear more than one clause, but insists on left-to-right testing throughout, like cond. The R6RS editors thought this was better for machine-generated code, though worse for hand-written code.

I suggest a compromise: allow keys to appear in more than one clause, but behave as if the key appeared only in the first (leftmost) clause. This allows hash-table or other non-left-to-right implementations.

Change History (3)

comment:1 Changed 5 years ago by aag

If machine-generated code is the only justification for this change, then let's not make it. It's so easy to eliminate repeated keys even in machine-generated code that there's no excuse for not doing so.

comment:2 Changed 5 years ago by cowan

  • Status changed from new to decided

WG1 decided to keep the R5RS rules: no duplicate keys.

comment:3 Changed 5 years ago by cowan

  • Resolution set to wontfix
  • Status changed from decided to closed
Note: See TracTickets for help on using tickets.