* Added fxarithmetic-shift* procedures.

* Added trace examples in ikarus.trace.h
* slatex benchmark now compiles properly.
This commit is contained in:
Abdulaziz Ghuloum 2007-09-15 00:14:47 -04:00
parent ea28d03f43
commit 54472a1994
17 changed files with 340 additions and 2366 deletions

View File

@ -8210,3 +8210,112 @@ Words allocated: 358610884
Words reclaimed: 0
Elapsed time...: 3289 ms (User: 3248 ms; System: 39 ms)
Elapsed GC time: 486 ms (CPU: 489 in 1368 collections.)
****************************
Benchmarking Larceny-r6rs on Fri Sep 14 06:26:30 EDT 2007 under Darwin adsl-66-72-39-123.dsl.bltnin.ameritech.net 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386
Testing gcold under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
> 25 megabytes
0 work units per step.
promotion ratio is 1:10
pointer mutation rate is 10
10000 steps
Allocating 76 trees.
(24902160 bytes)
(1245108 nodes)
Initialization complete...
Words allocated: 2754231001
Words reclaimed: 0
Elapsed time...: 25179 ms (User: 20872 ms; System: 4148 ms)
Elapsed GC time: 13554 ms (CPU: 13553 in 10508 collections.)
****************************
Benchmarking Larceny-r6rs on Fri Sep 14 06:34:37 EDT 2007 under Darwin adsl-66-72-39-123.dsl.bltnin.ameritech.net 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386
Testing paraffins under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
Words allocated: 201324946
Words reclaimed: 0
Elapsed time...: 4422 ms (User: 3824 ms; System: 566 ms)
Elapsed GC time: 2542 ms (CPU: 2529 in 768 collections.)
****************************
Benchmarking Larceny-r6rs on Fri Sep 14 06:38:58 EDT 2007 under Darwin adsl-66-72-39-123.dsl.bltnin.ameritech.net 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386
Testing parsing under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
Words allocated: 100923740
Words reclaimed: 0
Elapsed time...: 6650 ms (User: 6528 ms; System: 80 ms)
Elapsed GC time: 301 ms (CPU: 285 in 385 collections.)
****************************
Benchmarking Larceny-r6rs on Fri Sep 14 06:44:41 EDT 2007 under Darwin adsl-66-72-39-123.dsl.bltnin.ameritech.net 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386
Testing ray under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
Words allocated: 218092882
Words reclaimed: 0
Elapsed time...: 23372 ms (User: 13257 ms; System: 9921 ms)
Elapsed GC time: 291 ms (CPU: 309 in 832 collections.)
****************************
Benchmarking Larceny-r6rs on Fri Sep 14 06:54:40 EDT 2007 under Darwin adsl-66-72-39-123.dsl.bltnin.ameritech.net 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386
Testing slatex under Larceny-r6rs
Compiling...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
>
Running...
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified)
>
Words allocated: 4193866
Words reclaimed: 0
Elapsed time...: 2013 ms (User: 534 ms; System: 749 ms)
Elapsed GC time: 8 ms (CPU: 11 in 16 collections.)

View File

@ -1,8 +1,8 @@
* maze needs bitwise-and
* quicksort needs bignum modulo.
* scheme needs complex? and other stuff.
* slatex needs char-alphabetic?
* compiler needs string-downcase
* nbody needs real-part
* ntakl kinda slow
* string too slow

View File

@ -45,6 +45,7 @@
ray-iters
sboyer-iters
simplex-iters
slatex-iters
sum-iters
sum1-iters
string-iters

View File

@ -4,7 +4,7 @@
(export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks))
(define flsin sin)
;(define flsin sin)
(define (four1 data)
(let ((n (vector-length data))

View File

@ -59,11 +59,12 @@
((= i len)
state)))))
(define vector-map
(lambda (vec proc)
(proc->vector (vector-length vec)
(lambda (i)
(proc (vector-ref vec i))))))
; AZIZ: r6rs has vector-map, this is not even used
;(define vector-map
; (lambda (vec proc)
; (proc->vector (vector-length vec)
; (lambda (i)
; (proc (vector-ref vec i))))))
; Given limit, return the list 0, 1, ..., limit-1.
(define giota

View File

@ -196,8 +196,8 @@
(define (set-cell:mark o v) (vector-set! o 5 v))
;;; Iterates in reverse order.
(define (vector-for-each proc v)
;;; AZIZ: appended rev to the name
(define (vector-for-each-rev proc v)
(let lp ((i (- (vector-length v) 1)))
(cond ((>= i 0)
(proc (vector-ref v i))
@ -222,7 +222,7 @@
(define (dig-maze walls ncells)
(call-with-current-continuation
(lambda (quit)
(vector-for-each
(vector-for-each-rev
(lambda (wall) ; For each wall,
(let* ((c1 (wall:owner wall)) ; find the cells on
(set1 (cell:reachable c1))
@ -373,7 +373,7 @@
(define (harr-for-each proc harr)
(vector-for-each proc (harr:elts harr)))
(vector-for-each-rev proc (harr:elts harr)))
;------------------------------------------------------------------------------
; Was file "hex.scm".

View File

@ -2345,4 +2345,4 @@
slatex-iters
(lambda (result) #t)
(lambda (filename) (lambda () (slatex.process-main-tex-file filename)))
"../../src/test")))
"r6rs-benchmarks/slatex-data/test")))

View File

@ -1,547 +0,0 @@
% slatex.sty
% SLaTeX v. 2.2
% style file to be used in (La)TeX when using SLaTeX
% (c) Dorai Sitaram, Rice U., 1991, 1994
% This file (or a soft link to it) should be in some
% directory in your TEXINPUTS path (i.e., the one
% (La)TeX scours for \input or \documentstyle option
% files).
% Do not attempt to debug this file, since the results
% are not transparent just to (La)TeX. The Scheme part
% of SLaTeX depends on information laid out here -- so
% (La)TeX-minded debugging of this file will almost
% inevitably sabotage SLaTeX.
% It's possible you don't find the default style set
% out here appealing: e.g., you may want to change the
% positioning of displayed code; change the fonts for
% keywords, constants, and variables; add new keywords,
% constants, and variables; use your names instead of
% the provided \scheme, [\begin|\end]{schemedisplay},
% [\begin|\end]{schemebox}, (or \[end]schemedisplay,
% \[end]schemebox for TeX), which might be seem too
% long or unmnemonic, and many other things. The clean
% way to do these things is outlined in the
% accompanying manual, slatex-d.tex. This way is both
% easier than messing with this .sty file, and safer
% since you will not unwittingly break SLaTeX.
%%%
% to prevent loading slatex.sty more than once
\ifx\slatexignorecurrentfile\UNDEFINED
\else\endinput\fi
% use \slatexignorecurrentfile to disable slatex for
% the current file. (Unstrangely, the very definition
% disables slatex for the rest of _this_ file, slatex.sty.)
\def\slatexignorecurrentfile{}
% checking whether we're using LaTeX or TeX?
\newif\ifusinglatex
\ifx\newenvironment\UNDEFINED\usinglatexfalse\else\usinglatextrue\fi
% make @ a letter for TeX
\ifusinglatex\relax\else
\edef\atcatcodebeforeslatex{\the\catcode`@}
\catcode`@11
\fi
% identification of TeX/LaTeX style for schemedisplay.
% Do \defslatexenvstyle{tex} to get TeX environment
% style in LaTeX
\def\defslatexenvstyle#1{\gdef\slatexenvstyle{#1}}
\ifusinglatex\defslatexenvstyle{latex}\else\defslatexenvstyle{tex}\fi
% TeX doesn't have sans-serif; use roman instead
\ifx\sf\UNDEFINED\def\sf{\rm}\fi
% tabbing from plain TeX
%
\newif\ifus@ \newif\if@cr
\newbox\tabs \newbox\tabsyet \newbox\tabsdone
%
\def\cleartabs{\global\setbox\tabsyet\null \setbox\tabs\null}
\def\settabs{\setbox\tabs\null \futurelet\next\sett@b}
\let\+=\relax % in case this file is being read in twice
\def\sett@b{\ifx\next\+\let\next\relax
\def\next{\afterassignment\s@tt@b\let\next}%
\else\let\next\s@tcols\fi\next}
\def\s@tt@b{\let\next\relax\us@false\m@ketabbox}
\def\tabalign{\us@true\m@ketabbox} % non-\outer version of \+
\outer\def\+{\tabalign}
\def\s@tcols#1\columns{\count@#1 \dimen@\hsize
\loop\ifnum\count@>\z@ \@nother \repeat}
\def\@nother{\dimen@ii\dimen@ \divide\dimen@ii\count@
\setbox\tabs\hbox{\hbox to\dimen@ii{}\unhbox\tabs}%
\advance\dimen@-\dimen@ii \advance\count@\m@ne}
%
\def\m@ketabbox{\begingroup
\global\setbox\tabsyet\copy\tabs
\global\setbox\tabsdone\null
\def\cr{\@crtrue\crcr\egroup\egroup
\ifus@\unvbox\z@\lastbox\fi\endgroup
\setbox\tabs\hbox{\unhbox\tabsyet\unhbox\tabsdone}}%
\setbox\z@\vbox\bgroup\@crfalse
\ialign\bgroup&\t@bbox##\t@bb@x\crcr}
%
\def\t@bbox{\setbox\z@\hbox\bgroup}
\def\t@bb@x{\if@cr\egroup % now \box\z@ holds the column
\else\hss\egroup \global\setbox\tabsyet\hbox{\unhbox\tabsyet
\global\setbox\@ne\lastbox}% now \box\@ne holds its size
\ifvoid\@ne\global\setbox\@ne\hbox to\wd\z@{}%
\else\setbox\z@\hbox to\wd\@ne{\unhbox\z@}\fi
\global\setbox\tabsdone\hbox{\box\@ne\unhbox\tabsdone}\fi
\box\z@}
% finished (re)defining TeX's tabbing macros
% above from plain.tex; was disabled in lplain.tex. Do
% not modify above unless you really know what you're
% up to. Make all changes you want to following code.
% The new env is preferable to LaTeX's tabbing env
% since latter accepts only a small number of tabs
% following retrieves something like LaTeX's tabbing
% env without the above problem (it also creates a box
% for easy manipulation!)
\def\lat@xtabbing{\leavevmode\hbox\bgroup\vbox\bgroup
\def\={\cleartabs&} \def\>{&} \def\\{\cr\tabalign} \tabalign}
\def\endlat@xtabbing{\cr\egroup\egroup}
%new
\def\lat@xtabbing{\begingroup
\def\={\cleartabs&} \def\>{&}%
\def\\{\cr\tabalign\lat@xtabbingleftmost}%
\tabalign\lat@xtabbingleftmost}
\def\endlat@xtabbing{\cr\endgroup}
\let\lat@xtabbingleftmost\relax
% stuff for formating Scheme code
\newskip\par@nlen \newskip\brack@tlen \newskip\quot@len
\newskip\h@lflambda
\newbox\garb@ge
\def\s@ttowidth#1#2{\setbox\garb@ge\hbox{#2}#1\wd\garb@ge\relax}
\s@ttowidth\par@nlen{$($} % size of paren
\s@ttowidth\brack@tlen{$[$} % size of bracket
\s@ttowidth\quot@len{'} % size of quote indentation
\s@ttowidth\h@lflambda{ii} % size of half of lambda indentation
\def\PRN{\hskip\par@nlen} % these are used by SLaTeX's codesetter
\def\BKT{\hskip\brack@tlen}
\def\QUO{\hskip\quot@len}
\def\HL{\hskip\h@lflambda}
\newskip\abovecodeskip \newskip\belowcodeskip
\newskip\leftcodeskip \newskip\rightcodeskip
% the following default assignments give a flushleft
% display
\abovecodeskip=\medskipamount \belowcodeskip=\medskipamount
\leftcodeskip=0pt \rightcodeskip=0pt
% adjust above,below,left,right codeskip's to personal
% taste
% for centered displays
%
% \leftcodeskip=0pt plus 1fil
% \rightcodeskip=0pt plus 1fil
%
% if \rightcodeskip != 0pt, pagebreaks within Scheme
% blocks in {schemedisplay} are disabled
\def\checkfollpar{\futurelet\next\checkfollparII}
\def\checkfollparII{\ifx\next\par\let\next\relax
\else\par\noindent\let\next\ignorespaces\fi\next}
% the following are the default font assignments for
% words in code. Change them to suit personal taste
\def\keywordfont#1{{\bf #1}}
\def\variablefont#1{{\it #1\/}}
\def\constantfont#1{{\sf #1}}
\def\datafont#1{\constantfont{#1}}
\def\schemecodehook{}
%program listings that allow page breaks but
%can't be centered
\def\ZZZZschemedisplay{\edef\thez@skip{\the\z@skip}%
\edef\@tempa{\the\rightcodeskip}%
\ifx\@tempa\thez@skip\let\next\ZZZZschemeprogram
\else\let\next\ZZZZschemeprogramII\fi\next}
\def\endZZZZschemedisplay{\edef\thez@skip{\the\z@skip}%
\edef\@tempa{\the\rightcodeskip}%
\ifx\@tempa\thez@skip\let\next\endZZZZschemeprogram
\else\let\next\endZZZZschemeprogramII\fi\next}
\def\ZZZZschemeprogram{\vskip\abovecodeskip
\begingroup
\schemecodehook
\let\sy=\keywordfont \let\cn=\constantfont
\let\va=\variablefont \let\dt=\datafont
\def\lat@xtabbingleftmost{\hskip\leftcodeskip\relax}%
\lat@xtabbing}
\def\endZZZZschemeprogram{\endlat@xtabbing
\endgroup
\vskip\belowcodeskip
\ifusinglatex\let\next\@endparenv
\else\let\next\checkfollpar\fi\next}
\def\ZZZZschemeprogramII{\vskip\abovecodeskip
\begingroup
\noindent
%\schemecodehook %\ZZZZschemebox already has it
\hskip\leftcodeskip
\ZZZZschemebox}
\def\endZZZZschemeprogramII{\endZZZZschemebox
\hskip\rightcodeskip
\endgroup
\vskip\belowcodeskip
\ifusinglatex\let\next\@endparenv
\else\let\next\checkfollpar\fi\next}
%
\def\ZZZZschemebox{%
\leavevmode\hbox\bgroup\vbox\bgroup
\schemecodehook
\let\sy=\keywordfont \let\cn=\constantfont
\let\va=\variablefont \let\dt=\datafont
\lat@xtabbing}
\def\endZZZZschemebox{\endlat@xtabbing
\egroup\egroup\ignorespaces}
%in-text
\def\ZZZZschemecodeintext{\begingroup
\let\sy\keywordfont \let\cn\constantfont
\let\va\variablefont \let\dt\datafont}
\def\endZZZZschemecodeintext{\endgroup\ignorespaces}
\def\ZZZZschemeresultintext{\begingroup
\let\sy\datafont \let\cn\constantfont
\let\va\datafont \let\dt\datafont}
\def\endZZZZschemeresultintext{\endgroup\ignorespaces}
% \comm@nt<some-char>...text...<same-char> comments out
% TeX source analogous to
% \verb<some-char>...text...<same-char>. Sp. case:
% \comm@nt{...text...} == \comm@nt}...text...}
\def\@makeother#1{\catcode`#112\relax}
\def\comm@nt{%
\begingroup
\let\do\@makeother \dospecials
\@comm}
\begingroup\catcode`\<1\catcode`\>2
\catcode`\{12\catcode`\}12
\long\gdef\@comm#1<%
\if#1{\long\def\@tempa ##1}<\endgroup>\else
\long\def\@tempa ##1#1<\endgroup>\fi
\@tempa>
\endgroup
% input file if possible, else relax
\def\inputifpossible#1{%
\immediate\openin0=#1\relax%
\ifeof0\relax\else\input#1\relax\fi%
\immediate\closein0}
\def\ZZZZinput#1{\input#1\relax}
% you may replace the above by
%
% \def\ZZZZinput#1{\inputifpossible{#1}}
%
% if you just want to call (La)TeX on your text
% ignoring the portions that need to be SLaTeX'ed
%use \subjobname rather than \jobname to generate
%slatex's temp files --- this allows us to change
%\subjobname for more control, if necessary.
\let\subjobname\jobname
% counter for generating temp file names
\newcount\sch@mefilenamecount
\sch@mefilenamecount=-1
% To produce displayed Scheme code:
% in LaTeX:
% \begin{schemedisplay}
% ... indented program (with sev'l lines) ...
% \end{schemedisplay}
%
% in TeX:
% \schemedisplay
% ... indented program (with sev'l lines) ...
% \endschemedisplay
\begingroup\catcode`\|=0\catcode`\[=1\catcode`\]=2%
\catcode`\{=12\catcode`\}=12\catcode`\\=12%
|gdef|defschemedisplaytoken#1[%
|long|expandafter|gdef|csname ZZZZcomment#1|endcsname[%
|begingroup
|let|do|@makeother |dospecials
|csname ZZZZcomment|slatexenvstyle II#1|endcsname]%
|long|expandafter|gdef|csname ZZZZcommentlatexII#1|endcsname##1\end{#1}[%
|endgroup|end[#1]]%
|long|expandafter|gdef|csname ZZZZcommenttexII#1|endcsname##1\end#1[%
|endgroup|csname end#1|endcsname]%
|long|expandafter|gdef|csname #1|endcsname[%
|global|advance|sch@mefilenamecount by 1|relax%
|ZZZZinput[|filehider Z|number|sch@mefilenamecount|subjobname.tex]%
|csname ZZZZcomment#1|endcsname]%
|long|expandafter|gdef|csname end#1|endcsname[]]%
|endgroup
\defschemedisplaytoken{schemedisplay}
\def\undefschemedisplaytoken#1{%
\expandafter\gdef\csname#1\endcsname{\UNDEFINED}}
% \scheme|...program fragment...| produces Scheme code
% in-text. Sp. case: \scheme{...} == \scheme}...}
\def\defschemetoken#1{%
\long\expandafter\def\csname#1\endcsname{%
\global\advance\sch@mefilenamecount by 1\relax%
\ZZZZinput{\filehider Z\number\sch@mefilenamecount\subjobname.tex}%
\comm@nt}}
\defschemetoken{scheme}
\def\undefschemetoken#1{%
\expandafter\gdef\csname#1\endcsname{\UNDEFINED}}
% \schemeresult|...program fragment...| produces a
% Scheme code result in-text: i.e. keyword or variable
% fonts are replaced by the data font. Sp. case:
% \schemeresult{...} == \schemeresult}...}
\def\defschemeresulttoken#1{%
\long\expandafter\def\csname#1\endcsname{%
\global\advance\sch@mefilenamecount by 1\relax%
\ZZZZinput{\filehider Z\number\sch@mefilenamecount\subjobname.tex}%
\comm@nt}}
\defschemeresulttoken{schemeresult}
\def\undefschemeresulttoken#1{%
\expandafter\gdef\csname#1\endcsname{\UNDEFINED}}
% To produce a box of Scheme code:
% in LaTeX:
% \begin{schemebox}
% ... indented program (with sev'l lines) ...
% \end{schemebox}
%
% in TeX:
% \schemebox
% ... indented program (with sev'l lines) ...
% \endschemebox
\begingroup\catcode`\|=0\catcode`\[=1\catcode`\]=2%
\catcode`\{=12\catcode`\}=12\catcode`\\=12%
|gdef|defschemeboxtoken#1[%
|long|expandafter|gdef|csname ZZZZcomment#1|endcsname[%
|begingroup
|let|do|@makeother |dospecials
|csname ZZZZcomment|slatexenvstyle II#1|endcsname]%
|long|expandafter|gdef|csname ZZZZcommentlatexII#1|endcsname##1\end{#1}[%
|endgroup|end[#1]]%
|long|expandafter|gdef|csname ZZZZcommenttexII#1|endcsname##1\end#1[%
|endgroup|csname end#1|endcsname]%
|long|expandafter|gdef|csname #1|endcsname[%
|global|advance|sch@mefilenamecount by 1|relax%
|ZZZZinput[|filehider Z|number|sch@mefilenamecount|subjobname.tex]%
|csname ZZZZcomment#1|endcsname]%
|long|expandafter|gdef|csname end#1|endcsname[]]%
|endgroup
\defschemeboxtoken{schemebox}
\def\undefschemeboxtoken#1{%
\expandafter\gdef\csname#1\endcsname{\UNDEFINED}}
% for wholesale dumping of all-Scheme files into TeX (converting
% .scm files to .tex),
% use
% \schemeinput{<filename>}
% .scm, .ss, .s extensions optional
\def\defschemeinputtoken#1{%
\long\expandafter\gdef\csname#1\endcsname##1{%
\global\advance\sch@mefilenamecount by 1\relax%
\ZZZZinput{\filehider Z\number\sch@mefilenamecount\subjobname.tex}}}
\defschemeinputtoken{schemeinput}
\def\undefschemeinputtoken#1{%
\expandafter\gdef\csname#1\endcsname{\UNDEFINED}}
% delineating a region that features typeset code
% not usually needed, except when using \scheme and schemedisplay
% inside macro-args and macro-definition-bodies
% in LaTeX:
% \begin{schemeregion}
% ...
% \end{schemeregion}
%
% in TeX:
% \schemeregion
% ...
% \endschemeregion
\begingroup\catcode`\|=0\catcode`\[=1\catcode`\]=2%
\catcode`\{=12\catcode`\}=12\catcode`\\=12%
|gdef|defschemeregiontoken#1[%
|long|expandafter|gdef|csname ZZZZcomment#1|endcsname[%
|begingroup
|let|do|@makeother |dospecials
|csname ZZZZcomment|slatexenvstyle II#1|endcsname]%
|long|expandafter|gdef|csname ZZZZcommentlatexII#1|endcsname##1\end{#1}[%
|endgroup|end[#1]]%
|long|expandafter|gdef|csname ZZZZcommenttexII#1|endcsname##1\end#1[%
|endgroup|csname end#1|endcsname]%
|long|expandafter|gdef|csname #1|endcsname[%
|global|advance|sch@mefilenamecount by 1|relax%
|ZZZZinput[|filehider Z|number|sch@mefilenamecount|subjobname.tex]%
|csname ZZZZcomment#1|endcsname]%
|long|expandafter|gdef|csname end#1|endcsname[]]%
|endgroup
\defschemeregiontoken{schemeregion}
\def\undefschemeregiontoken#1{%
\expandafter\gdef\csname#1\endcsname{\UNDEFINED}}
% introducing new code-tokens to the keyword, variable and constant
% categories
\def\comm@ntII{%
\begingroup
\let\do\@makeother \dospecials
\@commII}
\begingroup\catcode`\[1\catcode`\]2
\catcode`\{12\catcode`\}12
\long\gdef\@commII{[%
\long\def\@tempa ##1}[\endgroup]\@tempa]%
\endgroup
\let\setkeyword\comm@ntII
\let\setvariable\comm@ntII
\let\setconstant\comm@ntII
% \defschememathescape makes the succeeding grouped character an
% escape into latex math from within Scheme code;
% this character can't be }
\let\defschememathescape\comm@ntII
\let\undefschememathescape\comm@ntII
% telling SLaTeX that a certain Scheme identifier is to
% be replaced by the specified LaTeX expression.
% Useful for generating ``mathematical''-looking
% typeset code even though the corresponding Scheme
% code is ascii as usual and doesn't violate
% identifier-naming rules
\def\setspecialsymbol{%
\begingroup
\let\do\@makeother \dospecials
\@commIII}
\begingroup\catcode`\[1\catcode`\]2
\catcode`\{12\catcode`\}12
\long\gdef\@commIII{[%
\long\def\@tempa ##1}[\endgroup\@gobbleI]\@tempa]%
\endgroup
\def\@gobbleI#1{}
% \unsetspecialsymbol strips Scheme identifier(s) of
% any ``mathematical'' look lent by the above
\let\unsetspecialsymbol\comm@ntII
% enabling/disabling slatex
\def\slatexdisable#1{\expandafter\gdef\csname#1\endcsname{}}
% \schemecasesensitive takes either true or false as
% argument
\def\schemecasesensitive#1{}
%for latex only: use \slatexseparateincludes before the
%occurrence of any Scheme code in your file, if you
%want the various \include'd files to have their own
%pool of temporary slatex files. This lets you juggle
%your \include's in successive runs of LaTeX without
%having to worry that the temp. files may interfere.
%By default, only a single pool of temp files is used.
%Warning: On DOS, if your \include'd files have fairly
%similar names, avoid \slatexseparateincludes since the
%short filenames on DOS will likely confuse the temp
%file pools of different \include files.
\def\slatexseparateincludes{%
\gdef\include##1{{\def\subjobname{##1}%
\sch@mefilenamecount=-1%
\@include##1 }}}
% convenient abbreviations for characters
\begingroup
\catcode`\|=0
|catcode`|\=12
|gdef|ttbackslash{{|tt|catcode`|\=12\}}
|endgroup
\mathchardef\lt="313C
\mathchardef\gt="313E
\begingroup
\catcode`\@12%
\global\let\atsign@%
\endgroup
\chardef\dq=`\"
% leading character of slatex filenames: . for unix to
% keep them out of the way
\def\filehider{.}
% since the above doesn't work of dos, slatex on dos
% will use a different character, and make the
% redefinition available through the following
\inputifpossible{xZfilhid.tex}
% @ is no longer a letter for TeX
\ifusinglatex\relax\else
\catcode`@\atcatcodebeforeslatex
\fi
\message{*** Check: Are you sure you called SLaTeX? ***}

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -12,7 +12,8 @@
compile-core-expr-to-port assembler-output
current-primitive-locations eval-core)
(ikarus intel-assembler)
(ikarus fasl write))
;(ikarus fasl write)
)
(define-syntax record-case

View File

@ -8,6 +8,7 @@
fxpositive? fxnegative?
fxeven? fxodd?
fixnum->string
fxarithmetic-shift-left fxarithmetic-shift-right fxarithmetic-shift
error@fx+)
(import
(ikarus system $fx)
@ -22,6 +23,7 @@
fxior fxand fxxor fxnot
fxpositive? fxnegative?
fxeven? fxodd?
fxarithmetic-shift-left fxarithmetic-shift-right fxarithmetic-shift
fixnum->string))
(define fxzero?
@ -206,6 +208,17 @@
(error 'fxsra "negative shift not allowed, got ~s" y))
($fxsra x y)))
(define fxarithmetic-shift-right
(lambda (x y)
(unless (fixnum? x)
(error 'fxarithmetic-shift-right "~s is not a fixnum" x))
(unless (fixnum? y)
(error 'fxarithmetic-shift-right "~s is not a fixnum" y))
(unless ($fx>= y 0)
(error 'fxarithmetic-shift-right "negative shift not allowed, got ~s" y))
($fxsra x y)))
(define fxsll
(lambda (x y)
(unless (fixnum? x)
@ -216,6 +229,27 @@
(error 'fxsll "negative shift not allowed, got ~s" y))
($fxsll x y)))
(define fxarithmetic-shift-left
(lambda (x y)
(unless (fixnum? x)
(error 'fxarithmetic-shift-left "~s is not a fixnum" x))
(unless (fixnum? y)
(error 'fxarithmetic-shift-left "~s is not a fixnum" y))
(unless ($fx>= y 0)
(error 'fxarithmetic-shift-left "negative shift not allowed, got ~s" y))
($fxsll x y)))
(define fxarithmetic-shift
(lambda (x y)
(unless (fixnum? x)
(error 'fxarithmetic-shift "~s is not a fixnum" x))
(unless (fixnum? y)
(error 'fxarithmetic-shift "~s is not a fixnum" y))
(if ($fx>= y 0)
($fxsll x y)
($fxsra x ($fx- 0 y)))))
(define (fxpositive? x)
(if (fixnum? x)
($fx> x 0)

View File

@ -316,7 +316,7 @@
abs truncate fltruncate sra sll
exact->inexact inexact floor ceiling round log fl=? fl<? fl<=? fl>?
fl>=? fl+ fl- fl* fl/ flsqrt flmin flzero? flnegative?
sin cos tan asin acos atan sqrt
sin cos tan asin acos atan sqrt exp
flround flmax random)
(import
(ikarus system $fx)
@ -334,7 +334,7 @@
exact->inexact inexact floor ceiling round log
exact-integer-sqrt min max abs
fl=? fl<? fl<=? fl>? fl>=? fl+ fl- fl* fl/ flsqrt flmin
flzero? flnegative? sra sll
flzero? flnegative? sra sll exp
sin cos tan asin acos atan sqrt truncate fltruncate
flround flmax random))
@ -2262,6 +2262,15 @@
(foreign-call "ikrt_bignum_shift_right" n m^))])]
[else (error who "~s is not an exact integer" n)]))
(define (exp x)
(cond
[(flonum? x) (flexp x)]
[(fixnum? x)
(if ($fx= x 0) 1 (flexp (fixnum->flonum x)))]
[(bignum? x) (flexp (bignum->flonum x))]
[(ratnum? x) (flexp (ratnum->flonum x))]
[else (error 'exp "~s is not a number" x)]))
)

View File

@ -51,12 +51,7 @@
(write (car v*))
(f (cdr v*))])))
(apply values v*))))
(lambda () (set! k* (cdr k*))))]))))))
)
(lambda () (set! k* (cdr k*))))])))))))
#!eof
@ -123,11 +118,33 @@ Try:
(cond
[(zero? n) (k m)]
[else (begin (fact (sub1 n) (* n m) k) 0)]))
(call/cc
(lambda (k)
(fact 6 1
(trace-lambda escape (v) (k v)))))
(call/cc
(lambda k*
(trace-define (fact n)
(cond
[(zero? n)
(call/cc
(lambda (k)
(set! k* (cons k k*))
1))]
[else (* n (fact (sub1 n)))]))
(fact 9)
(let ([k (car k*)])
(set! k* (cdr k*))
(k 100000))))
(trace-define (infinite-loop n)
(infinite-loop (add1 n)))
(infinite-loop 0)

View File

@ -209,6 +209,8 @@
($string-foldcase str)
(error 'string-foldcase "~s is not a string" str)))
;;; FIXME: case-insensitive comparison procedures are slow.
(define string-ci-cmp
(lambda (who cmp)
(case-lambda

View File

@ -364,7 +364,7 @@
[char-ci>=? i unicode]
[char-alphabetic? i unicode]
[char-numeric? i unicode]
[char-whitespace? i unicode]
[char-whitespace? i r unicode]
[char-upper-case? i unicode]
[char-lower-case? i unicode]
[char-title-case? i unicode]
@ -454,6 +454,9 @@
[fxodd? i]
[fxpositive? i]
[fxnegative? i]
[fxarithmetic-shift-left i]
[fxarithmetic-shift-right i]
[fxarithmetic-shift i]
[for-each i r]
[map i r]
@ -539,6 +542,7 @@
[add1 i]
[sub1 i]
[expt i r]
[exp i r]
[flexpt i]
[sin i r]
[cos i r]
@ -938,7 +942,7 @@
[force i]
[make-traced-procedure i]
[error@fx+ ]
[fasl-write i]
))
(define (verify-map)

View File

@ -6,6 +6,8 @@
(define library-names
'(
[se (scheme-report-environment)]
[r5 (rnrs r5rs (6))]
[ct (rnrs control (6))]
[ev (rnrs eval (6))]
[mp (rnrs mutable-pairs (6))]
@ -31,8 +33,6 @@
[ri (rnrs records inspection (6))]
[rp (rnrs records procedural (6))]
[rs (rnrs records syntactic (6))]
[r5 (rnrs r5rs (6))]
[se (scheme-report-environment)]
))
(define status-names
@ -40,6 +40,7 @@
[S scheduled]
[D deferred]
[C completed]
[X killed]
))
(define identifier-names
@ -142,14 +143,14 @@
[div0-and-mod0 C ba]
[dynamic-wind C ba se]
[eq? C ba se]
[equal? S ba se]
[equal? C ba se]
[eqv? C ba se]
[error S ba]
[even? C ba se]
[exact C ba]
[exact-integer-sqrt C ba]
[exact? C ba se]
[exp S ba se]
[exp C ba se]
[expt C ba se]
[finite? C ba]
[floor C ba se]
@ -268,9 +269,9 @@
[fx>=? C fx]
[fx>? C fx]
[fxand C fx]
[fxarithmetic-shift S fx]
[fxarithmetic-shift-left S fx]
[fxarithmetic-shift-right S fx]
[fxarithmetic-shift C fx]
[fxarithmetic-shift-left C fx]
[fxarithmetic-shift-right C fx]
[fxbit-count D fx]
[fxbit-field D fx]
[fxbit-set? D fx]
@ -344,12 +345,12 @@
[fltruncate C fl]
[flzero? C fl]
[real->flonum D fl]
[make-no-infinities-violation D fl]
[make-no-nans-violation D fl]
[&no-infinities D fl]
[no-infinities-violation? D fl]
[&no-nans D fl]
[no-nans-violation? D fl]
[make-no-infinities-violation X fl]
[make-no-nans-violation X fl]
[&no-infinities X fl]
[no-infinities-violation? X fl]
[&no-nans X fl]
[no-nans-violation? X fl]
;;;
[bytevector->sint-list C bv]
[bytevector->u8-list C bv]
@ -410,58 +411,58 @@
[utf16->string S bv]
[utf32->string S bv]
;;;
[condition? D co]
[&assertion D co]
[assertion-violation? D co]
[&condition D co]
[condition D co]
[condition-accessor D co]
[condition-irritants D co]
[condition-message D co]
[condition-predicate D co]
[condition-who D co]
[define-condition-type D co]
[&error D co]
[error? D co]
[&implementation-restriction D co]
[implementation-restriction-violation? D co]
[&irritants D co]
[irritants-condition? D co]
[&lexical D co]
[lexical-violation? D co]
[make-assertion-violation D co]
[make-error D co]
[make-implementation-restriction-violation D co]
[make-irritants-condition D co]
[make-lexical-violation D co]
[make-message-condition D co]
[make-non-continuable-violation D co]
[make-serious-condition D co]
[make-syntax-violation D co]
[make-undefined-violation D co]
[make-violation D co]
[make-warning D co]
[make-who-condition D co]
[&message D co]
[message-condition? D co]
[&non-continuable D co]
[non-continuable-violation? D co]
[&serious D co]
[serious-condition? D co]
[simple-conditions D co]
[&syntax D co]
[syntax-violation D co sc]
[syntax-violation-form D co]
[syntax-violation-subform D co]
[syntax-violation? D co]
[&undefined D co]
[undefined-violation? D co]
[&violation D co]
[violation? D co]
[&warning D co]
[warning? D co]
[&who D co]
[who-condition? D co]
[condition? X co]
[&assertion X co]
[assertion-violation? X co]
[&condition X co]
[condition X co]
[condition-accessor X co]
[condition-irritants X co]
[condition-message X co]
[condition-predicate X co]
[condition-who X co]
[define-condition-type X co]
[&error X co]
[error? X co]
[&implementation-restriction X co]
[implementation-restriction-violation? X co]
[&irritants X co]
[irritants-condition? X co]
[&lexical X co]
[lexical-violation? X co]
[make-assertion-violation X co]
[make-error X co]
[make-implementation-restriction-violation X co]
[make-irritants-condition X co]
[make-lexical-violation X co]
[make-message-condition X co]
[make-non-continuable-violation X co]
[make-serious-condition X co]
[make-syntax-violation X co]
[make-undefined-violation X co]
[make-violation X co]
[make-warning X co]
[make-who-condition X co]
[&message X co]
[message-condition? X co]
[&non-continuable X co]
[non-continuable-violation? X co]
[&serious X co]
[serious-condition? X co]
[simple-conditions X co]
[&syntax X co]
[syntax-violation X co sc]
[syntax-violation-form X co]
[syntax-violation-subform X co]
[syntax-violation? X co]
[&undefined X co]
[undefined-violation? X co]
[&violation X co]
[violation? X co]
[&warning X co]
[warning? X co]
[&who X co]
[who-condition? X co]
;;;
[case-lambda C ct]
[do C ct se ne]
@ -486,10 +487,10 @@
[environment C ev]
[eval C ev se]
;;;
[raise S ex]
[raise-continuable S ex]
[with-exception-handler S ex]
[guard S ex]
[raise X ex]
[raise-continuable X ex]
[with-exception-handler X ex]
[guard X ex]
;;;
[binary-port? D ip]
[buffer-mode D ip]
@ -537,7 +538,7 @@
[remainder C r5 se]
[null-environment C r5 se]
[quotient C r5 se]
[scheme-report-environment S r5 se]
[scheme-report-environment C r5 se]
;;;
[close-port D ip]
[eol-style D ip]
@ -555,33 +556,33 @@
[get-string-n D ip]
[get-string-n! D ip]
[get-u8 D ip]
[&i/o D ip is fi]
[&i/o-decoding D ip]
[i/o-decoding-error? D ip]
[&i/o-encoding D ip]
[i/o-encoding-error-char D ip]
[i/o-encoding-error? D ip]
[i/o-error-filename D ip is fi]
[i/o-error-port D ip is fi]
[i/o-error? D ip is fi]
[&i/o-file-already-exists D ip is fi]
[i/o-file-already-exists-error? D ip is fi]
[&i/o-file-does-not-exist D ip is fi]
[i/o-file-does-not-exist-error? D ip is fi]
[&i/o-file-is-read-only D ip is fi]
[i/o-file-is-read-only-error? D ip is fi]
[&i/o-file-protection D ip is fi]
[i/o-file-protection-error? D ip is fi]
[&i/o-filename D ip is fi]
[i/o-filename-error? D ip is fi]
[&i/o-invalid-position D ip is fi]
[i/o-invalid-position-error? D ip is fi]
[&i/o-port D ip is fi]
[i/o-port-error? D ip is fi]
[&i/o-read D ip is fi]
[i/o-read-error? D ip is fi]
[&i/o-write D ip is fi]
[i/o-write-error? D ip is fi]
[&i/o X ip is fi]
[&i/o-decoding X ip]
[i/o-decoding-error? X ip]
[&i/o-encoding X ip]
[i/o-encoding-error-char X ip]
[i/o-encoding-error? X ip]
[i/o-error-filename X ip is fi]
[i/o-error-port X ip is fi]
[i/o-error? X ip is fi]
[&i/o-file-already-exists X ip is fi]
[i/o-file-already-exists-error? X ip is fi]
[&i/o-file-does-not-exist X ip is fi]
[i/o-file-does-not-exist-error? X ip is fi]
[&i/o-file-is-read-only X ip is fi]
[i/o-file-is-read-only-error? X ip is fi]
[&i/o-file-protection X ip is fi]
[i/o-file-protection-error? X ip is fi]
[&i/o-filename X ip is fi]
[i/o-filename-error? X ip is fi]
[&i/o-invalid-position X ip is fi]
[i/o-invalid-position-error? X ip is fi]
[&i/o-port X ip is fi]
[i/o-port-error? X ip is fi]
[&i/o-read X ip is fi]
[i/o-read-error? X ip is fi]
[&i/o-write X ip is fi]
[i/o-write-error? X ip is fi]
[lookahead-char D ip]
[lookahead-u8 D ip]
[make-bytevector C bv]
@ -591,18 +592,18 @@
[make-custom-textual-input-port D ip]
[make-custom-textual-input/output-port D ip]
[make-custom-textual-output-port D ip]
[make-i/o-decoding-error D ip]
[make-i/o-encoding-error D ip]
[make-i/o-error D ip is fi]
[make-i/o-file-already-exists-error D ip is fi]
[make-i/o-file-does-not-exist-error D ip is fi]
[make-i/o-file-is-read-only-error D ip is fi]
[make-i/o-file-protection-error D ip is fi]
[make-i/o-filename-error D ip is fi]
[make-i/o-invalid-position-error D ip is fi]
[make-i/o-port-error D ip is fi]
[make-i/o-read-error D ip is fi]
[make-i/o-write-error D ip is fi]
[make-i/o-decoding-error X ip]
[make-i/o-encoding-error X ip]
[make-i/o-error X ip is fi]
[make-i/o-file-already-exists-error X ip is fi]
[make-i/o-file-does-not-exist-error X ip is fi]
[make-i/o-file-is-read-only-error X ip is fi]
[make-i/o-file-protection-error X ip is fi]
[make-i/o-filename-error X ip is fi]
[make-i/o-invalid-position-error X ip is fi]
[make-i/o-port-error X ip is fi]
[make-i/o-read-error X ip is fi]
[make-i/o-write-error X ip is fi]
[latin-1-codec D ip]
[make-transcoder D ip]
[native-eol-style D ip]
@ -691,37 +692,37 @@
[file-exists? C fi]
[delete-file C fi]
;;;
[define-record-type D rs]
[fields D rs]
[immutable D rs]
[mutable D rs]
[opaque D rs]
[parent D rs]
[parent-rtd D rs]
[protocol D rs]
[record-constructor-descriptor D rs]
[record-type-descriptor D rs]
[sealed D rs]
[nongenerative D rs]
[define-record-type X rs]
[fields X rs]
[immutable X rs]
[mutable X rs]
[opaque X rs]
[parent X rs]
[parent-rtd X rs]
[protocol X rs]
[record-constructor-descriptor X rs]
[record-type-descriptor X rs]
[sealed X rs]
[nongenerative X rs]
;;;
[record-field-mutable? D ri]
[record-rtd D ri]
[record-type-field-names D ri]
[record-type-generative? D ri]
[record-type-name D ri]
[record-type-opaque? D ri]
[record-type-parent D ri]
[record-type-sealed? D ri]
[record-type-uid D ri]
[record? D ri]
[record-field-mutable? X ri]
[record-rtd X ri]
[record-type-field-names X ri]
[record-type-generative? X ri]
[record-type-name X ri]
[record-type-opaque? X ri]
[record-type-parent X ri]
[record-type-sealed? X ri]
[record-type-uid X ri]
[record? X ri]
;;;
[make-record-constructor-descriptor D rp]
[make-record-type-descriptor D rp]
[record-accessor D rp]
[record-constructor D rp]
[record-mutator D rp]
[record-predicate D rp]
[record-type-descriptor? D rp]
[make-record-constructor-descriptor X rp]
[make-record-type-descriptor X rp]
[record-accessor X rp]
[record-constructor X rp]
[record-mutator X rp]
[record-predicate X rp]
[record-type-descriptor? X rp]
;;;
[bound-identifier=? C sc]
[datum->syntax C sc]