mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-14 05:12:38 -08:00
Added a compiler macro for optional type checks
This commit is contained in:
parent
18928c0b1f
commit
ebefa89d55
1 changed files with 5 additions and 0 deletions
|
|
@ -119,3 +119,8 @@
|
|||
`(let* ((%value ,value))
|
||||
,(type-error-check '%value type)
|
||||
(the ,type %value))))))
|
||||
|
||||
(defmacro optional-type-check (&whole whole value type &environment env)
|
||||
(if (policy-assume-right-type)
|
||||
value
|
||||
`(assert-type-if-known ,value ,type)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue