diff options
Diffstat (limited to 'TurtleArt/taprimitive.py')
-rw-r--r-- | TurtleArt/taprimitive.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/TurtleArt/taprimitive.py b/TurtleArt/taprimitive.py index 217b0cb..6e23ad0 100644 --- a/TurtleArt/taprimitive.py +++ b/TurtleArt/taprimitive.py @@ -191,7 +191,8 @@ class Primitive(object): except TATypeError as error: break else: - new_slot_list.append(ConstantArg(value)) + new_slot_list.append(ConstantArg(value, + call_arg=slot.call_arg)) else: new_slot_list.append(slot) if error is None: @@ -206,6 +207,7 @@ class Primitive(object): if isinstance(kwarg_desc, ArgSlot): value = kwarg_desc.fill(keywords[key], convert_to_ast=convert_to_ast) + # TODO don't we need the ConstantArg constructor here as well? new_prim.kwarg_descs[key] = value return new_prim @@ -522,16 +524,18 @@ class Primitive(object): yield True @staticmethod - def controller_while(boolean): - """ Loop controller for the 'while' block """ - while boolean: + def controller_while(condition): + """ Loop controller for the 'while' block + condition -- callable that is evaluated every time through the loop """ + while condition(): yield True yield False @staticmethod - def controller_until(boolean): - """ Loop controller for the 'until' block """ - while not boolean: + def controller_until(condition): + """ Loop controller for the 'until' block + condition -- callable that is evaluated every time through the loop """ + while not condition(): yield True yield False |