We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
define :queue [ init: method [][ this\items: [] <----- INITIAL ASSIGNMENT ] enqueue: method [item][ panic "enqueue must be implemented by concrete type" ] dequeue: method [][ panic "dequeue must be implemented by concrete type" ] ] define :simpleQueue is :queue [ enqueue: method [item][ 'this\items ++ item <----- THIS ALTERS `[]` ITSELF !!!!! print "ENQUEUE" print size [] <----- THIS IS NOT AN EMPTY BLOCK ANYMORE inspect [] ] dequeue: method [][ <----- NOT EVEN THAT IS AN EMPTY BLOCK?! if empty? this\items -> return null pop 'this\items ] ] ; Usage example q: to :simpleQueue []! inspect q inspect to :bytecode [ q\enqueue "first" ] q\enqueue "first" q\enqueue "second" inspect to :bytecode [ q\dequeue ; first ] q\dequeue q\dequeue ; second q\dequeue ; null
The text was updated successfully, but these errors were encountered:
drkameleon
No branches or pull requests
Describe the bug
The text was updated successfully, but these errors were encountered: