diff options
author | Marion <marion.zepf@gmail.com> | 2013-08-12 15:09:46 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-08-12 15:09:46 (GMT) |
commit | 6edade53f3b0bc23adfd215a67770aec4a726d62 (patch) | |
tree | 151f42b00a0216c17848d2ea0badb30ea0f1d2d7 /TurtleArt/tabasics.py | |
parent | 41e58dde24b5a93496edf30b35ff963fc53d48b9 (diff) |
add Primitives for the 'less than' and 'greater than' blocks
Diffstat (limited to 'TurtleArt/tabasics.py')
-rw-r--r-- | TurtleArt/tabasics.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index 7702ad5..7a1d957 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -721,7 +721,6 @@ output (random (:max - :min)) + :min\nend\n') help_string=_('used as numeric input in mathematic \ operators')) - primitive_dictionary['more'] = self._prim_more palette.add_block('greater2', style='compare-porch-style', label=' >', @@ -730,11 +729,11 @@ operators')) prim_name='greater?', logo_command='greater?', help_string=_('logical greater-than operator')) - self.tw.lc.def_prim( - 'greater?', 2, - lambda self, x, y: primitive_dictionary['more'](x, y)) + self.tw.lc.def_prim('greater?', 2, + Primitive(Primitive.greater, + slot_wrappers={0: self.prim_cache["convert_for_cmp"], + 1: self.prim_cache["convert_for_cmp"]})) - primitive_dictionary['less'] = self._prim_less palette.add_block('less2', style='compare-porch-style', label=' <', @@ -743,10 +742,11 @@ operators')) prim_name='less?', logo_command='less?', help_string=_('logical less-than operator')) - self.tw.lc.def_prim( - 'less?', 2, lambda self, x, y: primitive_dictionary['less'](x, y)) + self.tw.lc.def_prim('less?', 2, + Primitive(Primitive.less, + slot_wrappers={0: self.prim_cache["convert_for_cmp"], + 1: self.prim_cache["convert_for_cmp"]})) - primitive_dictionary['equal'] = self._prim_equal palette.add_block('equal2', style='compare-style', label='=', |