Last active
April 6, 2021 09:18
-
-
Save kwannoel/3d9000cd2bd2940d0bdc54cd54130b63 to your computer and use it in GitHub Desktop.
This file contains 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
(module test-module (quote #%builtin-kernel) | |
(#%plain-module-begin | |
(#%require /libs/racket/base) | |
(#%provide test-result) | |
(#%require /libs/racket/private/syntax-case) | |
(define-syntax defun | |
(#%plain-lambda (stx) | |
(#%plain-app | |
(#%variable-reference console-log) | |
(#%variable-reference stx) | |
) | |
(#%plain-app | |
(#%variable-reference console-log) | |
(let ((s-c-input__ (#%variable-reference stx))) | |
(let ((s-c-match-result__ (#%plain-app (#%variable-reference pattern-match) (#%variable-reference s-c-input__) (quote (cons (datum defun) (cons (var f) (cons (var a) (cons (var b) (datum ())))))) ) )) | |
(let | |
((s-c-match-success? (#%plain-app (#%variable-reference car) (#%variable-reference s-c-match-result__) ) ) | |
(s-c-match-object | |
(#%plain-app | |
(#%variable-reference cdr) | |
(#%variable-reference s-c-match-result__) | |
) | |
) | |
) | |
(if (#%variable-reference s-c-match-success?) | |
(#%plain-app | |
(#%variable-reference cdr) | |
(#%plain-app | |
(#%variable-reference pattern-unmatch) | |
(#%variable-reference s-c-match-object) | |
(quote | |
(cons | |
(var quasiquote) | |
(cons (cons (var define) (cons (var abc) (cons (datum 1) (datum ())))) (datum ())) | |
) | |
) | |
) | |
) | |
(quote no-match) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
(quote #f) | |
(define test-result (#%variable-reference abc)) | |
) | |
) |
This file contains 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
(defun addOne a (+ a 1)) | |
(define abc 1) | |
COMPILATION RESULT: | |
(module test-module (quote #%builtin-kernel) | |
(#%plain-module-begin | |
(#%require /libs/racket/base) | |
(#%provide test-result) | |
(#%require /libs/racket/private/syntax-case) | |
(define-syntax defun | |
(#%plain-lambda (stx) | |
(#%plain-app | |
(#%variable-reference console-log) | |
(#%variable-reference stx) | |
) | |
(#%plain-app | |
(#%variable-reference console-log) | |
(let ((s-c-input__ (#%variable-reference stx))) | |
(let ((s-c-match-result__ (#%plain-app (#%variable-reference pattern-match) (#%variable-reference s-c-input__) (quote (cons (datum defun) (cons (var f) (cons (var a) (cons (var b) (datum ())))))) ) )) | |
(let | |
((s-c-match-success? (#%plain-app (#%variable-reference car) (#%variable-reference s-c-match-result__) ) ) | |
(s-c-match-object | |
(#%plain-app | |
(#%variable-reference cdr) | |
(#%variable-reference s-c-match-result__) | |
) | |
) | |
) | |
(if (#%variable-reference s-c-match-success?) | |
(#%plain-app | |
(#%variable-reference cdr) | |
(#%plain-app | |
(#%variable-reference pattern-unmatch) | |
(#%variable-reference s-c-match-object) | |
(quote (datum (define abc 1))) | |
) | |
) | |
(quote no-match) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
(define abc (quote 1)) | |
(define test-result (#%variable-reference abc)) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Diffs:
quasi-quote: https://gist.github.com/kwannoel/3d9000cd2bd2940d0bdc54cd54130b63#file-quasi-dump-rkt-L31-L37
quote: https://gist.github.com/kwannoel/3d9000cd2bd2940d0bdc54cd54130b63#file-quote-dump-rkt-L34-L35