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
|
|
|
; -*- scheme -*-
|
|
|
|
(define (maplist f l)
|
2009-01-31 20:53:58 -05:00
|
|
|
(if (null? l) ()
|
2008-06-30 21:54:22 -04:00
|
|
|
(cons (f l) (maplist f (cdr l)))))
|
|
|
|
|
|
|
|
; produce a beautiful, toroidal cons structure
|
|
|
|
; make m copies of a CDR-circular list of length n, and connect corresponding
|
|
|
|
; conses in CAR-circular loops
|
|
|
|
; replace maplist 'identity' with 'copy-tree' for rapdily exploding memory use
|
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 (torus m n)
|
2008-06-30 21:54:22 -04:00
|
|
|
(let* ((l (map-int identity n))
|
|
|
|
(g l)
|
|
|
|
(prev g))
|
|
|
|
(dotimes (i (- m 1))
|
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
|
|
|
(set! prev g)
|
|
|
|
(set! g (maplist identity g))
|
|
|
|
(set-cdr! (last prev) prev))
|
|
|
|
(set-cdr! (last g) g)
|
2008-06-30 21:54:22 -04:00
|
|
|
(let ((a l)
|
|
|
|
(b g))
|
|
|
|
(dotimes (i n)
|
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
|
|
|
(set-car! a b)
|
|
|
|
(set! a (cdr a))
|
|
|
|
(set! b (cdr b))))
|
2008-06-30 21:54:22 -04:00
|
|
|
l))
|
|
|
|
|
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 (cyl m n)
|
2008-06-30 21:54:22 -04:00
|
|
|
(let* ((l (map-int identity n))
|
|
|
|
(g l))
|
|
|
|
(dotimes (i (- m 1))
|
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
|
|
|
(set! g (maplist identity g)))
|
2008-06-30 21:54:22 -04:00
|
|
|
(let ((a l)
|
|
|
|
(b g))
|
|
|
|
(dotimes (i n)
|
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
|
|
|
(set-car! a b)
|
|
|
|
(set! a (cdr a))
|
|
|
|
(set! b (cdr b))))
|
2008-06-30 21:54:22 -04:00
|
|
|
l))
|
|
|
|
|
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
|
|
|
(time (begin (print (torus 100 100)) ()))
|
2008-08-17 14:16:31 -04:00
|
|
|
;(time (dotimes (i 1) (load "100x100.lsp")))
|
2008-06-30 21:54:22 -04:00
|
|
|
; with ltable
|
|
|
|
; printing time: 0.415sec
|
|
|
|
; reading time: 0.165sec
|
|
|
|
|
|
|
|
; with ptrhash
|
|
|
|
; printing time: 0.081sec
|
|
|
|
; reading time: 0.0264sec
|