aboutsummaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-05-06 15:23:36 +0000
committerdos-reis <gdr@axiomatics.org>2010-05-06 15:23:36 +0000
commit62fb1ed88e7c6a94e1ba833a2078cc162e1a44f9 (patch)
treec78458eff7f895c11fc5e714e579ffd152eb5786 /src/boot
parent1747742ca654ed7b8907a3622a3e5dffeff9931e (diff)
downloadopen-axiom-62fb1ed88e7c6a94e1ba833a2078cc162e1a44f9.tar.gz
* interp/wi2.boot: Replace INTEGERP, STRINGP, SYMBOLP, CONSP with
integer?, string?, symbol?, and cons? respectively. * interp/wi1.boot: Likewise. * interp/trace.boot: Likewise. * interp/sys-utility.boot: Likewise. * interp/showimp.boot: Likewise. * interp/setvars.boot: Likewise. * interp/record.boot: Likewise. * interp/pspad2.boot: Likewise. * interp/pspad1.boot: Likewise. * interp/postpar.boot: Likewise. * interp/posit.boot: Likewise. * interp/pf2sex.boot: Likewise. * interp/pf2atree.boot: Likewise. * interp/parse.boot: Likewise. * interp/packtran.boot: Likewise. * interp/nrunopt.boot: Likewise. * interp/nrungo.boot: Likewise. * interp/nrunfast.boot: Likewise. * interp/nruncomp.boot: Likewise. * interp/newfort.boot: Likewise. * interp/msgdb.boot: Likewise. * interp/msg.boot: Likewise. * interp/modemap.boot: Likewise. * interp/match.boot: Likewise. * interp/mark.boot: Likewise. * interp/interop.boot: Likewise. * interp/int-top.boot: Likewise. * interp/i-toplev.boot: Likewise. * interp/i-syscmd.boot: Likewise. * interp/i-spec2.boot: Likewise. * interp/i-spec1.boot: Likewise. * interp/i-resolv.boot: Likewise. * interp/i-output.boot: Likewise. * interp/i-object.boot: Likewise. * interp/i-map.boot: Likewise. * interp/i-intern.boot: Likewise. * interp/i-funsel.boot: Likewise. * interp/i-eval.boot: Likewise. * interp/i-coerfn.boot: Likewise. * interp/i-coerce.boot: Likewise. * interp/i-analy.boot: Likewise. * interp/htsetvar.boot: Likewise. * interp/htcheck.boot: Likewise. * interp/ht-util.boot: Likewise. * interp/ht-root.boot: Likewise. * interp/g-util.boot: Likewise. * interp/g-opt.boot: Likewise. * interp/g-error.boot: Likewise. * interp/g-boot.boot: Likewise. * interp/functor.boot: Likewise. * interp/fortcall.boot: Likewise. * interp/format.boot: Likewise. * interp/diagnostics.boot: Likewise. * interp/define.boot: Likewise. * interp/compress.boot: Likewise. * interp/compiler.boot: Likewise. * interp/clammed.boot: Likewise. * interp/clam.boot: Likewise. * interp/cformat.boot: Likewise. * interp/cattable.boot: Likewise. * interp/category.boot: Likewise. * interp/c-util.boot: Likewise. * interp/c-doc.boot: Likewise. * interp/buildom.boot: Likewise. * interp/br-util.boot: Likewise. * interp/br-search.boot: Likewise. * interp/br-saturn.boot: Likewise. * interp/br-op2.boot: Likewise. * interp/br-op1.boot: Likewise. * interp/br-data.boot: Likewise. * interp/br-con.boot: Likewise. * interp/bc-util.boot: Likewise. * interp/ax.boot: Likewise. * interp/as.boot: Likewise. * boot/translator.boot: Likewise. * boot/ast.boot: Likewise. * boot/includer.boot: Likewise. * boot/tokens.boot: Add new replacement for integer?, string?, symbol? and cons?
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/ast.boot36
-rw-r--r--src/boot/includer.boot4
-rw-r--r--src/boot/strap/tokens.clisp12
-rw-r--r--src/boot/tokens.boot6
-rw-r--r--src/boot/translator.boot2
5 files changed, 34 insertions, 26 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot
index 6f3e701f..04a2888b 100644
--- a/src/boot/ast.boot
+++ b/src/boot/ast.boot
@@ -159,7 +159,7 @@ bfColonColon(package, name) ==
bfSymbol: %Thing -> %Thing
bfSymbol x==
- STRINGP x=> x
+ string? x=> x
['QUOTE,x]
@@ -279,7 +279,7 @@ bfSTEP(id,fst,step,lst)==
g2
ex :=
null lst=> []
- INTEGERP inc =>
+ integer? inc =>
pred :=
MINUSP inc => "<"
">"
@@ -541,18 +541,18 @@ bfLET2(lhs,rhs) ==
a := bfLET2(a,rhs)
null (b := bfLET2(b,rhs)) => a
atom b => [a,b]
- CONSP first b => CONS(a,b)
+ cons? first b => CONS(a,b)
[a,b]
lhs is ['CONS,var1,var2] =>
var1 = "DOT" or var1 is ["QUOTE",:.] =>
bfLET2(var2,addCARorCDR('CDR,rhs))
l1 := bfLET2(var1,addCARorCDR('CAR,rhs))
null var2 or var2 = "DOT" =>l1
- if CONSP l1 and atom first l1 then l1 := cons(l1,nil)
+ if cons? l1 and atom first l1 then l1 := cons(l1,nil)
IDENTP var2 =>
[:l1,bfLetForm(var2,addCARorCDR('CDR,rhs))]
l2 := bfLET2(var2,addCARorCDR('CDR,rhs))
- if CONSP l2 and atom first l2 then l2 := cons(l2,nil)
+ if cons? l2 and atom first l2 then l2 := cons(l2,nil)
APPEND(l1,l2)
lhs is ['APPEND,var1,var2] =>
patrev := bfISReverse(var2,var1)
@@ -560,7 +560,7 @@ bfLET2(lhs,rhs) ==
g := INTERN CONCAT('"LETTMP#", STRINGIMAGE $letGenVarCounter)
$letGenVarCounter := $letGenVarCounter + 1
l2 := bfLET2(patrev,g)
- if CONSP l2 and atom first l2 then l2 := cons(l2,nil)
+ if cons? l2 and atom first l2 then l2 := cons(l2,nil)
var1 = "DOT" => [['L%T,g,rev],:l2]
last l2 is ['L%T, =var1, val1] =>
[['L%T,g,rev],:REVERSE rest REVERSE l2,
@@ -585,7 +585,7 @@ bfLET(lhs,rhs) ==
bfLET1(lhs,rhs)
addCARorCDR(acc,expr) ==
- NULL CONSP expr => [acc,expr]
+ NULL cons? expr => [acc,expr]
acc = 'CAR and expr is ["REVERSE",:.] =>
["CAR",["LAST",:rest expr]]
-- cons('last,rest expr)
@@ -629,7 +629,7 @@ bfISReverse(x,a) ==
bfIS1(lhs,rhs) ==
null rhs => ['NULL,lhs]
- STRINGP rhs => ['EQ,lhs,['QUOTE,INTERN rhs]]
+ string? rhs => ['EQ,lhs,['QUOTE,INTERN rhs]]
NUMBERP rhs => ["EQUAL",lhs,rhs]
atom rhs => ['PROGN,bfLetForm(rhs,lhs),'T]
rhs is ['QUOTE,a] =>
@@ -639,7 +639,7 @@ bfIS1(lhs,rhs) ==
l := bfLET(c,lhs)
bfAND [bfIS1(lhs,d),bfMKPROGN [l,'T]]
rhs is ["EQUAL",a] => bfQ(lhs,a)
- CONSP lhs =>
+ cons? lhs =>
g := INTERN CONCAT('"ISTMP#",STRINGIMAGE $isGenVarCounter)
$isGenVarCounter := $isGenVarCounter + 1
bfMKPROGN [['L%T,g,lhs],bfIS1(g,rhs)]
@@ -661,7 +661,7 @@ bfIS1(lhs,rhs) ==
$isGenVarCounter := $isGenVarCounter + 1
rev := bfAND [['CONSP,lhs],['PROGN,['L%T,g,['REVERSE,lhs]],'T]]
l2 := bfIS1(g,patrev)
- if CONSP l2 and atom first l2 then l2 := cons(l2,nil)
+ if cons? l2 and atom first l2 then l2 := cons(l2,nil)
a = "DOT" => bfAND [rev,:l2]
bfAND [rev,:l2,['PROGN,bfLetForm(a,['NREVERSE,a]),'T]]
bpSpecificErrorHere '"bad IS code is generated"
@@ -685,9 +685,9 @@ bfReName x==
++ Generate code for a membership test `x in seq' where `seq'
++ is a sequence (e.g. a list)
bfMember(var,seq) ==
- seq is ["QUOTE",seq'] and "and"/[SYMBOLP x for x in seq'] =>
+ seq is ["QUOTE",seq'] and "and"/[symbol? x for x in seq'] =>
["MEMQ",var,seq]
- var is ["QUOTE",var'] and SYMBOLP var' =>
+ var is ["QUOTE",var'] and symbol? var' =>
["MEMQ",var,seq]
var is ["char",.] => ["MEMBER",var,seq,KEYWORD::TEST,"EQL"]
["MEMBER",var,seq]
@@ -728,7 +728,7 @@ defQuoteId x==
x is ["QUOTE",:.] and IDENTP second x
bfSmintable x==
- INTEGERP x or CONSP x and first x in '(SIZE LENGTH char)
+ integer? x or cons? x and first x in '(SIZE LENGTH char)
bfQ(l,r)==
bfSmintable l or bfSmintable r => ["EQL",l,r]
@@ -949,16 +949,16 @@ bfSetelt(e,l,r)==
bfSetelt(bfElt(e,first l),rest l,r)
bfElt(expr,sel)==
- y:=SYMBOLP sel and sel has SHOESELFUNCTION
+ y:=symbol? sel and sel has SHOESELFUNCTION
y =>
- INTEGERP y => ["ELT",expr,y]
+ integer? y => ["ELT",expr,y]
[y,expr]
["ELT",expr,sel]
defSETELT(var,sel,expr)==
- y := SYMBOLP sel and sel has SHOESELFUNCTION
+ y := symbol? sel and sel has SHOESELFUNCTION
y =>
- INTEGERP y => ["SETF",["ELT",var,y],expr]
+ integer? y => ["SETF",["ELT",var,y],expr]
["SETF",[y,var],expr]
["SETF",["ELT",var,sel],expr]
@@ -1626,7 +1626,7 @@ genCLOZUREnativeTranslation(op,s,t,op') ==
genImportDeclaration(op, sig) ==
sig isnt ["%Signature", op', m] => coreError '"invalid signature"
m isnt ["%Mapping", t, s] => coreError '"invalid function type"
- if not null s and SYMBOLP s then s := [s]
+ if not null s and symbol? s then s := [s]
%hasFeature KEYWORD::GCL => genGCLnativeTranslation(op,s,t,op')
%hasFeature KEYWORD::SBCL => genSBCLnativeTranslation(op,s,t,op')
diff --git a/src/boot/includer.boot b/src/boot/includer.boot
index b7ee1dd7..a2d10d25 100644
--- a/src/boot/includer.boot
+++ b/src/boot/includer.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2009, Gabriel Dos Reis.
+-- Copyright (C) 2007-2010, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -69,7 +69,7 @@ module includer
-- returns a printable representation of X, when it is a symbol
-- or a character, as string. Otherwise, returns nil.
PNAME x ==
- SYMBOLP x => SYMBOL_-NAME x
+ symbol? x => SYMBOL_-NAME x
CHARACTERP x => STRING x
nil
diff --git a/src/boot/strap/tokens.clisp b/src/boot/strap/tokens.clisp
index 518c43ef..21e9f7a0 100644
--- a/src/boot/strap/tokens.clisp
+++ b/src/boot/strap/tokens.clisp
@@ -202,12 +202,14 @@
(LET ((|bfVar#9| (LIST (LIST '|and| 'AND) (LIST '|append| 'APPEND)
(LIST '|apply| 'APPLY) (LIST '|atom| 'ATOM)
(LIST '|car| 'CAR) (LIST '|cdr| 'CDR)
- (LIST '|cons| 'CONS) (LIST '|copy| 'COPY)
- (LIST '|croak| 'CROAK) (LIST '|drop| 'DROP)
- (LIST '|exit| 'EXIT) (LIST '|false| 'NIL)
- (LIST '|first| 'CAR) (LIST '|fourth| 'CADDDR)
+ (LIST '|cons| 'CONS) (LIST '|cons?| 'CONSP)
+ (LIST '|copy| 'COPY) (LIST '|croak| 'CROAK)
+ (LIST '|drop| 'DROP) (LIST '|exit| 'EXIT)
+ (LIST '|false| 'NIL) (LIST '|first| 'CAR)
+ (LIST '|fourth| 'CADDDR)
(LIST '|function| 'FUNCTION)
(LIST '|genvar| 'GENVAR)
+ (LIST '|integer?| 'INTEGERP)
(LIST '|lastNode| 'LAST) (LIST 'LAST '|last|)
(LIST '|list| 'LIST) (LIST '|mkpf| 'MKPF)
(LIST '|nconc| 'NCONC) (LIST '|nil| NIL)
@@ -223,7 +225,9 @@
(LIST '|setPart| 'SETELT)
(LIST '|setUnion| 'UNION)
(LIST '|strconc| 'CONCAT)
+ (LIST '|string?| 'STRINGP)
(LIST '|substitute| 'SUBST)
+ (LIST '|symbol?| 'SYMBOLP)
(LIST '|take| 'TAKE) (LIST '|third| 'CADDR)
(LIST '|true| 'T) (LIST 'PLUS '+)
(LIST 'MINUS '-) (LIST 'TIMES '*)
diff --git a/src/boot/tokens.boot b/src/boot/tokens.boot
index ef860684..38310ce0 100644
--- a/src/boot/tokens.boot
+++ b/src/boot/tokens.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2009, Gabriel Dos Reis.
+-- Copyright (C) 2007-2010, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -240,6 +240,7 @@ for i in [ _
["car", "CAR"] , _
["cdr", "CDR"] , _
["cons", "CONS"] , _
+ ["cons?", "CONSP"] , _
["copy", "COPY"] , _
["croak", "CROAK"] , _
["drop", "DROP"] , _
@@ -249,6 +250,7 @@ for i in [ _
["fourth", "CADDDR"] , _
["function","FUNCTION"] , _
["genvar", "GENVAR"] , _
+ ["integer?","INTEGERP"] , _
["lastNode", "LAST"] , _
["LAST", "last"] , _
["list", "LIST"] , _
@@ -270,7 +272,9 @@ for i in [ _
["setPart", "SETELT"] , _
["setUnion", "UNION"] , _
["strconc", "CONCAT"] , _
+ ["string?", "STRINGP"] ,_
["substitute", "SUBST"] , _
+ ["symbol?", "SYMBOLP"] , _
["take", "TAKE"] ,
["third", "CADDR"] , _
["true", "T"] , _
diff --git a/src/boot/translator.boot b/src/boot/translator.boot
index c23debbd..c49c8209 100644
--- a/src/boot/translator.boot
+++ b/src/boot/translator.boot
@@ -377,7 +377,7 @@ shoeOutParse stream ==
genDeclaration(n,t) ==
t is ["%Mapping",valType,argTypes] =>
if bfTupleP argTypes then argTypes := rest argTypes
- if not null argTypes and SYMBOLP argTypes
+ if not null argTypes and symbol? argTypes
then argTypes := [argTypes]
["DECLAIM",["FTYPE",["FUNCTION",argTypes,valType],n]]
["DECLAIM",["TYPE",t,n]]