New Show Hacker News story: Show HN: YakshaLisp – Lisp dialect and macros for Yaksha lang

Show HN: YakshaLisp – Lisp dialect and macros for Yaksha lang
2 by JaDogg | 0 comments on Hacker News.
YakshaLisp is a sub-language embedded in Yaksha compiler. Allowing you to do things like below. See the link for updated documentation. What is your opinion about lisp dialect for defining macros in a off-side rule language? # ╔═╗┌─┐┌┬┐┌─┐┬┬ ┌─┐ ╔╦╗┬┌┬┐┌─┐ # ║ │ ││││├─┘││ ├┤ ║ ││││├┤ # ╚═╝└─┘┴ ┴┴ ┴┴─┘└─┘ ╩ ┴┴ ┴└─┘ # ╔═╗┬┌─┐┌─┐ ╔╗ ┬ ┬┌─┐┌─┐ # ╠╣ │┌─┘┌─┘ ╠╩╗│ │┌─┘┌─┘ # ╚ ┴└─┘└─┘ ╚═╝└─┘└─┘└─┘ 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/OnvVAmT (I recommend using release.py in compiler/scripts if you want to locally compile it)

إرسال تعليق

أحدث أقدم

نموذج الاتصال

How To Get It For Free?

If you want to get this Premium Blogger Template for free, simply click on below links. All our resources are free for skill development, we don't sell anything. Thanks in advance for being with us.