-
Notifications
You must be signed in to change notification settings - Fork 215
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
Support for :list
#431
Comments
I was dropped at some point of not being very useful - (list? '())
(list? (conj '() 1))
(list? (reverse '()))
(list? (list (seq '())))
; => true
(list? (map identity '()))
(list? (cons 1 '()))
(list? (seq '()))
(list? (concat '() '()))
; => false Do you find explicit list useful? here's the commit: 0acde2b |
Granted, this has probably never caused much problems because lists are seldom used in the vast majority of projets. They are commonly used in metaprogramming but not much elsewhere. I was more surprised because of the fact that it is a core data structure rather than by unfulfilled obvious use cases. The only reason I noticed it is, once again, due to generation. [:and
[:cat [:* :int]]
seq?]
;; Note, does not allow :ref Or [:and
[:sequential
{:gen/fmap #(or (list* %)
'())}
:int]
seq?] Which looks a bit over-engineered for a simple list. Unless I am missing something? |
Registering a custom Sadly, the current impl of But then again, we can make |
So it looks that there is now everything needed for having What would a good PR be like, anything besides those points? Adding:
Note on example in #433: predicate should be I would argue that it is a good idea having |
(and it is also consistent with having support for |
I realized that there is currently no support for
:list
, unlike other collections (:vector
,:set
). Since this is pretty basic, I was wondering if it was somehow a deliberate choice. If not, a PR looks fairly straightforward to write.The text was updated successfully, but these errors were encountered: