inexorabletash / jslogo

Logo in JavaScript
https://calormen.com/jslogo
Other
368 stars 146 forks source link

Support list notation for control structure predicates #90

Closed inexorabletash closed 7 years ago

inexorabletash commented 7 years ago

In addition to:

ifelse :x > 0 [show "pos] [show "neg]
while :x < 10 [show :x  make "x :x + 1]

...UCBLogo supports the syntax:

ifelse [:x > 0] [show "pos] [show "neg]
while [:x < 10] [show :x  make "x :x + 1]

Both are supported for IF, IFELSE and TEST.

Only the list notation (tfexpression) for WHILE, DO.WHILE, UNTIL, and DO.UNTIL in UCBLogo because they are implemented as library functions.