unexpected double evaluation of statement.
Posted: Sun Nov 23, 2003 12:47 pm
I'm trying to automatically generate names for tk widgets
this is a sample I've written
(define (newname parent) (string parent "." (inc 'cnt)) )
(define (opt opts) (if (string? opts) opts ""))
(define (toplevel opts) (tk "toplevel " (opt opts)) )
(define (frame parent opts) (tk "frame " (newname parent) " " (opt opts)) )
strangely, if try the following statements :
(set 'cnt 1)
(set 'top (toplevel ".main"))
(set 'frame1 (frame top))
frame1 get the value ".main.3", instead of ".main.2"
While in this case it has no bad effects, however it's disturbing...
What happens ?
Regards
Maurizio
this is a sample I've written
(define (newname parent) (string parent "." (inc 'cnt)) )
(define (opt opts) (if (string? opts) opts ""))
(define (toplevel opts) (tk "toplevel " (opt opts)) )
(define (frame parent opts) (tk "frame " (newname parent) " " (opt opts)) )
strangely, if try the following statements :
(set 'cnt 1)
(set 'top (toplevel ".main"))
(set 'frame1 (frame top))
frame1 get the value ".main.3", instead of ".main.2"
While in this case it has no bad effects, however it's disturbing...
What happens ?
Regards
Maurizio