Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
[[tags: egg]] [[toc:]] == queues Single-ended queue data structure. === Usage {{(require-extension queues)}} === Programming interface ==== list->queue <procedure>(list->queue LIST)</procedure> Returns {{LIST}} converted into a queue, where the first element of the list is the same as the first element of the queue. The resulting queue may share memory with the list and the list should not be modified after this operation. ==== make-queue <procedure>(make-queue)</procedure> Returns a newly created queue. ==== queue? <procedure>(queue? X)</procedure> Returns {{#t}} if {{X}} is a queue, or {{#f}} otherwise. ==== queue-length <procedure>(queue-length QUEUE)</procedure> Returns the current number of items stored in {{QUEUE}}. ==== queue->list <procedure>(queue->list QUEUE)</procedure> Returns {{QUEUE}} converted into a list, where the first element of the list is the same as the first element of the queue. The resulting list is freshly allocated and does not share memory with the queue object. ==== queue-add! <procedure>(queue-add! QUEUE X)</procedure> Adds {{X}} to the rear of {{QUEUE}}. ==== queue-empty? <procedure>(queue-empty? QUEUE)</procedure> Returns {{#t}} if {{QUEUE}} is empty, or {{#f}} otherwise. ==== queue-first <procedure>(queue-first QUEUE)</procedure> Returns the first element of {{QUEUE}}. If {{QUEUE}} is empty an error is signaled ==== queue-last <procedure>(queue-last QUEUE)</procedure> Returns the last element of {{QUEUE}}. If {{QUEUE}} is empty an error is signaled ==== queue-remove! <procedure>(queue-remove! QUEUE)</procedure> Removes and returns the first element of {{QUEUE}}. If {{QUEUE}} is empty an error is signaled ==== queue-push-back! <procedure>(queue-push-back! QUEUE ITEM)</procedure> Pushes an item into the first position of a queue, i.e. the next {{queue-remove!}} will return {{ITEM}}. ==== queue-push-back-list! <procedure>(queue-push-back-list! QUEUE LIST)</procedure> Pushes the items in item-list back onto the queue, so that {{(car LIST)}} becomes the next removable item. === Author The CHICKEN Team === Repository This egg is hosted on the CHICKEN Subversion repository: [[https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/queues|https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/queues]] If you want to check out the source code repository of this egg and you are not familiar with Subversion, see [[/egg-svn-checkout|this page]]. === License Copyright (c) 2014, The CHICKEN Team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. === Version History ; 1.0 : Extracted from {{data-structures}} core library unit and released as an egg.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 5 by 5?