4 ms·
Few more examples: - embedding a text file macros! { (defun load_string (file) (list (yk_create_token YK_TOKEN_STRING (io_read_file (map_get file "val
by JaDogg 3y ago
Few more examples:
- embedding a text file
macros! {
(defun load_string (file) (list (yk_create_token YK_TOKEN_STRING (io_read_file (map_get file "value")))))
(yk_register {dsl load_string load_string})
}
def main() -> int:
println(load_string!{"test.txt"})
return 0
- importing a macro
import import_me as magic
def main() -> int:
println(magic.counter!{})
println(magic.counter!{})
println(magic.counter!{})
return 0