This is a autopost bolg frinds we are trying to all latest sports,news,all new update provide for you
Monday, July 31, 2023
Show HN: YakshaLisp – Macros for Yaksha and Lisp Dialect https://ift.tt/4pm69ac
Show HN: YakshaLisp – Macros for Yaksha and Lisp Dialect YakshaLisp is a sub-language embedded in Yaksha compiler. Allowing you to do things like below (fizzbuzz). macros!{ (defun to_fb (n) (+ (if (== n 1) "" " ") (cond ((== 0 (modulo n 15)) "FizzBuzz") ((== 0 (modulo n 3)) "Fizz") ((== 0 (modulo n 5)) "Buzz") (true (to_string n)) ))) (defun fizzbuzz () (list (yk_create_token YK_TOKEN_STRING (reduce + (map to_fb (range 1 101)))))) (yk_register {dsl fizzbuzz fizzbuzz}) } def main() -> int: println(fizzbuzz!{}) return 0 This is available in latest release - https://ift.tt/XATF6xd (I recommend using release.py in compiler/scripts if you want to locally compile it) 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 Looking for ideas/advice/criticism :) https://ift.tt/mHwdu6R July 31, 2023 at 04:30PM
Subscribe to:
Post Comments (Atom)
Show HN: Tablr – Supabase with AI Features https://ift.tt/ltABMro
Show HN: Tablr – Supabase with AI Features https://www.tablr.dev/ June 30, 2025 at 04:35AM
-
Show HN: Locksmith – detect locks taken by Postgres migrations https://ift.tt/0cBueJt February 10, 2025 at 02:26AM
-
Show HN: I built a FOSS tool to run your Steam games in the Cloud I wanted to play my Steam games but my aging PC couldn’t keep up, so I bui...
-
Show HN: TNX API – Natural Language Interactions with Your Database Hey HN! I built TNX API to make working with databases as simple as aski...
No comments:
Post a Comment