2
Vote

[Idea] Default library for push/Pop stacks

description

this Came to me by Arden

He wants to extend MonkeySpeaks reach into stacks

[8/27/2014 6:31:23 PM] Ya Doctor: (5:XX) Push %variable to the TOP of %array.
(5:XX) Push %variable to the BOTTOM of %array.
(5:XX) Pop from the TOP of %array into %variable.
(5:XX) Pop from the BOTTOM of %array into %variable.
(5:XX) Peek from the TOP of %array into %variable.
(5:XX) Peek from the BOTTOM of %array into %variable.
(5:XX) Pop from the TOP of %array and discard the entry.
(5:XX) Pop from the BOTTOM of %array and discard the entry.
[8/27/2014 6:34:52 PM] Ya Doctor: Or you could make it a traditional LIFO stack.
[8/27/2014 6:35:51 PM] Ya Doctor: [Push %v to %s] and [Pop %s to %v]\
[8/27/2014 6:36:50 PM] Ya Doctor: to make it useful, of course, it might be best to have it bounded, push to top and auto pop

comments

Squizzle wrote Aug 30, 2014 at 1:43 AM

This is planned after I redo the lexer to remove the dependency on Regex and use Expressions instead. Just like the way the Java version does it. If you look at the Java version when I used Expressions it allowed me to extend the language so much easier and add arrays.

When I do get around to implementing it I will have a separate type that will be called VariableTable and will act like a Variable but with a backing array store.

Squizzle wrote Aug 30, 2014 at 1:45 AM

The reason I chose to make it a "table" is because it will store indexes based on string and integer. Just wanted to make it clear.

wrote Aug 30, 2014 at 1:45 AM

wrote Aug 30, 2014 at 1:45 AM

wrote Aug 30, 2014 at 1:46 AM