anyone here implemented common CS data structures... (stack, queue...)

Andre Garzia soapdog at mac.com
Thu Jul 8 22:04:23 CDT 2004


Rob,

nice setup you have! I am debuging and clearing my "cursed comments" on 
my data structure lib, I'll release it soon, I am just implementing 
some more code... I've implemented a LIFO Queue using box lib by Dar 
Scott, actually, the box lib is almost a second nature to me, sometimes 
I think I use it more than Dar...

and the use of box lib is cool because this way I can insert some 
complex data on the queue like arrays and images... and mix with 
strings and numbers... pretty cool!

Thanks for your email, I never thought of using a queue the way you 
mentioned, I use them usually in calculation process... thanks to your 
explanation I am changing some CGI code of mine to something more 
inteligent. :D

Cheers
andre


On Jul 8, 2004, at 11:28 AM, Rob Cozens wrote:

>> did anyone here, by chance, implemented common data strucutres like 
>> stacks and queues, like  stacks with first in last out behaviour and 
>> first in first out behaviour...
>
> Hi Andre,
>
> I have used LIFO queues in HyperTalk and Transcript.
>
> The queues are simply global or declared local variables containing 
> lists of transaction requests.  Various handlers check the last line 
> of the queue and do different things depending on transaction type.
>
> Example:  OenoLog has a Wine Lot screen where one can add, edit, & 
> delete wine lots.  The screen includes a "Thumbs Up" button the user 
> clicks to complete a transaction.  When the user initiates a 
> transaction, "Add", "Edit", or "Delete" is append to the queue in a 
> new trailing line.  On mouseUp the "Thumbs Up" handler checks the last 
> line of the queue to determine how to process the data in the window.
>
> It can get more complicated:  Suppose I'm in the middle of a Wine Lot 
> Edit transaction, and when I'm shown the Grape Variety screen to 
> select the correct variety, it isn't listed.  I can interrupt the Wine 
> Lot Edit transaction and initiate a Grape Variety Add transaction.  
> The queue now lists "Edit" on one line and "Add" on the following 
> line.  The "Thumbs Up" button on the Grape Variety screen will process 
> the Add and delete the last line of the queue before returning the new 
> Grape Variety to the Wine Lot screen and continuing the Edit.
>
> And it can get even more complicated:  Suppose I'm processing a 
> Winemaking transaction, and when I get to the source tank selection 
> stage I find the tank hasn't been identified to the system.  I must 
> interrupt the Winemaking Add transaction and initiated a Tank Add 
> transaction. The Tank Add transaction must be interrupted by a Wine 
> Lot Add transaction if the Wine Lot in the tank has not been 
> identified to the system.  In turn, that transaction can be 
> interrupted to initiate Grape Variety Add and Vineyard Add 
> transactions is those items are missing.
>
> The use of queue-supported, interruptible transactions allows, among 
> other things, the user to immediately begin transaction processing 
> with NO initial setup, if desired.
>
> Anything more you'ld like to know.
> -- 
>
> Rob Cozens
> CCW, Serendipity Software Company
>
> "And I, which was two fooles, do so grow three;
> Who are a little wise, the best fooles bee."
>
> from "The Triple Foole" by John Donne (1572-1631)
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
-- 
Andre Alves Garzia ð 2004 ð BRAZIL
http://studio.soapdog.org



More information about the use-livecode mailing list