diff options
Diffstat (limited to 'stdlib/source')
-rw-r--r-- | stdlib/source/lux/type/dynamic.lux | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/stdlib/source/lux/type/dynamic.lux b/stdlib/source/lux/type/dynamic.lux index d57669213..6fb83f8fb 100644 --- a/stdlib/source/lux/type/dynamic.lux +++ b/stdlib/source/lux/type/dynamic.lux @@ -16,7 +16,7 @@ ["Actual" (%type actual)])) (abstract: #export Dynamic - {} + {#.doc "A value coupled with its type, so it can be checked later."} [Type Any] @@ -24,11 +24,15 @@ (def: dynamic-representation (-> Dynamic [Type Any]) (|>> :representation)) (syntax: #export (:dynamic value) + {#.doc (doc (: Dynamic + (:dynamic 123)))} (with-gensyms [g!value] (wrap (list (` (let [(~ g!value) (~ value)] ((~! ..dynamic-abstraction) [(:of (~ g!value)) (~ g!value)]))))))) (syntax: #export (:check type value) + {#.doc (doc (: (error.Error Nat) + (:check Nat (:dynamic 123))))} (with-gensyms [g!type g!value] (wrap (list (` (let [[(~ g!type) (~ g!value)] ((~! ..dynamic-representation) (~ value))] (: ((~! error.Error) (~ type)) |