Created
May 8, 2025 10:54
-
-
Save shakna-israel/4f8344af36d2ef9f938b54d209cc1345 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax constexpr | |
(syntax-rules () | |
((_ expr) | |
(begin | |
(syntax->datum | |
(datum->syntax | |
(quote-syntax here) | |
(eval 'expr (interaction-environment)))))))) | |
(define (factorial n) | |
(if (<= n 1) | |
1 | |
(* n (factorial (- n 1))))) | |
(define n | |
(constexpr (factorial 10))) |
Author
shakna-israel
commented
May 23, 2025
(define-syntax-rule (delay)
(lambda ( ) expr))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment