diff options
author | dos-reis <gdr@axiomatics.org> | 2008-09-07 20:13:42 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-09-07 20:13:42 +0000 |
commit | c0f80aca887462749a7cdc4fcacc579ee59aa850 (patch) | |
tree | f0e7543a797c0072415c80f36327f3b52309ec10 /src | |
parent | 18b7b4b5d3511211092796bd8d593d5c9debec02 (diff) | |
download | open-axiom-c0f80aca887462749a7cdc4fcacc579ee59aa850.tar.gz |
* boot/parser.boot (bpImport): Invert syntax for importing foreign
functions.
* boot/strap/parser.clisp: Update.
* interp/sys-os.boot: Change to new syntax throughout.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/algebra/exposed.lsp.pamphlet | 1 | ||||
-rw-r--r-- | src/boot/parser.boot | 8 | ||||
-rw-r--r-- | src/boot/strap/ast.clisp | 11 | ||||
-rw-r--r-- | src/boot/strap/parser.clisp | 28 | ||||
-rw-r--r-- | src/boot/strap/translator.clisp | 20 | ||||
-rw-r--r-- | src/interp/sys-os.boot | 116 |
7 files changed, 106 insertions, 85 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index aaac1a7b..2350a20f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2008-09-07 Gabriel Dos Reis <gdr@cs.tamu.edu> + * boot/parser.boot (bpImport): Invert syntax for importing foreign + functions. + * boot/strap/parser.clisp: Update. + * interp/sys-os.boot: Change to new syntax throughout. + +2008-09-07 Gabriel Dos Reis <gdr@cs.tamu.edu> + Ensure SingleFloat is 32-bit, DoubleFloat 64-bit. * interp/types.boot: Tidy. * interp/sys-constants.boot: Define limits for builtin numeric types. diff --git a/src/algebra/exposed.lsp.pamphlet b/src/algebra/exposed.lsp.pamphlet index 1e2df82c..4a729c69 100644 --- a/src/algebra/exposed.lsp.pamphlet +++ b/src/algebra/exposed.lsp.pamphlet @@ -107,6 +107,7 @@ (|DirectProductFunctions2| . DIRPROD2) (|DisplayPackage| . DISPLAY) (|DistinctDegreeFactorize| . DDFACT) + (|Domain| . DOMAIN) (|DoubleFloat| . DFLOAT) (|DoubleFloatSpecialFunctions| . DFSFUN) (|DrawComplex| . DRAWCX) diff --git a/src/boot/parser.boot b/src/boot/parser.boot index 87ade687..8bf5086d 100644 --- a/src/boot/parser.boot +++ b/src/boot/parser.boot @@ -462,10 +462,14 @@ bpModule() == ++ IMPORT QUOTE String bpImport() == bpEqKey "IMPORT" => + a := bpState() bpName() or bpTrap() - bpEqKey "FOR" => + bpEqPeek "COLON" => + bpRestore a (bpSignature() or bpTrap()) and - bpPush ImportSignature(bpPop2(), bpPop1()) + (bpEqKey "FOR" or bpTrap()) and + (bpName() or bpTrap()) and + bpPush ImportSignature(bpPop1(), bpPop1()) bpPush Import bpPop1() false diff --git a/src/boot/strap/ast.clisp b/src/boot/strap/ast.clisp index 8f1b5b77..f5536c0c 100644 --- a/src/boot/strap/ast.clisp +++ b/src/boot/strap/ast.clisp @@ -2206,9 +2206,14 @@ (RETURN (COND ((NULL |t|) |t|) - ((SETQ |t'| (ASSOC (|coreSymbol| |t|) |$NativeTypeTable|)) - (CDR |t'|)) - ('T + ((SETQ |t'| + (CDR (ASSOC (|coreSymbol| |t|) |$NativeTypeTable|))) + (COND + ((AND (EQ |t| '|string|) (|%hasFeature| :SBCL)) + (LIST |t'| :EXTERNAL-FORMAT :ASCII :ELEMENT-TYPE + 'BASE-CHAR)) + (#0='T |t'|))) + (#0# (|fatalError| (CONCAT "unsupported native type: " (SYMBOL-NAME |t|)))))))) diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp index 9cd82f72..baea8792 100644 --- a/src/boot/strap/parser.clisp +++ b/src/boot/strap/parser.clisp @@ -483,16 +483,24 @@ ('T (|bpPush| (|%Module| (|bpPop1|) NIL))))))))) (DEFUN |bpImport| () - (COND - ((|bpEqKey| 'IMPORT) - (PROGN - (OR (|bpName|) (|bpTrap|)) - (COND - ((|bpEqKey| 'FOR) - (AND (OR (|bpSignature|) (|bpTrap|)) - (|bpPush| (|ImportSignature| (|bpPop2|) (|bpPop1|))))) - (#0='T (|bpPush| (|Import| (|bpPop1|))))))) - (#0# NIL))) + (PROG (|a|) + (RETURN + (COND + ((|bpEqKey| 'IMPORT) + (PROGN + (SETQ |a| (|bpState|)) + (OR (|bpName|) (|bpTrap|)) + (COND + ((|bpEqPeek| 'COLON) + (PROGN + (|bpRestore| |a|) + (AND (OR (|bpSignature|) (|bpTrap|)) + (OR (|bpEqKey| 'FOR) (|bpTrap|)) + (OR (|bpName|) (|bpTrap|)) + (|bpPush| + (|ImportSignature| (|bpPop1|) (|bpPop1|)))))) + (#0='T (|bpPush| (|Import| (|bpPop1|))))))) + (#0# NIL))))) (DEFUN |bpTypeAliasDefition| () (AND (OR (|bpTerm| #'|bpIdList|) (|bpTrap|)) (|bpEqKey| 'TDEF) diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp index 4d1f7fb2..c58a80a2 100644 --- a/src/boot/strap/translator.clisp +++ b/src/boot/strap/translator.clisp @@ -93,9 +93,23 @@ (DEFUN |AxiomCore|::|%sysInit| () (DECLARE (SPECIAL |$translatingOldBoot|)) - (COND - ((EQUAL (CDR (ASSOC (|Option| "boot") (|%systemOptions|))) "old") - (SETQ |$translatingOldBoot| T)))) + (PROGN + (SETQ *LOAD-VERBOSE* NIL) + (COND + ((OR (|%hasFeature| :GCL) (|%hasFeature| :ECL)) + (SETF (SYMBOL-VALUE + (|bfColonColon| 'COMPILER '*COMPILE-VERBOSE*)) + NIL) + (SETF (SYMBOL-VALUE + (|bfColonColon| 'COMPILER + 'SUPPRESS-COMPILER-WARNINGS*)) + NIL) + (SETF (SYMBOL-VALUE + (|bfColonColon| 'COMPILER 'SUPPRESS-COMPILER-NOTES*)) + T))) + (COND + ((EQUAL (CDR (ASSOC (|Option| "boot") (|%systemOptions|))) "old") + (SETQ |$translatingOldBoot| T))))) (DECLAIM (FTYPE (FUNCTION (|%Thing|) |%Thing|) |setCurrentPackage|)) diff --git a/src/interp/sys-os.boot b/src/interp/sys-os.boot index 95342e27..3d3ecc6d 100644 --- a/src/interp/sys-os.boot +++ b/src/interp/sys-os.boot @@ -46,105 +46,90 @@ module sys_-os loadSystemRuntimeCore() ++ change current working directory. -import changeDirectory for - oa__chdir: string -> int -- 0: success, -1: failure - +import oa__chdir: string -> int for changeDirectory + -- 0: success, -1: failure + ++ remove file or directory tree. -import removeFile for - oa__unlink: string -> int -- 0: sucess, -1: failure +import oa__unlink: string -> int for removeFile + -- 0: sucess, -1: failure ++ rename file or directory -import renameFile for - oa__rename: (string,string) -> int -- 0: success, -1 failure +import oa__rename: (string,string) -> int for renameFile + -- 0: success, -1 failure ++ create a directory -import mkdir for - oa__mkdir: string -> int -- 0: sucess, -1: failure. +import oa__mkdir: string -> int for mkdir + -- 0: sucess, -1: failure. -import readFromFileHandle for - oa__filedesc__read: (int,buffer,int) -> int -- -1: failure; otherwise - -- actual read bytes count +import oa__filedesc__read: (int,buffer,int) -> int for readFromFileHandle + -- -1: failure; otherwise + -- actual read bytes count -import writeToFileHandle for - oa__filedesc__write: (int,buffer,int) -> int -- -1: failure; otherwise - -- actual written bytes count +import oa__filedesc__write: (int,buffer,int) -> int for writeToFileHandle + -- -1: failure; otherwise + -- actual written bytes count -import closeFileHandle for - oa__filedesc__close: int -> int -- -1: failure; otherwise 0. +import oa__filedesc__close: int -> int for closeFileHandle + -- -1: failure; otherwise 0. -import getEnv for - oa__getenv: string -> string +import oa__getenv: string -> string for getEnv + --% Local IPC socket support -import openLocalClientStreamSocket for - oa__open__local__client__stream__socket: string -> int -- -1: failure +import oa__open__local__client__stream__socket: string -> int + for openLocalClientStreamSocket + -- -1: failure --% INET socket stream support -import openIP4ClientStreamSocket for - oa__open__ip4__client__stream__socket: (string,int) -> int +import oa__open__ip4__client__stream__socket: (string,int) -> int + for openIP4ClientStreamSocket -import readFromStreamSocket for - oa__socket__read: (int,string,int) -> int - -import writeToStreamSocket for - oa__socket__write: (int,string,int) -> int +import oa__socket__read: (int,string,int) -> int for readFromStreamSocket + +import oa__socket__write: (int,string,int) -> int for writeToStreamSocket -import closeSocket for - oa__close__socket: int -> int +import oa__close__socket: int -> int for closeSocket --% OpenAxiom subsystem socket support ++ socket interface -import openServer for - open__server: string -> int +import open__server: string -> int for openServer -import sockGetInt for - sock__get__int: int -> int +import sock__get__int: int -> int for sockGetInt -import sockSendInt for - sock__send__int: (int,int) -> int +import sock__send__int: (int,int) -> int for sockSendInt -import sockGetString for - sock__get__string: int -> string +import sock__get__string: int -> string for sockGetString -import doSendString for - sock__send__string__len: (int, string, int) -> int +import sock__send__string__len: (int, string, int) -> int + for doSendString sockSendString(type,str) == doSendString(type, str, LENGTH str) -import sockGetFloat for - sock__get__float: int -> double +import sock__get__float: int -> double for sockGetFloat -import sockSendFloat for - sock__send__float: (int,double) -> int +import sock__send__float: (int,double) -> int for sockSendFloat -import sockSendWakeup for - sock__send__wakeup: (int,int) -> int +import sock__send__wakeup: (int,int) -> int for sockSendWakeup -import serverSwitch for - server__switch: () -> int +import server__switch: () -> int for serverSwitch -import flushStdout for - flush__stdout: () -> int +import flush__stdout: () -> int for flushStdout -import sockSendSignal for - sock__send__signal: (int,int) -> int +import sock__send__signal: (int,int) -> int for sockSendSignal -import printLine for - print__line: string -> int +import print__line: string -> int for printLine --% -import directoryp for - directoryp: string -> int +import directoryp: string -> int for directoryp + -import writeablep for - writeablep: string -> int +import writeablep: string -> int for writeablep -import runCommand for - oa__system: string -> int +import oa__system: string -> int for runCommand ++ run a program with specified arguments runProgram(prog,args) == @@ -161,14 +146,11 @@ runProgram(prog,args) == ++ numeric limits )if %hasFeature KEYWORD::GCL -import plusInfinity for - plus__infinity: () -> double +import plus__infinity: () -> double for plusInfinity -import minusInfinity for - minus__infinity: () -> double +import minus__infinity: () -> double for minusInfinity -import NaNQ for - NANQ: () -> double +import NANQ: () -> double for NaNQ $plusInfinity := plusInfinity() $minusInfinity := minusInfinity() @@ -197,6 +179,6 @@ minusInfinity() == ++ stdStreamIsTerminal: ++ returns 1 if the standard stream is attached to a terminal; ++ otherwise 0. -import stdStreamIsTerminal for std__stream__is__terminal: int -> int +import std__stream__is__terminal: int -> int for stdStreamIsTerminal --% |