diff options
author | Marion <marion.zepf@gmail.com> | 2013-08-27 09:54:47 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-08-27 09:54:47 (GMT) |
commit | 0f7e2912249904219197a58cbd6ad8e82c544e4d (patch) | |
tree | 0f901af8e08c2a9d95a990c8c466e5feb17b3519 /TurtleArt/talogo.py | |
parent | 86caa80671ca1828993f9e46847ad2beed113d5d (diff) |
introduce disjunctions of Primitives, arg_descs lists, and ArgSlots
- New Primitive object for the 'plus' block that differentiates between
addition of numbers and concatenation of strings.
- Utility function or_ to instantiate a disjunction of the appropriate type.
Diffstat (limited to 'TurtleArt/talogo.py')
-rw-r--r-- | TurtleArt/talogo.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index ef482a1..8eae9a1 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -468,7 +468,9 @@ class LogoCode: self.tw.showblocks() self.tw.display_coordinates() raise logoerror("#noinput") - call_args = type(self.cfun.fcn).__name__ != 'Primitive' + is_Primitive = type(self.cfun.fcn).__name__ == 'Primitive' + is_PrimitiveDisjunction = type(self.cfun.fcn).__name__ == 'PrimitiveDisjunction' + call_args = not (is_Primitive or is_PrimitiveDisjunction) for i in range(token.nargs): self._no_args_check() self.icall(self._eval, call_args) |