saulpw / aipl

Array-Inspired Pipeline Language
MIT License
119 stars 7 forks source link

Rankout 0 and 0.5 that replace the top-level table lose their `__parent` #43

Open anjakefala opened 1 year ago

anjakefala commented 1 year ago

Reductions replace the top-level table.

Example code:

 !literal>feigenbaum                                                                                                                                  
 4.66920                                                                                                                                              
 !!python                                                                                                                                             
 from aipl import defop                                                                                                                               
 from aipl.table import Table                                                                                                                         
 @defop('test', 1.5, 0)                                                                                                                               
 def testtest(aipl, t:Table) -> str:                                                                                                                  
     return '42'                                                                                                                                      

 !test                                                                                                                                                
 !format                                                                                                                                              
 {feigenbaum}                                                                                                                                         
 # AIPL Error (line 11 !format): 'feigenbaum'                                                                                                         
 !nop      

Originally posted by @anjakefala in https://github.com/saulpw/aipl/issues/23#issuecomment-1585459205