diff options
author | Marion <marion.zepf@gmail.com> | 2013-09-08 11:28:46 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-09-08 11:28:46 (GMT) |
commit | 7b4a71f103bce1eb408e545e62c162d234574e92 (patch) | |
tree | ca364fbeb437e673ab3ca4cced9ce9d2305355e6 | |
parent | 6f2d7e4ce822ec2bb2a932a1cb7297919eb5eb6a (diff) |
allow the name of a box to be of any type rather than just string
- This commit fixes the issue that the integer 10 and the float 10.0 were
regarded as different box names (in the exported py code) before. It
introduces the issue that 'a' and ord('a') == 97 will be considered
different box names.
- These issues only affect the exported code because the internal execution
engine converts all box names to keys using talogo.LogoCode._get_box_key(),
and thereby eliminates differences between characters, number strings,
integers, and floats.
-rw-r--r-- | TurtleArt/tabasics.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index 5f03994..fc769b0 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -1051,7 +1051,7 @@ buttons')) arg_descs=[ConstantArg('box2')])) primitive_dictionary['setbox'] = Primitive(self.tw.lc.prim_set_box, - arg_descs=[ArgSlot(TYPE_STRING), ArgSlot(TYPE_OBJECT)]) + arg_descs=[ArgSlot(TYPE_OBJECT), ArgSlot(TYPE_OBJECT)]) palette.add_block('storein', style='basic-style-2arg', label=[_('store in'), _('box'), _('value')], @@ -1065,7 +1065,7 @@ variable')) primitive_dictionary['box'] = Primitive(self.tw.lc.prim_get_box, return_type=TYPE_BOX, - arg_descs=[ArgSlot(TYPE_STRING)]) + arg_descs=[ArgSlot(TYPE_OBJECT)]) palette.add_block('box', style='number-style-1strarg', hidden=True, |