Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode lambda #1374

Merged
merged 5 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion typed-racket-compatibility/typed/scheme/base.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
with-handlers with-handlers* default-continuation-prompt-tag
define λ lambda define-struct for for*
let let* let-values let*-values letrec letrec-values
let/cc let/ec do case-lambda
let/cc let/ec do case-lambda case-λ
for/list for/vector for/hash for/hasheq for/hasheqv for/hashalw
for/and for/or for/sum for/product for/lists
for/first for/last for/fold for/foldr for*/list for*/lists
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should add/change anything to legacy or compatibility libraries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should add/change anything to legacy or compatibility libraries.

If this file is not modified, an error will be reported (I forgot to record the specific error message).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/share/racket/pkgs/typed-racket-compatibility/typed/scheme/base.rkt:20:22: module: identifier already required
  at: case-λ
  in: typed-racket/base-env/prims
  also provided by: scheme/base
  compilation context...:
   /usr/share/racket/pkgs/typed-racket-compatibility/typed/scheme/base.rkt
  location...:
   /usr/share/racket/pkgs/typed-racket-compatibility/typed/scheme/base.rkt:20:22
  context...:
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:700:0: compile-zo*
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:633:0: compile-zo*/cross-compile
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:449:15
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:435:12: build
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:406:0: maybe-compile-zo
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:210:0: compile-root
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:317:16
   /usr/share/racket/collects/compiler/private/cm-util.rkt:14:0: ormap-strict
   [repeats 4 more times]
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:210:0: compile-root
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:317:16
   /usr/share/racket/collects/compiler/private/cm-util.rkt:14:0: ormap-strict

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I read the wrong file in the reply, sorry!

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ A function of the formal arguments @racket[v], where each formal
argument has the associated type. If a rest argument is present, then
it has type @racket[(Listof t)].}

@defform[(λ: formals maybe-ret . body)]{
An alias for the same form using @racket[lambda:].}
@defalias[λ: lambda: "syntax"]

@defform*[[(plambda: (a ...) formals maybe-ret . body)
(plambda: (a ... b ooo) formals maybe-ret . body)]]{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ is the provided type annotation.
]
}

@defform[(λ maybe-tvars formals maybe-ret . body)]{
An alias for the same form using @racket[lambda].}
@defalias[λ lambda "syntax"]

@defform[(case-lambda maybe-tvars [formals body] ...)]{

Expand All @@ -214,6 +213,8 @@ Note that each @racket[formals] must have a different arity.
To see how to declare a type for @racket[add-map], see the
@racket[case->] type constructor.}

@defalias[case-λ case-lambda "syntax"]

@section{Loops}

@defform/subs[(for void-ann-maybe (for-clause ...) void-ann-maybe expr ...+)
Expand Down
1 change: 1 addition & 0 deletions typed-racket-lib/typed-racket/base-env/prims-lambda.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

(provide (rename-out [-case-lambda case-lambda]
[-case-lambda case-lambda:]
[-case-lambda case-λ]
[lambda: λ:])
pcase-lambda:
plambda:
Expand Down
2 changes: 1 addition & 1 deletion typed-racket-lib/typed-racket/private/with-types.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
(except-in racket/base for for* with-handlers with-handlers*
lambda λ define
let let* letrec letrec-values let-values let*-values
let/cc let/ec do case-lambda struct define-struct
let/cc let/ec do case-lambda case-λ struct define-struct
default-continuation-prompt-tag
for/list for/vector for/hash for/hasheq for/hasheqv for/hashalw
for/and for/or for/sum for/product for/lists
Expand Down
2 changes: 1 addition & 1 deletion typed-racket-lib/typed/racket/base.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
with-handlers with-handlers* default-continuation-prompt-tag
define λ lambda define-struct for for*
let let* let-values let*-values letrec letrec-values
let/cc let/ec do case-lambda struct
let/cc let/ec do case-lambda case-λ struct
for/list for/vector for/hash for/hasheq for/hasheqv for/hashalw
for/and for/or for/sum for/product for/lists
for/first for/last for/fold for/foldr for*/list for*/lists
Expand Down
8 changes: 8 additions & 0 deletions typed-racket-test/succeed/unicode-aliases.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@
(cons (symbol? s) i)))
(foo 'abc)
(foo "abc")

(: bar (∀ () (case→ (→ True) (→ Any False))))
(define bar
(case-λ
[() #t]
[([_ : Any]) #f]))
(bar)
(bar bar)