aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/interp/ChangeLog12
-rw-r--r--src/interp/Makefile.in16
-rw-r--r--src/interp/Makefile.pamphlet28
-rw-r--r--src/interp/fortcall.boot.pamphlet25
-rw-r--r--src/interp/match.boot.pamphlet13
-rw-r--r--src/interp/patches.lisp7
6 files changed, 52 insertions, 49 deletions
diff --git a/src/interp/ChangeLog b/src/interp/ChangeLog
index 0606777a..69d030df 100644
--- a/src/interp/ChangeLog
+++ b/src/interp/ChangeLog
@@ -1,3 +1,15 @@
+2007-10-21 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * Makefile.pamphlet (<<fortcall.clisp>>): Remove.
+ (<<match.clisp>>): Likewise.
+ (fortcall.$(FASLEXT)): New rule.
+ (match.$(FASLEXT)): Likewise.
+ * fortcall.boot.pamphlet: Push into package "BOOT". Import
+ "sys-macros". Fix syntax.
+ * match.boot.pamphlet: Likewise.
+ * patches.lisp (|makeVector): Move to fortcall.boot.
+ (|makeList|): Likewise.
+
2007-10-20 Gabriel Dos Reis <gdr@cs.tamu.edu>
* Makefile.pamphlet (OBJS): Include i-object.$(FASLEXT).
diff --git a/src/interp/Makefile.in b/src/interp/Makefile.in
index 2192c551..9ab363f5 100644
--- a/src/interp/Makefile.in
+++ b/src/interp/Makefile.in
@@ -399,6 +399,10 @@ database.date:
$(AUTO)/%.$(FASLEXT): %.$(FASLEXT)
$(INSTALL) $< $@
+## Translation to Fortran
+fortcall.$(FASLEXT): fortcall.boot sys-macros.$(FASLEXT)
+ $(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<
+
## HyperDoc
bc-solve.$(FASLEXT): bc-solve.boot bc-matrix.$(FASLEXT)
$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<
@@ -444,6 +448,9 @@ i-object.$(FASLEXT): i-object.boot sys-macros.$(FASLEXT)
format.$(FASLEXT): format.boot macros.$(FASLEXT)
$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<
+match.$(FASLEXT): match.boot sys-macros.$(FASLEXT)
+ $(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<
+
## Interface with the Aldor compiler.
ax.$(FASLEXT): ax.boot as.$(FASLEXT)
$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<
@@ -677,11 +684,6 @@ define.clisp: define.boot
@ echo 247 making $@ from $<
@ echo '(old-boot::boot "define.boot")' | ${DEPSYS}
-fortcall.clisp: fortcall.boot
- @ echo 55 making $@ from $<
- @ echo '(progn (old-boot::boot "fortcall.boot"))' | ${DEPSYS}
-
-
functor.clisp: functor.boot
@ echo 254 making $@ from $<
@ echo '(old-boot::boot "functor.boot")' | ${DEPSYS}
@@ -754,10 +756,6 @@ i-util.clisp: i-util.boot
@ echo 325 making $@ from $<
@ echo '(old-boot::boot "i-util.boot")' | ${DEPSYS}
-match.clisp: match.boot
- @ echo 339 making $@ from $<
- @ echo '(old-boot::boot "match.boot")' | ${DEPSYS}
-
modemap.clisp: modemap.boot
@ echo 343 making $@ from $<
@ echo '(old-boot::boot "modemap.boot")' | ${DEPSYS}
diff --git a/src/interp/Makefile.pamphlet b/src/interp/Makefile.pamphlet
index bcf30250..b3bdb548 100644
--- a/src/interp/Makefile.pamphlet
+++ b/src/interp/Makefile.pamphlet
@@ -1083,15 +1083,6 @@ $(axiom_build_texdir)/diagrams.tex: $(axiom_src_docdir)/diagrams.tex
$(INSTALL_DATA) $< $@
@
-\subsection{fortcall.boot \cite{16}}
-
-<<fortcall.clisp>>=
-fortcall.clisp: fortcall.boot
- @ echo 55 making $@ from $<
- @ echo '(progn (old-boot::boot "fortcall.boot"))' | ${DEPSYS}
-
-@
-
\subsection{category.boot \cite{58}}
<<category.clisp>>=
@@ -1302,14 +1293,6 @@ iterator.clisp: iterator.boot
@ echo '(old-boot::boot "iterator.boot")' | ${DEPSYS}
@
-\subsection{match.boot}
-
-<<match.clisp>>=
-match.clisp: match.boot
- @ echo 339 making $@ from $<
- @ echo '(old-boot::boot "match.boot")' | ${DEPSYS}
-@
-
\subsection{modemap.boot}
<<modemap.clisp>>=
@@ -1574,6 +1557,10 @@ distclean-local: clean-local
$(AUTO)/%.$(FASLEXT): %.$(FASLEXT)
$(INSTALL) $< $@
+## Translation to Fortran
+fortcall.$(FASLEXT): fortcall.boot sys-macros.$(FASLEXT)
+ $(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<
+
## HyperDoc
bc-solve.$(FASLEXT): bc-solve.boot bc-matrix.$(FASLEXT)
$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<
@@ -1619,6 +1606,9 @@ i-object.$(FASLEXT): i-object.boot sys-macros.$(FASLEXT)
format.$(FASLEXT): format.boot macros.$(FASLEXT)
$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<
+match.$(FASLEXT): match.boot sys-macros.$(FASLEXT)
+ $(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<
+
## Interface with the Aldor compiler.
ax.$(FASLEXT): ax.boot as.$(FASLEXT)
$(BOOTSYS) -- --compile --boot="old" --output=$@ --load-directory=. $<
@@ -1822,8 +1812,6 @@ boot-pkg.$(FASLEXT): boot-pkg.lisp
<<define.clisp>>
-<<fortcall.clisp>>
-
<<functor.clisp>>
<<i-analy.clisp>>
@@ -1860,8 +1848,6 @@ boot-pkg.$(FASLEXT): boot-pkg.lisp
<<i-util.clisp>>
-<<match.clisp>>
-
<<modemap.clisp>>
<<msgdb.clisp>>
diff --git a/src/interp/fortcall.boot.pamphlet b/src/interp/fortcall.boot.pamphlet
index 9513e313..51471c79 100644
--- a/src/interp/fortcall.boot.pamphlet
+++ b/src/interp/fortcall.boot.pamphlet
@@ -46,6 +46,16 @@
<<*>>=
<<license>>
+import '"sys-macros"
+)package "BOOT"
+
+makeVector(elts, t) ==
+ MAKE_-ARRAY(#elts, KEYWORD::ELEMENT_-TYPE, t or true,
+ KEYWORD::INITIAL_-CONTENTS, elts)
+
+makeList(n, e) ==
+ MAKE_-LIST(n, KEYWORD::INITIAL_-ELEMENT, e)
+
makeFort(name,args,decls,results,returnType,aspInfo) ==
-- Create an executable Fortran file to call a given library function,
-- and a stub Axiom function to process its arguments.
@@ -103,7 +113,7 @@ writeCFile(name,args,fortranArgs,dummies,decls,results,returnType,asps,fp) ==
WRITE_-LINE('" XDR xdrs;",fp)
WRITE_-LINE('" {",fp)
if $addUnderscoreToFortranNames then
- routineName := STRCONC(name,STRING(95))
+ routineName := STRCONC(name,STRING CODE_-CHAR 95)
else
routineName := name
-- If it is a function then give it somewhere to stick its result:
@@ -161,7 +171,7 @@ isPointer?(u,decls) ==
printCName(u,ispointer,asps,fp) ==
member(u,asps) =>
PRINC(u,fp)
- if $addUnderscoreToFortranNames then PRINC(STRING(95),fp)
+ if $addUnderscoreToFortranNames then PRINC(STRING CODE_-CHAR 95,fp)
if not ispointer then PRINC('"&",fp)
PRINC(u,fp)
@@ -203,7 +213,7 @@ printDec(type,dec,asps,fp) ==
wt(['" ",if LISTP(type) then first(type) else type,'" "],fp)
member(dec,asps) =>
if $addUnderscoreToFortranNames then
- wl([dec,STRING(95),'"();"],fp)
+ wl([dec,STRING CODE_-CHAR 95,'"();"],fp)
else
wl([dec,'"();"],fp)
LISTP(type) =>
@@ -216,7 +226,7 @@ printDec(type,dec,asps,fp) ==
writeXDR(v,str,fp) ==
-- Generate the calls to the filters which will read from the temp
-- file. The CHECK macro ensures that the translation worked.
- underscore := STRING CHAR("__:",0) -- to avoid a compiler bug which won't
+ underscore := STRING CHAR('"__:",0) -- to avoid a compiler bug which won't
-- parse " ... __" properly.
wt(['" CHECK(xdr",underscore, XDRFun(v), '"(", str, '",&", first(v)],fp)
if (LISTP (ty :=SECOND v)) and not EQUAL(first ty,'"char") then
@@ -438,7 +448,7 @@ spadify(l,results,decls,names,actual) ==
-- The elements of list l are the output forms returned from the Fortran
-- code: integers, floats and vectors. Return spad forms of these, of
-- type Record(key:Symbol,entry:Any) (for use with the Result domain).
- SETQ(RESULTS,l)
+ -- SETQ(RESULTS,l)
spadForms := nil
for i in 0..(#l -1) repeat
fort := NTH(i,l)
@@ -559,10 +569,11 @@ checkForBoolean u ==
u = "BOOLEAN" => "FIXNUM"
u
+shortZero == COERCE(0.0,'SHORT_-FLOAT)
+longZero == COERCE(0.0,'DOUBLE_-FLOAT)
+
prepareResults(results,args,dummies,values,decls) ==
-- Create the floating point zeros (boot doesn't like 0.0d0, 0.0D0 etc)
- shortZero : fluid := COERCE(0.0,'SHORT_-FLOAT)
- longZero : fluid := COERCE(0.0,'DOUBLE_-FLOAT)
data := nil
for u in results repeat
type := getFortranType(u,decls)
diff --git a/src/interp/match.boot.pamphlet b/src/interp/match.boot.pamphlet
index 132b99f9..710aed3e 100644
--- a/src/interp/match.boot.pamphlet
+++ b/src/interp/match.boot.pamphlet
@@ -46,7 +46,10 @@
<<*>>=
<<license>>
-SETANDFILEQ($wildCard,char "*")
+import '"sys-macros"
+)package "BOOT"
+
+$wildCard := char "*"
maskMatch?(mask,subject) ==
null mask => true
@@ -64,7 +67,7 @@ substring?(part, whole, startpos) ==
anySubstring?(part,whole,startpos) ==
np := SIZE part
nw := SIZE whole
- or/[((k := i) and and/[CHAR_-EQUAL(ELT(part, ip),ELT(whole, iw))
+ or/[((k := i) and "and"/[CHAR_-EQUAL(ELT(part, ip),ELT(whole, iw))
for ip in 0..np - 1 for iw in i..]) for i in startpos..nw - np] => k
charPosition(c,t,startpos) ==
@@ -83,13 +86,13 @@ rightCharPosition(c,t,startpos) == --startpos often equals MAXINDEX t (rightmost
stringPosition(s,t,startpos) ==
n := SIZE t
- if startpos < 0 or startpos > n then error "index out of range"
+ if startpos < 0 or startpos > n then error '"index out of range"
if SIZE s = 0 then return startpos -- bug in STRPOS
r := STRPOS(s,t,startpos,NIL)
if EQ(r,NIL) then n else r
superMatch?(opattern,subject) == --subject assumed to be DOWNCASEd
- $wildCard : local := char '_*
+ $wildCard : local := char "*"
pattern := patternCheck opattern
logicalMatch?(pattern,subject)
@@ -103,7 +106,7 @@ logicalMatch?(pattern,subject) == --subject assumed to be DOWNCASEd
patternCheck pattern == main where
--checks for escape characters, maybe new $wildCard
- main ==
+ main() ==
-- pattern := pmTransFilter pattern --should no longer need this (rdj:10/1/91)
u := pos(char '__,pattern)
null u => pattern
diff --git a/src/interp/patches.lisp b/src/interp/patches.lisp
index 408e92d9..5c11c540 100644
--- a/src/interp/patches.lisp
+++ b/src/interp/patches.lisp
@@ -328,13 +328,6 @@
)
)
-
-(defun |makeVector| (els type)
- (make-array (length els) :element-type (or type t) :initial-contents els))
-
-
-(defun |makeList| (size el) (make-list size :initial-element el) )
-
#+:akcl
(defun print-xdr-stream (x y z) (format y "XDR:~A" (xdr-stream-name x)))
#+:akcl