You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whereas this is the behavior I'm seeing for PUSH / POP:
? MAKE "my.stack (LIST )
? PRINT my.stack
? PUSH "my.stack "foo
? PRINT my.stack
foo
? PUSH "my.stack "bar
? PRINT my.stack
bar foo
? PUSH "my.stack "baz
? PRINT my.stack
baz bar foo
? PRINT POP "my.stack
baz
So, DEQUEUE and POP are both returning the first item in the list; but, if you constructed the list using their counterparts QUEUE and PUSH, I believe the code works as expected.
Is there a particular problem you're trying to tackle where it's not so much about the behavior of DEQUEUE and POP as it is that you'd like to get the last item from a list? Or are you seeing different behavior than what I'm seeing?
dequeue happens to remove and output the first item of a list (thus being identical to pop), while it should remove and return the last item.
The text was updated successfully, but these errors were encountered: