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

Anonymous procedures break ls:let bindings #121

Closed qiemem closed 6 years ago

qiemem commented 6 years ago

Demonstrated by these tests:

ls-let-sees-outer-procedure-scope
  extensions [ ls ]
  O> ls:create-models 1 "extensions/ls/test/Blank.nlogo"
  O> ls:let foo 3 run [ ls:let bar 7 ls:ask 0 [ crt foo + bar ] ]
  [ count turtles ] ls:of 0 => 10

ls-lets-can-be-closed-over
  extensions [ ls ]
  O> ls:create-models 1 "extensions/ls/test/Blank.nlogo"
  to-report get-command [ x ] ls:let foo x report [ -> ls:ask 0 [ crt foo ] ] end
  O> run (get-command 3)
  [ count turtles ] ls:of 0 => 3
  to-report get-reporter [ x ] ls:let foo x report [ -> [ foo ] ls:of 0 ] end
  runresult (get-reporter 5) => 5
qiemem commented 6 years ago

Fixed by NetLogo/NetLogo#1581 in conjunction with 1334476b7d4fd758a6f44aa868b36e3a0be55abd