switching to scheme #t, #f, and () values
porting code to sort out which NILs are false and which are
empty lists
switching to scheme-style special forms. however you feel about
scheme names vs. CL names, using both is silly.
mostly switching to scheme predicate names, with compatibility
aliases for now. adding set-constant! to make this efficient.
adding null?, eqv?, assq, assv, assoc, memq, memv, member
adding 2-argument form of if
allowing else as final cond condition
looking for init file in same directory as executable, so flisp
can be started from anywhere
renaming T to FL_T, since exporting a 1-character symbol is
not very nice
adding opaque type boilerplate example file
adding correctness checking for the pattern-lambda benchmark
bugfix in int2str
2009-01-28 20:04:23 -05:00
|
|
|
(define-macro (while- test . forms)
|
2008-06-30 21:54:22 -04:00
|
|
|
`((label -loop- (lambda ()
|
|
|
|
(if ,test
|
switching to scheme #t, #f, and () values
porting code to sort out which NILs are false and which are
empty lists
switching to scheme-style special forms. however you feel about
scheme names vs. CL names, using both is silly.
mostly switching to scheme predicate names, with compatibility
aliases for now. adding set-constant! to make this efficient.
adding null?, eqv?, assq, assv, assoc, memq, memv, member
adding 2-argument form of if
allowing else as final cond condition
looking for init file in same directory as executable, so flisp
can be started from anywhere
renaming T to FL_T, since exporting a 1-character symbol is
not very nice
adding opaque type boilerplate example file
adding correctness checking for the pattern-lambda benchmark
bugfix in int2str
2009-01-28 20:04:23 -05:00
|
|
|
(begin ,@forms
|
2008-06-30 21:54:22 -04:00
|
|
|
(-loop-))
|
2009-04-15 23:05:38 -04:00
|
|
|
())))))
|
|
|
|
|
|
|
|
(define (tw)
|
|
|
|
(set! i 0)
|
|
|
|
(while (< i 10000000) (set! i (+ i 1))))
|
|
|
|
|
|
|
|
(define (tw2)
|
|
|
|
(letrec ((loop (lambda ()
|
|
|
|
(if (< i 10000000)
|
|
|
|
(begin (set! i (+ i 1))
|
|
|
|
(loop))
|
|
|
|
()))))
|
|
|
|
(loop)))
|
|
|
|
|
|
|
|
#|
|
|
|
|
interpreter:
|
|
|
|
while: 1.82sec
|
|
|
|
macro: 2.98sec
|
|
|
|
|
|
|
|
compiler:
|
|
|
|
while: 0.72sec
|
|
|
|
macro: 1.24sec
|
|
|
|
|#
|