Skip to content

passing ls:let down through multiple levels #132

@arthurhjorth

Description

@arthurhjorth

from our paper:

Importantly, ls:let exists in the context of a parent. This means that the value of a ls:let cannot be passed down through grand children without having to use ls:let again. I.e.

ls:let num-turtles count turtles
ls:ask 0 [
  ls:ask 0 [
    create-turtles num-turtles ;; WILL ERROR
    ]
  ]

Rather, the modeler would need to ask its child model to re-assign the ls:let in its own context, and then pass that into its own child model – the grandchild of the original model:

ls:let num-turtles count turtles
ls:ask 0 [
  ls:let child-num-turtles num-turtles
  ls:ask 0 [
    create-turtles child-num-turtles
    ]
  ]

Any way around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions