![]() |
От: |
Worminator X
|
#StandWithPalestine 🖤🤍💚 |
Дата: | 02.07.24 04:04 | ||
Оценка: |
(print (funcall
(lambda (x y)
(format NIL "~d + ~d = ~d" x y (+ x y))
)
2
3
)
)
(print (
(lambda (x y)
(format NIL "~d + ~d = ~d" x y (+ x y))
)
2
3
)
)
(setq User-counter 0)
(defun User (name)
(let
(
(id (setq User-counter (+ User-counter 1)))
)
(lambda (method)
(cond
((eq method 'getId) (lambda () id))
((eq method 'getName) (lambda () name))
((eq method 'data) (lambda () (list id name)))
((eq method 'format) (lambda (f) (format NIL f id name)))
)
)
)
)
(print (funcall (funcall (User "Worminator") 'format) "id: ~d, name: ~s"))
(print (((User "Worminator") 'format) "id: ~d, name: ~s"))
EVAL: ((USER "Worminator") 'FORMAT) is not a function name; try using a symbol instead