Search
Monday, 3rd of June 2019, 12:20:21 UTC
17:09:30
asarch
One stupid question: as far I know, (let) is only for variables and (flet) for functions). Is there anything for both variables and functions?
17:10:06
Bike
no. what would that do? bind a name both as a variable and as a function?
17:10:23
Bike
or would you have to distinguish variables from functions somehow
17:12:46
asarch
Using GTK+ for Common Lisp with cl-cffi-gtk: (within-main-loop (let ((window (make-instance 'gtk:window)) (gl-area (make-instance 'gtk:gtk-gl-area))) (flet ((render () (gl:clear(0 0 0 0)))) (gtk:g-signal-connect 'gl-area "render" render))...
17:13:42
Bike
if you're just passing it to other things i'd just have a lambda
17:15:22
asarch
However, the render callback won't be outside the scope of (flet)
17:15:53
asarch
(let ((window (make-instance 'gtk:window))) (flet ((render () ...)))
17:16:19
asarch
Oder: (flet ((render () ...) (let ((window (make-instance 'gtk:window)) ...)))
17:16:46
asarch
(let ... (flet ...)) or (flet ... (let ...))
17:17:15
asarch
Can you create a closure with (flet)?
17:17:44
Bike
but i meant just have (let ((window ...) (render (lambda () (gl:clear 0 0 0 0)))) (gtk:g-signal-connect 'gl-area "render" render) ...)
17:19:52
asarch
Thank you very much guys :-)
22:21:24
Lord_of_Life_
** NICK Lord_of_Life
23:46:39
p_l
didi: I think it exists in floating point in practice, but I don't think standard says anything about it
23:48:52
Bike
it says an implementation can have negative zero but doesn't have to, and that positive zero = negative zero but not eql
23:49:38
p_l
from CL:ZEROP spec: "Regardless of whether an implementation provides distinct representations for positive and negative floating-point zeros, (zerop -0.0) always returns true."
Tuesday, 4th of June 2019, 0:20:21 UTC