diff options
author | Marion <marion.zepf@gmail.com> | 2013-08-15 12:28:27 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-08-15 12:28:27 (GMT) |
commit | b7ea629037af38054b92b11c39719fcf19b175b2 (patch) | |
tree | 1d2ad4d48cc0b721236afe565f795f557d71da1c | |
parent | 6baf15a3956228211a9ab7649247f37a484356f2 (diff) |
add Primitive for the 'minus' block
-rw-r--r-- | TurtleArt/tabasics.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index 211c596..394b5eb 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -627,7 +627,6 @@ tasetshade :shade \n') self.tw.lc.def_prim( 'plus', 2, lambda self, x, y: primitive_dictionary['plus'](x, y)) - primitive_dictionary['minus'] = self._prim_minus palette.add_block('minus2', style='number-style-porch', label=' –', @@ -636,8 +635,17 @@ tasetshade :shade \n') logo_command='taminus', help_string=_('subtracts bottom numeric input from \ top numeric input')) - self.tw.lc.def_prim( - 'minus', 2, lambda self, x, y: primitive_dictionary['minus'](x, y)) + self.tw.lc.def_prim('minus', 2, + # TODO re-enable use with lists + Primitive(Primitive.minus, slot_wrappers={ + 0: Primitive(self.check_number, + export_me=False, + slot_wrappers={ + 0: self.prim_cache["convert_to_number"]}), + 1: Primitive(self.check_number, + export_me=False, + slot_wrappers={ + 0: self.prim_cache["convert_to_number"]})})) define_logo_function('taminus', 'to taminus :y :x\noutput sum :x \ minus :y\nend\n') |