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

make push-named functions consistently (push object collection) #938

Open
stylewarning opened this issue May 23, 2023 · 3 comments
Open

Comments

@stylewarning
Copy link
Member

stylewarning commented May 23, 2023

cel:push! doesn't match vec:push!. CL has (push object collection).

Edit: Possibly use other names for other argument orders?

@gefjon
Copy link
Collaborator

gefjon commented May 23, 2023

(push collection object) is, IMO, a more useful order for currying. (vec:push! my-vec) should be :elt -> Unit push into my-vec, so you can use it on things like iter:for-each!.

@stylewarning
Copy link
Member Author

OTOH for an immutable collection:

COALTON-USER> (coalton
               (pipe
                (seq:new)
                (seq:push 5)
                (seq:push 6)
                (map 1+)))
#<Seq[2] 6 7>

@Izaakwltn
Copy link
Collaborator

I'd like to start this discussion back up ->

I think my alignment is with:
(push collection object)
(get collection index)
(put collection index object)

If we could get the decision finalized I'm happy to go through and fix instances throughout.

I started a poll at: #996 with three order options

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

No branches or pull requests

3 participants