Closed orivej closed 9 years ago
Yeah, looks like I had a different idea about how this should work at some point, but only fixed one of them. Though to be honest, the way it's done now isn't exactly pleasing to me. I'll see about it.
Sorry, but 2a66e6d would not work: in
(let (#:red-color1326 #:red-brush1327)
(unwind-protect
(let* ((#:red-color1326 (q+ "MAKE-QCOLOR" 255 0 0))
(red-color #:red-color1326)
(#:red-brush1327 (q+ "MAKE-QBRUSH" red-color))
(red-brush #:red-brush1327))
(q+ "ADD-ELLIPSE" scene 0 0 100 100 (q+ "MAKE-QPEN") red-brush)
(q+ "ADD-RECT" scene 100 0 100 100 (q+ "MAKE-QPEN") red-brush))
(finalize #:red-brush1327)
(finalize #:red-color1326)))
finalization happens out of scope of inner let*
, where temporaries are not initialized, and this also would not be accepted by let
where further bindings can not reference preceding ones.
Your first issue is correct, but the second one isn't. You can't reference gensyms. I think I see now why I went the gross route of pushing things to a list before. Eugh.
I meant that (let ((#:red-color1326 (q+ "MAKE-QCOLOR" 255 0 0)) (red-color #:red-color1326)
is not compilable because red-color
can not reference preceding #:red-color1326
in let
.
Ahh-- right. I'm stupid. I really shouldn't be doing stuff like this early in the morning, sorry.
Can you confirm it working now? I don't trust myself during mornings anymore.
Nice fix. Thanks!
For example, when
with-finalizing*
expands tothe first inner binding for
#:values1308
shadows its outer binding, and onlyred-color
gets finalized. It seems thatwith-finalizing*
should be implemented just likewith-finalizing
withlet*
instead oflet
.