aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure18
-rw-r--r--configure.ac2
-rw-r--r--configure.ac.pamphlet2
-rw-r--r--src/ChangeLog12
-rw-r--r--src/algebra/mkfunc.spad.pamphlet16
-rw-r--r--src/doc/help/library.help27
-rw-r--r--src/input/torus.input.pamphlet2
-rw-r--r--src/interp/c-util.boot8
-rw-r--r--src/interp/i-map.boot6
-rw-r--r--src/interp/i-spec1.boot15
-rw-r--r--src/interp/slam.boot16
-rw-r--r--src/lib/cfuns-c.c7
12 files changed, 88 insertions, 43 deletions
diff --git a/configure b/configure
index 44ecd0b9..e2cdba05 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for OpenAxiom 1.4.0-2009-07-06.
+# Generated by GNU Autoconf 2.63 for OpenAxiom 1.4.0-2009-07-12.
#
# Report bugs to <open-axiom-bugs@lists.sf.net>.
#
@@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='OpenAxiom'
PACKAGE_TARNAME='openaxiom'
-PACKAGE_VERSION='1.4.0-2009-07-06'
-PACKAGE_STRING='OpenAxiom 1.4.0-2009-07-06'
+PACKAGE_VERSION='1.4.0-2009-07-12'
+PACKAGE_STRING='OpenAxiom 1.4.0-2009-07-12'
PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net'
ac_unique_file="src/Makefile.pamphlet"
@@ -1502,7 +1502,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures OpenAxiom 1.4.0-2009-07-06 to adapt to many kinds of systems.
+\`configure' configures OpenAxiom 1.4.0-2009-07-12 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1572,7 +1572,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenAxiom 1.4.0-2009-07-06:";;
+ short | recursive ) echo "Configuration of OpenAxiom 1.4.0-2009-07-12:";;
esac
cat <<\_ACEOF
@@ -1675,7 +1675,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenAxiom configure 1.4.0-2009-07-06
+OpenAxiom configure 1.4.0-2009-07-12
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1689,7 +1689,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by OpenAxiom $as_me 1.4.0-2009-07-06, which was
+It was created by OpenAxiom $as_me 1.4.0-2009-07-12, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -17704,7 +17704,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by OpenAxiom $as_me 1.4.0-2009-07-06, which was
+This file was extended by OpenAxiom $as_me 1.4.0-2009-07-12, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17767,7 +17767,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-OpenAxiom config.status 1.4.0-2009-07-06
+OpenAxiom config.status 1.4.0-2009-07-12
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index 93a52b5f..fa635c7d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.4.0-2009-07-06],
+AC_INIT([OpenAxiom], [1.4.0-2009-07-12],
[open-axiom-bugs@lists.sf.net])
AC_CONFIG_AUX_DIR(config)
diff --git a/configure.ac.pamphlet b/configure.ac.pamphlet
index 5d4fa725..a0a18dbd 100644
--- a/configure.ac.pamphlet
+++ b/configure.ac.pamphlet
@@ -1141,7 +1141,7 @@ information:
<<Autoconf init>>=
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.4.0-2009-07-06],
+AC_INIT([OpenAxiom], [1.4.0-2009-07-12],
[open-axiom-bugs@lists.sf.net])
@
diff --git a/src/ChangeLog b/src/ChangeLog
index 981cc7ec..cac7aa68 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,14 @@
-2009-07-10 Alfredo Portes <doyenatccny@gmail.com>
+2009-07-12 Gabriel Dos Reis <gdr@cse.tamu.edu>
+
+ * algebra/mkfunc.spad.pamphlet
+ (mkDefun$MakeFloatCompiledFunction): Tidy.
+ * interp/c-util.boot (declareUnusedParameters): New.
+ * interp/i-map.boot: Use it.
+ * interp/i-spec1.boot: Likewise.
+ * interp/slam.boot: Likewise.
+ * lib/cfuns-c.c (writeablep): Document MinGW/MSYS bug work around.
+
+2009-07-10 Alfredo Portes <doyenatccny@gmail.com>
* lib/cfuns-c.c (writeablep): Use function LocalFree()
in Windows instead of free().
diff --git a/src/algebra/mkfunc.spad.pamphlet b/src/algebra/mkfunc.spad.pamphlet
index 4b629b78..30f219d6 100644
--- a/src/algebra/mkfunc.spad.pamphlet
+++ b/src/algebra/mkfunc.spad.pamphlet
@@ -397,6 +397,11 @@ MakeFloatCompiledFunction(S): Exports == Implementation where
coerceToSF(f: INF): INF ==
gencode("COERCE",[f, quote getVMType(SF)$Foreign(Builtin)])
+ -- return true if the form `x' is contained in `y'
+ contained?(x: INF, y: INF): Boolean ==
+ atom? y => x = y
+ contained?(x, car y) or contained?(x, cdr y)
+
mkPretend form ==
convert([convert("pretend"::Symbol), form, lsf]$List(INF))@INF
@@ -410,9 +415,14 @@ MakeFloatCompiledFunction(S): Exports == Implementation where
mkDefun(s, lv) ==
name := convert(new()$Symbol)@INF
- fun := convert([convert("DEFUN"::Symbol), name, convert lv,
- gencode("DECLARE",[gencode("FLOAT",lv)]),
- coerceToSF mkCTOR s]$List(INF))@INF
+ body := coerceToSF mkCTOR s
+ unusedParms := [ p for p in lv | not contained?(p,s)]
+ stmts :=
+ null unusedParms => [body]
+ [gencode("DECLARE",[gencode("IGNORE", unusedParms)]),body]
+ stmts := concat(gencode("DECLARE",[gencode("FLOAT",lv)]), stmts)
+ header := [convert("DEFUN"::Symbol), name, convert lv]
+ fun := convert append(header,stmts)
EVAL(fun)$Lisp
if _$compileDontDefineFunctions$Lisp then COMPILE(name)$Lisp
name
diff --git a/src/doc/help/library.help b/src/doc/help/library.help
index dc8cae84..4d12063d 100644
--- a/src/doc/help/library.help
+++ b/src/doc/help/library.help
@@ -20,19 +20,20 @@ Command Syntax:
Command Description:
-This command replaces the )load system command that was available in OpenAxiom
-releases before version 2.0. The )library command makes available to OpenAxiom
-the compiled objects in the libraries listed.
-
-For example, if you )compile dopler.as in your home directory, issue )library
-dopler to have OpenAxiom look at the library, determine the category and domain
-constructors present, update the internal database with various properties of
-the constructors, and arrange for the constructors to be automatically loaded
-when needed. If the )noexpose option has not been given, the constructors
-will be exposed (that is, available) in the current frame.
-
-If you compiled a file with the old system compiler, you will have an NRLIB
-present, for example, DOPLER.NRLIB, where DOPLER is a constructor
+This command replaces the )load system command that was available in previous
+releases. The )library command makes available to OpenAxiom the compiled
+objects in the libraries listed.
+
+For example, if you )compile dopler.spad in your home directory, issue
+)library dopler to have OpenAxiom look at the library, determine the
+category and domain constructors present, update the internal database
+with various properties of the constructors, and arrange for the
+constructors to be automatically loaded when needed. If the )noexpose
+option has not been given, the constructors will be exposed (that is,
+available) in the current frame.
+
+If you compiled a file with the current system compiler, you will have an
+NRLIB present, for example, DOPLER.NRLIB, where DOPLER is a constructor
abbreviation. The command )library DOPLER will then do the analysis and
database updates as above.
diff --git a/src/input/torus.input.pamphlet b/src/input/torus.input.pamphlet
index 81ea7b79..233a9bc1 100644
--- a/src/input/torus.input.pamphlet
+++ b/src/input/torus.input.pamphlet
@@ -12,7 +12,7 @@
<<*>>=
)cl all
f(x:SF):SF == x
-torus : TUBE := tubePlot(sin t,cos t,0,f,0..2*%pi,0.5::SF,12,"closed")
+torus := tubePlot(sin t,cos t,0,f,0..2*%pi,0.5::SF,12,"closed")
makeViewport3D(torus,"torus")$VIEW3D
@
\eject
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 945ac812..3d050c51 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -41,6 +41,7 @@ module c_-util where
replaceSimpleFunctions: %Form -> %Form
foldExportedFunctionReferences: %List -> %List
diagnoseUnknownType: (%Mode,%Env) -> %Form
+ declareUnusedParameters: (%List,%Code) -> %List
--%
@@ -121,6 +122,13 @@ wantArgumentsAsTuple: (%List,%Signature) -> %Boolean
wantArgumentsAsTuple(args,sig) ==
isHomoegenousVarargSignature sig and #args ^= #sig
+++ We are about to seal the (Lisp) definition of a function.
+++ Augment the `body' with a declaration for those `parms'
+++ that are unused.
+declareUnusedParameters(parms,body) ==
+ unused := [p for p in parms | not CONTAINED(p,body)]
+ null unused => [body]
+ [["DECLARE",["IGNORE",:unused]],body]
devaluate d ==
not REFVECP d => d
diff --git a/src/interp/i-map.boot b/src/interp/i-map.boot
index 2199f298..d0969c48 100644
--- a/src/interp/i-map.boot
+++ b/src/interp/i-map.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2008, Gabriel Dos Reis.
+-- Copyright (C) 2007-2009, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -758,10 +758,10 @@ compileCoerceMap(op,argTypes,mm) ==
parms:= [:parms,'envArg]
body := ['SPADCALL,:argCode,['LIST,['function,imp]]]
minivectorName := makeInternalMapMinivectorName(name)
- body := substitute(minivectorName,"$$$",body)
+ body := declareUnusedParameters(parms,substitute(minivectorName,"$$$",body))
setDynamicBinding(minivectorName,LIST2VEC $minivector)
compileInteractive
- [name,['LAMBDA,parms,declareGlobalVariables [minivectorName],body]]
+ [name,['LAMBDA,parms,declareGlobalVariables [minivectorName],:body]]
CAR sig
depthOfRecursion(opName,body) ==
diff --git a/src/interp/i-spec1.boot b/src/interp/i-spec1.boot
index 46416212..2ef75f07 100644
--- a/src/interp/i-spec1.boot
+++ b/src/interp/i-spec1.boot
@@ -176,9 +176,11 @@ compileADEFBody(t,vars,types,body,computedResultType) ==
-- Dx: LODO(EXPR INT, f +-> D(f, x)) := D()
--
-- MCD 13/3/96
+ parms := [:vars,"envArg"]
if not $definingMap and ($genValue or $compilingMap) then
- fun := [$mapName,["LAMBDA",[:vars,'envArg],
- declareGlobalVariables [minivectorName],body]]
+ fun := [$mapName,["LAMBDA",parms,
+ declareGlobalVariables [minivectorName],
+ :declareUnusedParameters(parms,body)]]
code := wrap compileInteractive fun
else
$freeVariables := []
@@ -186,7 +188,8 @@ compileADEFBody(t,vars,types,body,computedResultType) ==
-- CCL does not support upwards funargs, so we check for any free variables
-- and pass them into the lambda as part of envArg.
body := checkForFreeVariables(body,"ALL")
- fun := ["function",["LAMBDA",[:vars,'envArg],body]]
+ fun := ["function",["LAMBDA",parms,
+ :declareUnusedParameters(parms,body)]]
code := ["CONS", fun, ["VECTOR", :reverse $freeVariables]]
val := objNew(code,rt := ['Mapping,computedResultType,:rest types])
@@ -784,7 +787,8 @@ mkIterFun([index,:s],funBody,$localVars) ==
-- CCL does not support upwards funargs, so we check for any free variables
-- and pass them into the lambda as part of envArg.
body := checkForFreeVariables(getValue funBody,$localVars)
- val:=['function,['LAMBDA,[index,'envArg],objVal body]]
+ parms := [index,"envArg"]
+ val:=['function,['LAMBDA,parms,:declareUnusedParameters(parms,objVal body)]]
vec := mkAtreeNode GENSYM()
putValue(vec,objNew(['CONS,val,["VECTOR",:reverse $freeVariables]],mapMode))
vec
@@ -922,7 +926,8 @@ mkIterZippedFun(indexList,funBody,zipType,$localVars) ==
-- and pass them into the lambda as part of envArg.
body :=
[checkForFreeVariables(form,$localVars) for form in getValue funBody]
- val:=['function,['LAMBDA,[$index,'envArg],objVal body]]
+ parms := [$index,'envArg]
+ val:=['function,['LAMBDA,parms,:declareUnusedParameters(parms,objVal body)]]
vec := mkAtreeNode GENSYM()
putValue(vec,objNew(['CONS,val,["VECTOR",:reverse $freeVariables]],mapMode))
vec
diff --git a/src/interp/slam.boot b/src/interp/slam.boot
index 9e950e61..9340fe96 100644
--- a/src/interp/slam.boot
+++ b/src/interp/slam.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2008, Gabriel Dos Reis.
+-- Copyright (C) 2007-2009, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -53,9 +53,10 @@ reportFunctionCompilation(op,nam,argl,body,isRecursive) ==
init => compileRecurrenceRelation(op,nam,argl,body,init)
cacheCount:= getCacheCount op
cacheCount = "all" => reportFunctionCacheAll(op,nam,argl,body)
+ parms := [:argl,"envArg"]
cacheCount = 0 or null argl =>
- fun:= [nam,["LAMBDA",[:argl,'envArg],
- declareGlobalVariables [minivectorName],body]]
+ fun:= [nam,["LAMBDA",parms,declareGlobalVariables [minivectorName],
+ :declareUnusedParameters(parms,body)]]
compileInteractive fun
nam
num :=
@@ -92,7 +93,8 @@ reportFunctionCompilation(op,nam,argl,body,isRecursive) ==
-- of above.
lamex:= ["LAM",arg,codeBody]
mainFunction:= [nam,lamex]
- computeFunction:= [auxfn,["LAMBDA",[:argl, 'envArg],body]]
+ computeFunction:= [auxfn,["LAMBDA",parms,
+ :declareUnusedParameters(parms,body)]]
compileInteractive mainFunction
compileInteractive computeFunction
cacheType:= "function"
@@ -125,7 +127,9 @@ reportFunctionCacheAll(op,nam,argl,body) ==
codeBody:= ["PROG",[g2],["RETURN",["COND",secondPredPair,thirdPredPair]]]
lamex:= ["LAM",arg,codeBody]
mainFunction:= [nam,lamex]
- computeFunction:= [auxfn,["LAMBDA",[:argl, 'envArg],body]]
+ parms := [:argl, "envArg"]
+ computeFunction:= [auxfn,["LAMBDA",parms,
+ :declareUnusedParameters(parms,body)]]
compileInteractive mainFunction
compileInteractive computeFunction
cacheType:= 'hash_-table
@@ -203,7 +207,7 @@ compileRecurrenceRelation(op,nam,argl,junk,[body,sharpArg,n,:initCode]) ==
continueInit:=
[["%LET",gIndex,["%ELT",stateVar,0]],
:[["%LET",g,["%ELT",stateVar,i]] for g in gsList for i in 1..]]
- mainFunction:= [nam,["LAM",margl,mbody]] where
+ mainFunction:= [nam,["LAM",margl,:declareUnusedParameters(margl,mbody)]] where
margl:= [:argl,'envArg]
max:= GENSYM()
tripleCode := ["CONS",n,["LIST",:initCode]]
diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c
index 849af3c4..63758092 100644
--- a/src/lib/cfuns-c.c
+++ b/src/lib/cfuns-c.c
@@ -247,6 +247,13 @@ writeablep(char *path)
is writable. */
char* dir = oa_dirname(path);
code = stat(dir, &buf);
+ /* FIXME: Work around MinGW/MSYS bug.
+ The string pointed to by `dir' was strdup'd. According to
+ the C standard, that means the the string was allocated
+ by `malloc', therefore can be disposed of by `free'. However,
+ the MinGW/MSYS port appears to use MS' StrDup as the real
+ worker. Consequently, the guarantee that the the string can
+ free'd no longer holds. We have to use MS's LocalFree. */
#ifdef __WIN32__
LocalFree(dir);
#else