I'm considering whether it's necessary and beneficial to define λ
through the renaming mechanism. @sorawee pointed out that lambda
and λ
are not treated as equivalent by free-identifier=?
:
#lang racket
(module sub racket
(provide my-case-lambda
(rename-out [my-case-lambda my-case-λ]))
(define my-case-lambda 1))
(require syntax/parse/define
'sub)
(define-syntax-parse-rule (test a b)
#:do [(println (free-identifier=? #'a #'b))]
(void))
(test my-case-lambda my-case-λ) ;=> #t
(test lambda λ) ;=> #f
If I understand correctly, lambda
and λ
in racket/base
are respectively new-lambda
and new-λ
in racket/private/kw.rkt
:
(define-syntaxes (new-lambda new-λ)
(let ([new-lambda ...])
(values new-lambda new-lambda)))
Based on this, should we consider:
- Implementing
λ
through renaming to ensure that it is equivalent tolambda
? - Investigating the potential impact on existing code that might rely on the current behavior?