Opened 3 months ago

Last modified 3 months ago

#1363 new defect

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

Reported by: kristianlm Owned by:
Priority: minor Milestone: someday
Component: unknown Version:
Keywords: Cc:
Estimated difficulty:


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

Change History (1)

comment:1 Changed 3 months ago by kristianlm

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.

Note: See TracTickets for help on using tickets.