2023-12-01 01:10:16 +00:00
|
|
|
(local fennel (require :fennel))
|
2023-12-02 21:01:30 +00:00
|
|
|
(import-macros {: terra : unterra : untype : def : q : ttype} :terra)
|
2023-12-01 01:10:16 +00:00
|
|
|
|
2023-12-02 21:01:30 +00:00
|
|
|
; (local N 5)
|
|
|
|
; (print (unterra
|
|
|
|
; (def [x [int] : int64]
|
|
|
|
; (var y (+ x N))
|
|
|
|
; (return (cast int64 (& [y]))))))
|
|
|
|
(print (untype
|
|
|
|
{key int
|
|
|
|
:union {
|
|
|
|
string [int8]
|
|
|
|
number float
|
|
|
|
complex {real float imag float}
|
|
|
|
}
|
|
|
|
}))
|
|
|
|
|
|
|
|
(print (fennel.view (ttype
|
|
|
|
{key int
|
|
|
|
:union {
|
|
|
|
string [int8]
|
|
|
|
number float
|
|
|
|
complex {real float imag float}
|
|
|
|
}
|
|
|
|
})))
|
|
|
|
|
|
|
|
; (local inc (def [x [int]] (return [x N])))
|
|
|
|
; (print (inc 5))
|