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

Use queue like a sequence? #69

Open
minghu6 opened this issue Aug 5, 2020 · 2 comments
Open

Use queue like a sequence? #69

minghu6 opened this issue Aug 5, 2020 · 2 comments

Comments

@minghu6
Copy link

minghu6 commented Aug 5, 2020

During working with queue, I found it's unconvenient for there is no iteration interface for queue.

In many times, I have to follow the flow:

myqueue: 
=> (qlist myqueue) 
=> operating on sequence... 
=> (apply 'queue mysequnce)

Required API:
qiter, qinto corresponds to map on first level of queue.
qwalk, qmap corresponds to map on the whole queue tree.
qlist-1, qlist corresponds to old qlist and qlist-1 for all level.

Or It's better to impl sequnce method for queue, for example http://research.gold.ac.uk/2344/1/sequences-20070301.pdf

@ruricolist
Copy link
Owner

Serapeum uses queues internally to implement higher-level sequence functions, so I need to keep them as simple and efficient as possible -- which is why they are structures and not CLOS classes, which they would have to be to support the sequence protocol. (Note also that Serapeum officially supports CCL, which doesn't implement the sequence protocol.)

But it would be nice to provide a more convenient way of iterating over queues.

@minghu6
Copy link
Author

minghu6 commented Aug 10, 2020

I'm surpressed that not all lisp-impl support sequence protocol.
A decent impl should supply a way to supply user extensible sequence.

Sigh, dead language standard let common lisp not common (sadly).

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