aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-02-07 22:10:17 +0000
committerdos-reis <gdr@axiomatics.org>2009-02-07 22:10:17 +0000
commit2fbcd8bc4f97cc3e534e11414f5a12dbc08edf2d (patch)
tree25f9002df4057d8e967d22c6f66a2d84378b3bcd /src/interp
parent85f1c4d3dc7dc34ae4436d3ef0ffe0b6c6039b5a (diff)
downloadopen-axiom-2fbcd8bc4f97cc3e534e11414f5a12dbc08edf2d.tar.gz
* algebra/system.spad.pamphlet (hostByteOrder$System): New.
* algebra/data.spad.pamphlet (ByteOrder): New. * algebra/Makefile.pamphlet (axiom_algebra_layer_1): Include BYTEORD.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/Makefile.in2
-rw-r--r--src/interp/nrunfast.boot25
-rw-r--r--src/interp/sys-os.boot9
-rw-r--r--src/interp/sys-utility.boot11
4 files changed, 30 insertions, 17 deletions
diff --git a/src/interp/Makefile.in b/src/interp/Makefile.in
index 55cea06a..5ac93c59 100644
--- a/src/interp/Makefile.in
+++ b/src/interp/Makefile.in
@@ -135,7 +135,7 @@ YEARWEEK=(progn (defconstant timestamp "${TIMESTAMP}") \
.PRECIOUS: ${AXIOMSYS}
UNUSED= ${DOC}/construc.lisp.dvi \
- ${DOC}/domain.lisp.dvi ${DOC}/guess.boot.dvi \
+ ${DOC}/guess.boot.dvi \
${DOC}/interp-fix.boot.dvi \
${DOC}/nhyper.boot.dvi ${DOC}/pf2atree.boot.dvi \
${DOC}/redefs.boot.dvi ${DOC}/word.boot.dvi
diff --git a/src/interp/nrunfast.boot b/src/interp/nrunfast.boot
index 5ac53649..e7dc7a19 100644
--- a/src/interp/nrunfast.boot
+++ b/src/interp/nrunfast.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
@@ -57,9 +57,11 @@ initNewWorld() ==
$updateCatTableIfTrue := false
$doNotCompressHashTableIfTrue := true
-isNewWorldDomain domain == INTEGERP domain.3 --see HasCategory/Attribute
+isNewWorldDomain domain ==
+ INTEGERP domain.3 --see HasCategory/Attribute
-getDomainByteVector dom == CDDR dom.4
+getDomainByteVector dom ==
+ CDDR dom.4
getOpCode(op,vec,max) ==
--search Op vector for "op" returning code if found, nil otherwise
@@ -106,7 +108,6 @@ newGoGet(:l) ==
slot := replaceGoGetSlot env
APPLY(first slot,[:arglist,rest slot]) --SPADCALL it!
---------------------> NEW DEFINITION (see interop.boot.pamphlet)
replaceGoGetSlot env ==
[thisDomain,index,:op] := env
thisDomainForm := devaluate thisDomain
@@ -142,15 +143,12 @@ replaceGoGetSlot env ==
--=======================================================
-- Lookup Function in Slot 1 (via SPADCALL)
--=======================================================
-lookupFF(op,sig,dollar,env) == newLookupInTable(op,sig,dollar,env,nil)
-
-lookupUF(op,sig,dollar,env) == newLookupInTable(op,sig,dollar,env,true)
-
---------------------> NEW DEFINITION (see interop.boot.pamphlet)
-lookupComplete(op,sig,dollar,env) == newLookupInTable(op,sig,dollar,env,nil)
+
+lookupComplete(op,sig,dollar,env) ==
+ newLookupInTable(op,sig,dollar,env,nil)
---------------------> NEW DEFINITION (see interop.boot.pamphlet)
-lookupIncomplete(op,sig,dollar,env) == newLookupInTable(op,sig,dollar,env,true)
+lookupIncomplete(op,sig,dollar,env) ==
+ newLookupInTable(op,sig,dollar,env,true)
newLookupInTable(op,sig,dollar,[domain,opvec],flag) ==
dollar = nil => systemError()
@@ -420,7 +418,6 @@ newCompareSig(sig, numvec, index, dollar, domain) ==
--=======================================================
lazyMatchArg(s,a,dollar,domain) == lazyMatchArg2(s,a,dollar,domain,true)
---------------------> NEW DEFINITION (see interop.boot.pamphlet)
lazyMatchArg2(s,a,dollar,domain,typeFlag) ==
if s = '$ then
-- a = 0 => return true --needed only if extra call in newGoGet to basicLookup
@@ -525,7 +522,6 @@ newExpandTypeSlot(slot, dollar, domain) ==
newExpandLocalType(sigDomainVal(dollar, domain, slot), dollar,domain)
---------------------> NEW DEFINITION (see interop.boot.pamphlet)
newExpandLocalType(lazyt,dollar,domain) ==
VECP lazyt => lazyt.0
ATOM lazyt => lazyt
@@ -577,7 +573,6 @@ sigDomainVal(dollar,domain,index) ==
-- Convert Lazy Domain to Domain Form
--=======================================================
---------------------> NEW DEFINITION (see interop.boot.pamphlet)
lazyDomainSet(lazyForm,thisDomain,slot) ==
form :=
lazyForm is [vec,.,:u] and VECP vec => u --old style
diff --git a/src/interp/sys-os.boot b/src/interp/sys-os.boot
index 2e9bf84b..f844fba7 100644
--- a/src/interp/sys-os.boot
+++ b/src/interp/sys-os.boot
@@ -234,4 +234,11 @@ minusInfinity() ==
++ otherwise 0.
import std__stream__is__terminal: int -> int for stdStreamIsTerminal
---%
+--% Data layout
+
+++ getHostByteOrder:
+++ returns the byte order of the host machine.
+++ 0: unknown
+++ 1: little endian
+++ 2: big endian
+import oa__get__host__byteorder: () -> int for getHostByteOrder
diff --git a/src/interp/sys-utility.boot b/src/interp/sys-utility.boot
index 2d334946..31781fae 100644
--- a/src/interp/sys-utility.boot
+++ b/src/interp/sys-utility.boot
@@ -47,6 +47,17 @@ $COMBLOCKLIST := nil
%nothing == KEYWORD::%OpenAxiomNoValue
+++ Constants describing byte order
+%littleEndian == KEYWORD::%littleEndian
+%bigEndian == KEYWORD::%bigEndian
+%unknownEndian == KEYWORD::%unknownEndian
+
+++ The byte order of the host machine running OpenAxiom.
+%hostByteOrder ==
+ getHostByteOrder() = 1 => %littleEndian
+ getHostByteOrder() = 2 => %bigEndian
+ %unknownEndian
+
--%
++ getVMType returns an approximation of the underlying object type