
CL
O
X
Didier Verna
Introduction
Context
Motivation
Alternatives
Closette
ELisp vs. Lisp
The CL package
Scoping
λ -lists
Type/Class
Types
Generic Functions
Project status
Available Features
Testing
Performance
Conclusion
Thanks !
Full blown λ -lists
Emacs Lisp restricted to &optional and &rest
CL provides the rest (defun
*
etc.)
What about generic functions and methods ?
CL provides cl-transform-lambda
Use it in our compute-method-function
λ -list transformation example
; ; ( lambda ( a &o p ti o na l ( b ’b ) &key ( key1 ’ key1 ) ) # | . . . | # )
( lambda ( a &r e st −−rest−−39249 )
( l e t ∗ ( ( b ( i f −−rest−−39249 ( pop −−rest−−39249 ) ( quote b ) ) )
( key1 ( car ( cd r ( or (memq : key1 −−rest−−39249 )
( quote ( n i l key1 ) ) ) ) ) ) )
( l e t ((−−keys−−39250 −−rest−−39249 ) )
( wh i l e −−keys−−39250
( cond ( (memq ( car −−keys−−39250 )
( quote ( : key1 : allow−other−keys ) ) )
( se tq −−keys−−39250 ( cdr ( cdr −−keys−−39250 ) ) ) )
( ( car ( cdr (memq : allow−other−keys −−rest−−39249 ) ) )
( se tq −−keys−−39250 n i l ) )
( t
( e r ro r " Keyword argument %s not one of ( : key1 ) "
( ca r −−keys−−39250 ) ) ) ) ) )
# | . . . | # ) )
20/33