mirror of
https://github.com/vale981/lack
synced 2025-03-06 01:41:39 -05:00
19 lines
418 B
Common Lisp
19 lines
418 B
Common Lisp
![]() |
(in-package :cl-user)
|
||
|
(defpackage lack.component
|
||
|
(:use :cl)
|
||
|
(:export :lack-component
|
||
|
:call
|
||
|
:to-app))
|
||
|
(in-package :lack.component)
|
||
|
|
||
|
(defclass lack-component () ())
|
||
|
|
||
|
(defgeneric call (component env)
|
||
|
(:method ((component function) env)
|
||
|
(funcall component env)))
|
||
|
|
||
|
(defun to-app (component)
|
||
|
(if (typep component 'lack-component)
|
||
|
(lambda (env) (call component env))
|
||
|
component))
|