Improve get-builtin-element
This commit is contained in:
parent
fc264bfb2c
commit
a2b6b1d99a
2 changed files with 6 additions and 6 deletions
|
@ -46,7 +46,7 @@ It's
|
||||||
```
|
```
|
||||||
|
|
||||||
- Improved:
|
- Improved:
|
||||||
- Element functions are wrapped in macros for natural indentation. To manipulate them as function objects, prefix '%' to the element name, or use `get-element` function.
|
- Element functions are wrapped in macros for natural indentation. To manipulate them as function objects, prefix '%' to the element name, or use `get-builtin-element` function.
|
||||||
- Bugfix. https://github.com/ailisp/flute/issues/5, https://github.com/ailisp/flute/issues/7
|
- Bugfix. https://github.com/ailisp/flute/issues/5, https://github.com/ailisp/flute/issues/7
|
||||||
|
|
||||||
```lisp
|
```lisp
|
||||||
|
@ -54,10 +54,10 @@ It's
|
||||||
(funcall as props children))
|
(funcall as props children))
|
||||||
|
|
||||||
(define-element dynamic-2 (as)
|
(define-element dynamic-2 (as)
|
||||||
(funcall (get-element as) props children))
|
(funcall (get-builtin-element as) props children))
|
||||||
|
|
||||||
(dynamic-1 :as #'%span :class "bold" "child")
|
(dynamic-1 :as #'%span :class "bold" "child")
|
||||||
(dynamic-2 :as "span" :class "bold" "child")
|
(dynamic-2 :as 'span :class "bold" "child")
|
||||||
|
|
||||||
; <span class="bold">child</span>
|
; <span class="bold">child</span>
|
||||||
```
|
```
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#:element-children
|
#:element-children
|
||||||
#:user-element-expand-to
|
#:user-element-expand-to
|
||||||
#:h
|
#:h
|
||||||
#:get-element))
|
#:get-builtin-element))
|
||||||
(in-package #:piccolo/elements)
|
(in-package #:piccolo/elements)
|
||||||
|
|
||||||
;;; classes
|
;;; classes
|
||||||
|
@ -283,5 +283,5 @@
|
||||||
|
|
||||||
;;; Utility
|
;;; Utility
|
||||||
|
|
||||||
(defun get-element (name)
|
(defun get-builtin-element (name)
|
||||||
(find-symbol (concatenate 'string "%" (string-upcase name)) :piccolo))
|
(find-symbol (string (symbolicate '% name)) :piccolo))
|
||||||
|
|
Loading…
Reference in a new issue