Skip to content

Question about code_do*range #307

@Vaguery

Description

@Vaguery

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions