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

Question about code_do*range #307

Open
Vaguery opened this issue Aug 8, 2024 · 0 comments
Open

Question about code_do*range #307

Vaguery opened this issue Aug 8, 2024 · 0 comments

Comments

@Vaguery
Copy link
Contributor

Vaguery commented Aug 8, 2024

I'm working through an stepwise explanation of :code_do*range behavior in a blog post, and am wondering something:

The way it's defined in Clojush it will (1) pop a :code item, and (2) execute that code item at least twice, at the end of the loop, when the counters are equal.

Is that actually the desired effect? I ask only because the continuation form produced when the looping is finished is equivalent to (:q1 (:k1 :k2 :q1)), where :q1 is the code item and the two numbers are the (identical) start and end counters. So the counters are preserved, and pushed to the :integer stack. The :code item is executed twice: once as to-do and once as popped-arguments at the end.

It seems as though a :code_quote is missing from the second instance in the continuation form. Or not! I don't know what's intended, because there's no real documentation on the instruction itself.

It just seems like there's an extra.

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