2626 Real ,
2727 String ,
2828 Symbol ,
29+ SymbolList ,
30+ SymbolN ,
31+ SymbolMakeBoxes ,
2932 strip_context ,
3033 system_symbols ,
3134 system_symbols_dict ,
@@ -290,7 +293,7 @@ def _CMC_distance(lab1, lab2, l, c):
290293
291294
292295def _extract_graphics (graphics , format , evaluation ):
293- graphics_box = Expression ("MakeBoxes" , graphics ).evaluate (evaluation )
296+ graphics_box = Expression (SymbolMakeBoxes , graphics ).evaluate (evaluation )
294297 builtin = GraphicsBox (expression = False )
295298 elements , calc_dimensions = builtin ._prepare_elements (
296299 graphics_box .leaves , {"evaluation" : evaluation }, neg_y = True
@@ -398,7 +401,7 @@ def apply(self, graphics, evaluation, options):
398401
399402 for option in options :
400403 if option not in ("System`ImageSize" ,):
401- options [option ] = Expression ("N" , options [option ]).evaluate (evaluation )
404+ options [option ] = Expression (SymbolN , options [option ]).evaluate (evaluation )
402405
403406 # The below could probably be done with graphics.filter..
404407 new_leaves = []
@@ -475,7 +478,7 @@ def convert(content):
475478 head = content .get_head_name ()
476479
477480 if head == "System`List" :
478- return Expression ("List" , * [convert (item ) for item in content .leaves ])
481+ return Expression (SymbolList , * [convert (item ) for item in content .leaves ])
479482 elif head == "System`Style" :
480483 return Expression (
481484 "StyleBox" , * [convert (item ) for item in content .leaves ]
@@ -492,12 +495,12 @@ def convert(content):
492495 ):
493496 if head == "System`Inset" :
494497 n_leaves = [content .leaves [0 ]] + [
495- Expression ("N" , leaf ).evaluate (evaluation )
498+ Expression (SymbolN , leaf ).evaluate (evaluation )
496499 for leaf in content .leaves [1 :]
497500 ]
498501 else :
499502 n_leaves = (
500- Expression ("N" , leaf ).evaluate (evaluation )
503+ Expression (SymbolN , leaf ).evaluate (evaluation )
501504 for leaf in content .leaves
502505 )
503506 else :
@@ -507,7 +510,7 @@ def convert(content):
507510
508511 for option in options :
509512 if option not in ("System`ImageSize" ,):
510- options [option ] = Expression ("N" , options [option ]).evaluate (evaluation )
513+ options [option ] = Expression (SymbolN , options [option ]).evaluate (evaluation )
511514 from mathics .builtin .graphics3d import Graphics3DBox , Graphics3D
512515
513516 if type (self ) is Graphics :
@@ -986,9 +989,9 @@ def distance(a, b):
986989 * [distance (a , b ) for a , b in zip (c1 .leaves , c2 .leaves )]
987990 )
988991 else :
989- return Expression ("List" , * [distance (c , c2 ) for c in c1 .leaves ])
992+ return Expression (SymbolList , * [distance (c , c2 ) for c in c1 .leaves ])
990993 elif c2 .get_head_name () == "System`List" :
991- return Expression ("List" , * [distance (c1 , c ) for c in c2 .leaves ])
994+ return Expression (SymbolList , * [distance (c1 , c ) for c in c2 .leaves ])
992995 else :
993996 return distance (c1 , c2 )
994997 except ColorError :
@@ -1436,7 +1439,7 @@ def do_init(self, graphics, points):
14361439 leaves = points .leaves
14371440 self .multi_parts = True
14381441 else :
1439- leaves = [Expression ("List" , * points .leaves )]
1442+ leaves = [Expression (SymbolList , * points .leaves )]
14401443 self .multi_parts = False
14411444 lines = []
14421445 for leaf in leaves :
@@ -1492,7 +1495,7 @@ def init(self, graphics, style, item=None):
14921495 points = item .leaves [0 ]
14931496 if points .has_form ("List" , None ) and len (points .leaves ) != 0 :
14941497 if all (not leaf .has_form ("List" , None ) for leaf in points .leaves ):
1495- points = Expression ("List" , points )
1498+ points = Expression (SymbolList , points )
14961499 self .do_init (graphics , points )
14971500 else :
14981501 raise BoxConstructError
@@ -1890,7 +1893,7 @@ def process_option(self, name, value):
18901893 self .vertex_colors = [[black ] * len (line ) for line in self .lines ]
18911894 colors = value .leaves
18921895 if not self .multi_parts :
1893- colors = [Expression ("List" , * colors )]
1896+ colors = [Expression (SymbolList , * colors )]
18941897 for line_index , line in enumerate (self .lines ):
18951898 if line_index >= len (colors ):
18961899 break
@@ -2046,7 +2049,7 @@ def vertices():
20462049 )
20472050
20482051 new_item = Expression (
2049- "RegularPolygonBox" , Expression ("List" , * list (vertices ()))
2052+ "RegularPolygonBox" , Expression (SymbolList , * list (vertices ()))
20502053 )
20512054 else :
20522055 raise BoxConstructError
@@ -3525,7 +3528,7 @@ def apply(self, colors, u, evaluation):
35253528 if not colors :
35263529 raise ColorError
35273530 except ColorError :
3528- evaluation .message ("Blend" , "arg" , Expression ("List" , colors_orig ))
3531+ evaluation .message ("Blend" , "arg" , Expression (SymbolList , colors_orig ))
35293532 return
35303533
35313534 if u .has_form ("List" , None ):
@@ -3546,7 +3549,7 @@ def apply(self, colors, u, evaluation):
35463549 use_list = False
35473550 if values is None :
35483551 return evaluation .message (
3549- "Blend" , "argl" , u , Expression ("List" , colors_orig )
3552+ "Blend" , "argl" , u , Expression (SymbolList , colors_orig )
35503553 )
35513554
35523555 if use_list :
0 commit comments