Summary

when compiled, set! will clobber previous lambda-info's

Metadata

Description

I don't really know what's going on, but set! alters the previous ##sys#lambda-info structure:

 1442 klm@kth ~/chicken-5-klm ➤ cat /tmp/klm.scm
 (define (foo a b c) 0)         (print foo)
 (set! foo (lambda (x y z) 1))  (print foo)
 
 1444 klm@kth ~/chicken-5-klm ➤ csc /tmp/klm.scm && /tmp/klm
 #<procedure (f_218 a1 b2 c3)> ;; bad
 #<procedure (foo x4 y5 z6)>   ;; good
 
 1444 klm@kth ~/chicken-5-klm ➤ csi -s /tmp/klm.scm 
 #<procedure (foo a b c)>      ;; good
 #<procedure (foo x y z)>      ;; good

Changes and comments

[2017-04-13 14:52:49 UTC] kristianlm wrote:

Note that I think it's a good idea to fix this, so that we can remove the explicitly-defined getter-with-setter info-strings of caar, caaar, cadar and all friends:

 (set! caaar (getter-with-setter caaar (lambda (x y) (set-car! (caar x) y)) "(caaar p)"))

With this fix, it could just use the info-string from the getter. As of now, we can't just remove the info-strings because of this strange set! behaviour.

[2017-07-03 22:15:05 UTC] LemonBoy wrote:

What happens here is that when we walk trough the database containing the informations gathered by the first analysis pass we only have the latest value that's been assigned to a given variable, hence set-real-name! "wires" the second lambda to the name 'foo but not the first one. This may be fixed by calling set-real-name! in assign so that all the lambda ids are correctly associated to the variable it is bound to. This may have some adverse side effects so take this suggestion with a grain of salt.

[2017-08-25 15:29:38 UTC] sjamaan set difficulty to medium

[2017-08-25 15:29:38 UTC] sjamaan changed milestone from someday to 5.1

[2018-04-27 14:17:46 UTC] evhan changed milestone from 5.1 to 5.0

[2018-04-27 14:17:46 UTC] evhan wrote:

Patch posted.

[2018-04-29 00:09:34 UTC] sjamaan changed status from new to closed

[2018-04-29 00:09:34 UTC] sjamaan set resolution to fixed

[2018-04-29 00:09:34 UTC] sjamaan wrote:

Fixed by 1527e04682ef4d2b182151ac35a70e032875bdc6