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

: instead of -> #177

Open
jgarte opened this issue Jun 28, 2024 · 2 comments
Open

: instead of -> #177

jgarte opened this issue Jun 28, 2024 · 2 comments

Comments

@jgarte
Copy link

jgarte commented Jun 28, 2024

Hi,

What do you think if instead of -> for annotating types that we use :?

So for example,

(: dict* (hash-table &rest t) hash-table)
(defun dict* (dict &rest args)
  ...)

Instead of

(-> dict* (hash-table &rest t) hash-table)
(defun dict* (dict &rest args)
  ...)

This will avoid conflicts with lispers that like to commonly use function threading arrow macros such as ->.

What do you think?

@ruricolist
Copy link
Owner

I like it aesthetically, but I don't think it's workable in CL. It would have to be written :||; not all Lisps allow binding macros to keywords; and generally it would be considered bad style in CL for a library to change a global binding outside its package.

@jgarte
Copy link
Author

jgarte commented Jun 30, 2024

Thanks for the reply. Your points make sense. Not sure what else to add but thanks for the information. I'll ponder it further. I might just write vanilla type specifiers instead when needed since the arrow conflicts with my threading arrow usually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants