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

Needed: Try/Catch for Dry-Running Instructions #15

Open
tajmone opened this issue Oct 5, 2020 · 0 comments
Open

Needed: Try/Catch for Dry-Running Instructions #15

tajmone opened this issue Oct 5, 2020 · 0 comments
Labels
💡 limitations Current limitations of ALAN Language, and possible solutions ⭐ ALAN Lang Topic: The ALAN Language and its instructions set

Comments

@tajmone
Copy link
Contributor

tajmone commented Oct 5, 2020

I'm adding here this feature request as a reminder of what was already discussed in AnssiR66/AlanStdLib#57 regarding the need to introduce some syntactic construct that allow testing if a given action would be achievable, before actually carrying it out.

The need rose from the realization that VERBs, SCRIPTs, RULEs and EVENTs might clash with container's constraint when attempting to dis-locate an object from one place to another, and that the failure to EXTRACT the object would interrupt the VERB (etc.) execution without warning.

E.g. some verbs might require implicit taking (e.g. eating or throwing something that the hero doesn't posses but it's in the vicinity). The problem is that currently there's no way to test if attempting to move the object (e.g. into the hero's inventory first) would succeed or fail, so in case of failure the VERB interrupts execution abruptly without allowing to print an adequate message.

Having access to a special instruction that would allow to "dry-run" an instruction, returning true/false, would allow to handle such cases.

In the previous discussions various solution were proposed, along the line of TRY/CATCH, but it didn't develop anywhere beyond drafty ideas. So I though of creating this Issue here, since in the meantime the ALAN repo was moved from Bitbucket to GitHub, and the newsletter archives were deleted from Yahoo.

I've also created the limitations label for this type of Issue, because I vaguely remember an old email exchange proposing to store somewhere the various discussion on current limits of the ALAN language.

@tajmone tajmone added ⭐ ALAN Lang Topic: The ALAN Language and its instructions set 💡 limitations Current limitations of ALAN Language, and possible solutions labels Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 limitations Current limitations of ALAN Language, and possible solutions ⭐ ALAN Lang Topic: The ALAN Language and its instructions set
Projects
None yet
Development

No branches or pull requests

1 participant