Last active
December 14, 2015 00:08
-
-
Save samth/4996296 to your computer and use it in GitHub Desktop.
a pattern to optimize
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
| #lang racket/base | |
| (for ([i (in-range 5 +inf.0 2)]) (displayln i)) |
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
| (begin | |
| (module inf .... | |
| (require (lib "racket/base.rkt")) | |
| (define-values | |
| (_count) | |
| (begin | |
| '%%inline-variant%% | |
| (lambda (arg0-12 arg1-13) | |
| '#(count #<path:/home/samth/tmp/inf.rkt> 2 0 19 58 #f) | |
| '(captures: | |
| (val/ref #%modvars) | |
| (|_in-range:p@(lib "racket/private/for.rkt")|)) | |
| (|_in-range:p@(lib "racket/private/for.rkt")| | |
| arg0-12 | |
| '+inf.0 | |
| arg1-13)) | |
| (lambda (arg0-17 arg1-18) | |
| '#(count #<path:/home/samth/tmp/inf.rkt> 2 0 19 58 #f) | |
| '(captures: | |
| (val/ref #%modvars) | |
| (|_in-range:p@(lib "racket/private/for.rkt")|)) | |
| (|_in-range:p@(lib "racket/private/for.rkt")| | |
| arg0-17 | |
| '+inf.0 | |
| arg1-18)))) | |
| (#%apply-values | |
| |_print-values:p@(lib "racket/private/modbeg.rkt")| | |
| (let ((for-loop22 ?)) | |
| (begin | |
| (#%set!-rec-values | |
| (for-loop22) | |
| (lambda (arg0-23 arg1-24) | |
| '#(for-loop #<path:/home/samth/tmp/inf.rkt> 4 0 78 47 #f) | |
| '(flags: preserves-marks single-result) | |
| '(captures: | |
| (val/ref for-loop22) | |
| (val/ref #%modvars) | |
| (|_displayln:p@(lib "racket/private/misc.rkt")|)) | |
| (if (< arg1-24 '+inf.0) | |
| (begin | |
| (#%sfs-clear arg0-23) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| arg1-24) | |
| (let ((local28 (+ (#%sfs-clear arg1-24) '2))) | |
| (if (< local28 '+inf.0) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| | |
| local28) | |
| (let ((local34 (+ (#%sfs-clear local28) '2))) | |
| (if (< local34 '+inf.0) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| | |
| local34) | |
| (let ((local40 (+ (#%sfs-clear local34) '2))) | |
| (if (< local40 '+inf.0) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| | |
| local40) | |
| (let ((local46 | |
| (+ (#%sfs-clear local40) '2))) | |
| (if (< local46 '+inf.0) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| | |
| local46) | |
| (let ((local52 | |
| (+ (#%sfs-clear local46) '2))) | |
| (if (< local52 '+inf.0) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| | |
| local52) | |
| (let ((local58 | |
| (+ | |
| (#%sfs-clear local52) | |
| '2))) | |
| (if (< local58 '+inf.0) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| | |
| local58) | |
| (let ((local64 | |
| (+ | |
| (#%sfs-clear | |
| local58) | |
| '2))) | |
| (if (< local64 '+inf.0) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| | |
| local64) | |
| (let ((local70 | |
| (+ | |
| (#%sfs-clear | |
| local64) | |
| '2))) | |
| (if (< | |
| local70 | |
| '+inf.0) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| | |
| local70) | |
| (let ((local76 | |
| (+ | |
| (#%sfs-clear | |
| local70) | |
| '2))) | |
| (if (< | |
| local76 | |
| '+inf.0) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| | |
| local76) | |
| (for-loop22 | |
| '#<void> | |
| (+ | |
| local76 | |
| '2))) | |
| '#<void>))) | |
| '#<void>))) | |
| '#<void>))) | |
| '#<void>))) | |
| '#<void>))) | |
| '#<void>))) | |
| '#<void>))) | |
| '#<void>))) | |
| '#<void>)))) | |
| arg0-23))) | |
| (begin | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| '5) | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| '7) | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| '9) | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| '11) | |
| (|_displayln:p@(lib "racket/private/misc.rkt")| '13) | |
| ((#%sfs-clear for-loop22) '#<void> '15))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment