-
Notifications
You must be signed in to change notification settings - Fork 372
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
Burninate HyCons #1576
Comments
I'd be okay with it, honestly I've never found a use for it. |
To further expand on this, and I've been meaning to comment on/come back to #1545, but I the [#*(range 10) #*(range 10)] And while I find this super useful, I think because of that, I tend to build my stuff around that style. |
It is perhaps silly that |
We had the A big difference is that
Not really? What would it do? You can already Also, while we're at it, |
Clojure doesn't even have dotted lists, that's from Common Lisp. You can do things with dots that you can't with splices like,
I'm not sure how useful that is. You can't splice it because it's not quoted. Because linked lists made of conses are Common Lisp's primary data structure, used for data as much as code, this capability is more important than for Clojure (or Python or Hy). The auto-boxing also makes it awkward to use Hy models as general-purpose data structures, because it will wrap things it shouldn't when used that way. But the extended unpacking means we don't need this so much either. E.g. instead of, Clojure does not have dotted lists, but it does have But, So I'm not all that opposed to removing the dotted-list syntax. Clojure does fine without it. I'm not satisfied with |
Sounds reasonable.
You could write |
Could we also treat |
What would that imply? Making the compiler automatically recognize and simplify such constructs? I'm not sure how often they're actually used. |
Well, technically, something like |
I feel like we should leave that type of optimization to the Python runtime, to make our astor output predictable for debugging purposes. I'm not sure how much CPython would optimize that kind of thing, but PyPy probably would. Hy's compiler should probably optimize the things that are incidental to Hy itself, like not doing the |
Well, we can It kind of sounds like If you just want one-off splices, maybe a tag macro to eval at compile time would suffice.
I'm still not sure how useful this is. |
This is an idea that's been mentioned briefly in other contexts (e.g.) but hasn't gotten its own issue. I want to remove cons cells because:
cons
may not actually return a cons cell. For example,(cons 1 [2 3 4])
returns['1 2 3 4]
. (The single quote on the first value is from wart #iii.)From a deep dive into issues and PRs, I found two explanations for why we have HyCons:
I disagree with (1) because we've successfully represented Lisp data structures with Python data structures and other Hy model objects like HyExpression and HyList.
As for (2), I'm not sure I understand the explanation or example, perhaps because I'm not familiar with these libraries, but it looks like
`(~?fn ~?name ~?params . ~?body)
could be written`(~fn ~?name ~?params ~@?body)
. Note that we've already broken support for these two libraries in other ways (neither has been updated since April 2016).How do we feel about this?
The text was updated successfully, but these errors were encountered: