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:
(defclast ...
(xcb:-struct)
((thing :initform
(xcb:-switch (xcb:-fieldref 'class-id)
((0) pitch duration led-mask led-values global-auto-repeat click percent pad~0 auto-repeats~)
((1)
pad~1 accel-num accel-denom threshold)
((2)
max-symbols num-keysyms keysyms~)
((3)
resolution min-value max-value)
((4)
led-mask* led-values*)
((5)
percent* pad~2 pitch* duration*))))
Where xcb:-switch would compile the switch down to a lambda returning the correct case to use given some obj.
Several types define expressions to be evaluated at runtime. E.g.:
Instead, we should just use
lambdaexpression so the byte-compiler can optimize them. We can likely provide some nice macros if lambdas become unwieldy. E.g., aswitchcould be written as:Where
xcb:-switchwould compile the switch down to a lambda returning the correct case to use given someobj.