aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-05-09 15:57:28 +0000
committerdos-reis <gdr@axiomatics.org>2010-05-09 15:57:28 +0000
commitb248654cba0d6c5ae213882837140358f92bab1c (patch)
treeb11ab78c2648334dcc1c9bbe63e82f6878ed27f4
parentaa827b23f713e6568dde0c7c9fecf67d2ee2e7fd (diff)
downloadopen-axiom-b248654cba0d6c5ae213882837140358f92bab1c.tar.gz
* boot/tokens.boot: Don't rename 'cons'.
* interp/msg.boot: Remove uses of cons. * interp/postpar.boot: Likewise. * interp/types.boot: Likewise.
-rw-r--r--STYLES15
-rw-r--r--src/ChangeLog9
-rw-r--r--src/boot/strap/parser.clisp31
-rw-r--r--src/boot/strap/tokens.clisp9
-rw-r--r--src/boot/strap/translator.clisp2
-rw-r--r--src/boot/tokens.boot1
-rw-r--r--src/interp/incl.boot2
-rw-r--r--src/interp/msg.boot2
-rw-r--r--src/interp/postpar.boot4
-rw-r--r--src/interp/types.boot6
10 files changed, 51 insertions, 30 deletions
diff --git a/STYLES b/STYLES
index 49756f93..0d9c15d9 100644
--- a/STYLES
+++ b/STYLES
@@ -1,13 +1,13 @@
Styles for Boot Codes
---------------------
- The core of the OpenAxiom system is mostly written Boot. A long
+ The core of the OpenAxiom system is mostly written in Boot. A long
time ago, Boot was essentially a Lisp DSL with a much more palatable
-syntax geared specifically for writing readable codes. As such it
+syntax geared specifically toward writing readable codes. As such it
tended to have lots of Lispism in it.
There days, Boot is no longer `just a syntactic sugar over Lisp',
-even currently, we essentially translate to Lisp. Boot is a
+even when we essentially translate to Lisp. Boot is a
programming language in of its own. In fact, we would like to remove
Lispism from Boot codes. The `rules' below are suggestions (or
guidelines) for writing `good Boot codes'.
@@ -31,9 +31,11 @@ guidelines) for writing `good Boot codes'.
-- GOOD --
first form in '(Mapping Record) => -- ...
+ form.first := '%LET
-- BAD --
CAR form in '(Mapping Record) => -- ...
+ RPLACA(form,'%LET)
* Don't use `null' to test for Boolean values, use `not'
@@ -45,4 +47,11 @@ guidelines) for writing `good Boot codes'.
-- BAD --
null $monitorNewworld => ...
+* Use idiomatic Boot constructs
+ Example:
+ -- GOOD --
+ vars := [var,:vars]
+
+ -- BAD --
+ vars := CONS(var,vars)
diff --git a/src/ChangeLog b/src/ChangeLog
index 937d284a..09ee6ec7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,11 @@
-2010-05-09 Gabriel Dos Reis <gdr@cse.tamu.edu>
+2010-05-09 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * boot/tokens.boot: Don't rename 'cons'.
+ * interp/msg.boot: Remove uses of cons.
+ * interp/postpar.boot: Likewise.
+ * interp/types.boot: Likewise.
+
+2010-05-09 Gabriel Dos Reis <gdr@cs.tamu.edu>
* boot/ast.boot: Miscellaneous cleanup.
* boot/includer.boot: Likewise.
diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp
index a63057f2..8498e086 100644
--- a/src/boot/strap/parser.clisp
+++ b/src/boot/strap/parser.clisp
@@ -568,8 +568,16 @@
(|bpPush| NIL)))
(DEFUN |bpPrimary1| ()
- (OR (|bpName|) (|bpDot|) (|bpConstTok|) (|bpConstruct|) (|bpCase|)
- (|bpStruct|) (|bpPDefinition|) (|bpBPileDefinition|)))
+ (OR (|bpParenthesizedApplication|) (|bpDot|) (|bpConstTok|)
+ (|bpConstruct|) (|bpCase|) (|bpStruct|) (|bpPDefinition|)
+ (|bpBPileDefinition|)))
+
+(DEFUN |bpParenthesizedApplication| ()
+ (AND (|bpName|) (|bpAnyNo| #'|bpArgumentList|)))
+
+(DEFUN |bpArgumentList| ()
+ (AND (|bpPDefinition|)
+ (|bpPush| (|bfApplication| (|bpPop2|) (|bpPop1|)))))
(DEFUN |bpPrimary| ()
(AND (|bpFirstTok|) (OR (|bpPrimary1|) (|bpPrefixOperator|))))
@@ -592,8 +600,6 @@
(|bpPush| (|bfElt| (|bpPop2|) (|bpPop1|))))
(|bpPush| (|bfSuffixDot| (|bpPop1|))))))
-(DEFUN |bpOperator| () (AND (|bpPrimary|) (|bpAnyNo| #'|bpSelector|)))
-
(DEFUN |bpApplication| ()
(AND (|bpPrimary|) (|bpAnyNo| #'|bpSelector|)
(OR (AND (|bpApplication|)
@@ -1080,13 +1086,16 @@
(OR (|bpBracketConstruct| #'|bpPatternL|) (|bpAssignLHS|)))
(DEFUN |bpAssignLHS| ()
- (AND (|bpName|)
- (OR (AND (|bpEqKey| 'COLON) (OR (|bpApplication|) (|bpTrap|))
- (|bpPush| (|bfLocal| (|bpPop2|) (|bpPop1|))))
- (AND (|bpEqKey| 'DOT) (|bpList| #'|bpPrimary| 'DOT)
- (|bpChecknull|)
- (|bpPush| (|bfTuple| (CONS (|bpPop2|) (|bpPop1|)))))
- T)))
+ (COND
+ ((NOT (|bpName|)) NIL)
+ ((|bpEqKey| 'COLON) (OR (|bpApplication|) (|bpTrap|))
+ (|bpPush| (|bfLocal| (|bpPop2|) (|bpPop1|))))
+ (T (AND (|bpArgumentList|) (OR (|bpEqPeek| 'DOT) (|bpTrap|)))
+ (COND
+ ((|bpEqKey| 'DOT)
+ (AND (|bpList| #'|bpPrimary| 'DOT) (|bpChecknull|)
+ (|bpPush| (|bfTuple| (CONS (|bpPop2|) (|bpPop1|))))))
+ (T T)))))
(DEFUN |bpChecknull| ()
(PROG (|a|)
diff --git a/src/boot/strap/tokens.clisp b/src/boot/strap/tokens.clisp
index f2853636..c288dd05 100644
--- a/src/boot/strap/tokens.clisp
+++ b/src/boot/strap/tokens.clisp
@@ -202,11 +202,10 @@
(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 '|cons?| 'CONSP)
- (LIST '|copy| 'COPY) (LIST '|croak| 'CROAK)
- (LIST '|drop| 'DROP) (LIST '|exit| 'EXIT)
- (LIST '|false| 'NIL) (LIST '|first| 'CAR)
- (LIST '|fourth| 'CADDDR)
+ (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)
diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp
index bb7c66d3..06af9992 100644
--- a/src/boot/strap/translator.clisp
+++ b/src/boot/strap/translator.clisp
@@ -1282,8 +1282,6 @@
((MEMBER (|Option| '|no|) |$FilesToRetain|) NIL)
(T (MEMBER (|Option| |ext|) |$FilesToRetain|))))
-(EVAL-WHEN (:EXECUTE :LOAD-TOPLEVEL) (TRACE |retainFile?|))
-
(DEFUN |compileBootHandler| (|progname| |options| |file|)
(PROG (|objFile| |intFile|)
(RETURN
diff --git a/src/boot/tokens.boot b/src/boot/tokens.boot
index 9d4f6274..d40e7f80 100644
--- a/src/boot/tokens.boot
+++ b/src/boot/tokens.boot
@@ -239,7 +239,6 @@ for i in [ _
["atom", "ATOM"] , _
["car", "CAR"] , _
["cdr", "CDR"] , _
- ["cons", "CONS"] , _
["cons?", "CONSP"] , _
["copy", "COPY"] , _
["croak", "CROAK"] , _
diff --git a/src/interp/incl.boot b/src/interp/incl.boot
index ebd71c2e..33bce836 100644
--- a/src/interp/incl.boot
+++ b/src/interp/incl.boot
@@ -327,7 +327,7 @@ incLude1 (:z) ==
Tail :=
[xlConStill (eb, str, lno,ufos,n),:Tail]
- Head := cons (xlConsole(eb, str, lno,ufos), Head)
+ Head := [xlConsole(eb, str, lno,ufos),:Head]
[xlOK(eb,str,lno,ufos.0),:incAppend(Head,Tail)]
info.2 = '"fin" =>
diff --git a/src/interp/msg.boot b/src/interp/msg.boot
index a13df0c7..74b97dc2 100644
--- a/src/interp/msg.boot
+++ b/src/interp/msg.boot
@@ -120,7 +120,7 @@ processKeyedError msg ==
CallerName 4,:erMsg] --temp
msgImPr? msg =>
msgOutputter msg
- $ncMsgList := cons (msg, $ncMsgList)
+ $ncMsgList := [msg,:$ncMsgList]
---------------------------------
--%getting info from db.
diff --git a/src/interp/postpar.boot b/src/interp/postpar.boot
index 311f1117..fc7ac484 100644
--- a/src/interp/postpar.boot
+++ b/src/interp/postpar.boot
@@ -39,11 +39,11 @@ module postpar
++ The type of parse trees.
%ParseTree <=>
- %Number or %Symbol or %String or cons
+ %Number or %Symbol or %String or %Pair
++ The result of processing a parse tree.
%ParseForm <=>
- %Number or %Symbol or %String or cons
+ %Number or %Symbol or %String or %Pair
$postStack := []
diff --git a/src/interp/types.boot b/src/interp/types.boot
index a9f67800..37c1d8e5 100644
--- a/src/interp/types.boot
+++ b/src/interp/types.boot
@@ -119,13 +119,13 @@ namespace BOOT
%Sequence <=> SEQUENCE
-%Pair <=> cons
+%Pair <=> CONS
%Maybe a <=> null or a
--% Data structures for the compiler
%Constructor <=> %Symbol -- constructor
-%Form <=> %Number or %Symbol or %String or cons -- input syntax form
+%Form <=> %Number or %Symbol or %String or %Pair -- input syntax form
%Instantiation <=> [%Constructor,:%Form] -- constructor instance
%Env <=> %List -- compiling env
%Mode <=> %Symbol or %String or %List -- type of forms
@@ -134,7 +134,7 @@ namespace BOOT
[%Code,:[%Mode,:[%Env,:null]]]
%Signature -- signature
- <=> %Symbol or cons
+ <=> %Symbol or %Pair
%Modemap <=> %List -- modemap