Skip to content
New issue

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

Incrementing list (state machine) out of index nulls it #935

Open
menaechmi opened this issue Feb 14, 2025 · 0 comments
Open

Incrementing list (state machine) out of index nulls it #935

menaechmi opened this issue Feb 14, 2025 · 0 comments

Comments

@menaechmi
Copy link

menaechmi commented Feb 14, 2025

Borrowing from the example in the Writing with Ink book:

LIST PancakeState = ingredients_gathered, batter_mix, pan_hot, pancakes_tossed, (ready_to_eat)
{PancakeState} (Prints "ready_to_eat")
~ PancakeState++
{PancakeState} (PancakeState doesn't print)
~ PancakeState--
{PancakeState} (PancakeState doesn't print)

In this case, nulling the variable is just failing silently, and could lead to problems. I would suggest either raising an exception, or not incrementing the index (which seems like the more ink way to do it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant