You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several types define expressions to be evaluated at runtime. E.g.:
Switch statements where we have to eval the expression then find the matching case.
List sizes.
Struct sizes.
Instead, we should just use lambda expression so the byte-compiler can optimize them. We can likely provide some nice macros if lambdas become unwieldy. E.g., a switch could be written as:
I wrote the comment below first, but realized now that it makes the assumption that the lambdas would be evaluated at :initform time. Would these lambdas be evaluated in xcb:marshall, kind of substituting the eval and case processing?
I think this would imply that the value is determined at construction time instead of at marshalling time. This would prevent building a message piece by piece. Say:
(let (obj (make-instance'xcb:ConfigureWindow:window xwin
:x x :y y :width width :height height))
(setf (slot-value obj :value-mask)
(logior (if x xcb:ConfigWindow:X 0)
(if y xcb:ConfigWindow:Y 0)
(if width xcb:ConfigWindow:Width 0)
(if height xcb:ConfigWindow:Height 0))))
We don't do that in EXWM as far as I can see, but I think that it should be supported.
Would these lambdas be evaluated in xcb:marshall, kind of substituting the eval and case processing?
Yes. The goal is to have them parsed and byte-compiled along with the rest of the file. Basically, instead of storing the code as raw s-expressions, we'd store it as compiled lambdas.
Several types define expressions to be evaluated at runtime. E.g.:
Instead, we should just use
lambda
expression so the byte-compiler can optimize them. We can likely provide some nice macros if lambdas become unwieldy. E.g., aswitch
could be written as:Where
xcb:-switch
would compile the switch down to a lambda returning the correct case to use given someobj
.The text was updated successfully, but these errors were encountered: