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

Imperative flavour: continue & break in loops #44

Open
dumblob opened this issue Jun 11, 2021 · 4 comments
Open

Imperative flavour: continue & break in loops #44

dumblob opened this issue Jun 11, 2021 · 4 comments

Comments

@dumblob
Copy link

dumblob commented Jun 11, 2021

Because XL is fundamentally kind of functional, it seems uneasy to simulate continue from imperative loops. Same goes for break (one could use return instead, but that'd work only without nesting I suppose which renders it completely unusable).

Any plans to provide break is builtin jmp_right_right_after_nearest_loop and continue is builtin jmp_to_the_nearest_loop_label?

@c3d
Copy link
Owner

c3d commented Jun 11, 2021 via email

@c3d
Copy link
Owner

c3d commented Jun 11, 2021

Interesting. It looks like email replies do not support markdown in GitHub. Weird.

@dumblob
Copy link
Author

dumblob commented Jun 11, 2021

Just to clarify, with kind of functional I meant pattern matching and its "purity" making it difficult to express continue without resorting to "hacks" like builtin 😉 (though in a concept language one could argue that there can't be any hack by definition 😉).

Btw. I didn't even know there is function defined somewhere in XL - with kind of functional I was just referring to the pattern matching with the given set of rewriting rules.

Anyway thanks for the goto information - that answers my question! Hopefully I'll find some time to actually do something with XL sooner or later.

@c3d
Copy link
Owner

c3d commented Jun 11, 2021

There is much to be done. Nothing really works right now, I broke everything in my last big refactoring :-)

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

2 participants