@@ -612,6 +612,19 @@ def process_assign_format(self, lhs, rhs, evaluation, tags, upset):
612612 return count > 0
613613
614614
615+ def process_assign_list (self , lhs , rhs , evaluation , tags , upset ):
616+ if not (
617+ rhs .get_head_name () == "System`List" and len (lhs .elements ) == len (rhs .elements )
618+ ): # nopep8
619+ evaluation .message (self .get_name (), "shape" , lhs , rhs )
620+ return False
621+ result = True
622+ for left , right in zip (lhs .elements , rhs .elements ):
623+ if not self .assign (left , right , evaluation ):
624+ result = False
625+ return result
626+
627+
615628def process_assign_makeboxes (self , lhs , rhs , evaluation , tags , upset ):
616629 # FIXME: the below is a big hack.
617630 # Currently MakeBoxes boxing is implemented as a bunch of rules.
@@ -768,6 +781,7 @@ class _SetOperator:
768781 "System`DefaultValues" : process_assign_definition_values ,
769782 "System`DownValues" : process_assign_definition_values ,
770783 "System`Format" : process_assign_format ,
784+ "System`List" : process_assign_list ,
771785 "System`MakeBoxes" : process_assign_makeboxes ,
772786 "System`MessageName" : process_assign_messagename ,
773787 "System`Messages" : process_assign_definition_values ,
@@ -800,11 +814,10 @@ def assign_elementary(self, lhs, rhs, evaluation, tags=None, upset=False):
800814 def assign (self , lhs , rhs , evaluation ):
801815 # lhs._format_cache = None
802816 defs = evaluation .definitions
803- if lhs .get_head_name () == "System`List" :
817+ if False and lhs .get_head_name () == "System`List" :
804818 if not (rhs .get_head_name () == "System`List" ) or len (lhs .elements ) != len (
805819 rhs .elements
806820 ): # nopep8
807-
808821 evaluation .message (self .get_name (), "shape" , lhs , rhs )
809822 return False
810823 else :
0 commit comments