Compiler rejects _ as case-lambda parameter #556

Open
opened 2020-07-21 17:14:44 +00:00 by fare · 0 comments
fare commented 2020-07-21 17:14:44 +00:00 (Migrated from github.com)

The following form is valid at the REPL, but causes the compiler to blow up:

(def hash-ref-set! (case-lambda ((h k v) (hash-put! h k v)) ((h k _ v) (hash-put! h k v))))

Compiler error:

*** ERROR IN gxc#generate-runtime-call% -- Syntax Error
*** ERROR IN ?
--- Syntax Error at compile: Cannot compile reference to uninterned identifier
... form:   #f

Workaround: renaming _ to _d.

The following form is valid at the REPL, but causes the compiler to blow up: ``` (def hash-ref-set! (case-lambda ((h k v) (hash-put! h k v)) ((h k _ v) (hash-put! h k v)))) ``` Compiler error: ``` *** ERROR IN gxc#generate-runtime-call% -- Syntax Error *** ERROR IN ? --- Syntax Error at compile: Cannot compile reference to uninterned identifier ... form: #f ``` Workaround: renaming `_` to `_d`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mighty-gerbils/gerbil#556
No description provided.