NetLogo / LevelSpace

This is the LevelSpace extension repository. LevelSpace allows you to run NetLogo models |: from inside NetLogo models :|
Other
19 stars 8 forks source link

Parent model should be able to access ls:let vars #60

Closed arthurhjorth closed 9 years ago

arthurhjorth commented 9 years ago

It seems odd to me that the parent model can't access a ls:let. It seems even odder that you can have two vars - one for the parent, and one for the child - with the same name. How much work would it be to give them access to this? could we automatically add a let to the parent when we use ls:let?

qiemem commented 9 years ago

We'd need to create a specific reporter to retrieve the contents of the variable. I actually made this reporter for debugging but then removed.

There's no reason to have this thing though since the parent already has whatever information it's sticking in the variable.

could we automatically add a let to the parent when we use ls:let?

Unfortunately, no, since the variable isn't known at compile time. Changing this would probably require extensive changes to the NetLogo compiler.