aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/syntax.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-12-26 00:48:34 +0000
committerdos-reis <gdr@axiomatics.org>2008-12-26 00:48:34 +0000
commitfb209a840dc764bdfa285ad3cb7575df21a43289 (patch)
tree22c5f97139814096d211f26b4daa059b0d85d10b /src/algebra/syntax.spad.pamphlet
parenta4c3f01ad687e6b8a29db845f725c00b06016f36 (diff)
downloadopen-axiom-fb209a840dc764bdfa285ad3cb7575df21a43289.tar.gz
r12485@gauss: gdr | 2008-12-17 16:26:21 -0600
Branch to improve reflection. r12493@gauss: gdr | 2008-12-20 23:29:51 -0600 Add domain representations for constructors. r12494@gauss: gdr | 2008-12-21 14:27:37 -0600 Consolidate constructor domains. r12502@gauss: gdr | 2008-12-22 20:36:21 -0600 Constructors are values. r12504@gauss: gdr | 2008-12-25 13:58:01 -0600 r12505@gauss: gdr | 2008-12-25 18:48:04 -0600 Commit ChangeLog.
Diffstat (limited to 'src/algebra/syntax.spad.pamphlet')
-rw-r--r--src/algebra/syntax.spad.pamphlet93
1 files changed, 14 insertions, 79 deletions
diff --git a/src/algebra/syntax.spad.pamphlet b/src/algebra/syntax.spad.pamphlet
index ca967397..382a9227 100644
--- a/src/algebra/syntax.spad.pamphlet
+++ b/src/algebra/syntax.spad.pamphlet
@@ -40,7 +40,7 @@ import SExpression
Syntax(): Public == Private where
Public == Join(UnionType, SetCategory, RetractableTo Integer,
RetractableTo DoubleFloat, RetractableTo Symbol,
- RetractableTo String) with
+ RetractableTo String, CoercibleTo InputForm) with
convert: % -> SExpression
++ convert(s) returns the s-expression representation of a syntax.
@@ -218,80 +218,12 @@ Syntax(): Public == Private where
getOperands x ==
atom? x => []
CDR(x)$Lisp
-@
-
-
-\section{domain ConstructorCall}
-
-<<domain CTORCALL ConstructorCall>>=
-import SetCategory
-import Symbol
-import List Syntax
-)abbrev domain CTORCALL ConstructorCall
-++ Author: Gabriel Dos Reis
-++ Date Created: January 19, 2008
-++ Date Last Updated: July 03, 2008
-++ Description: This domains represents a syntax object that
-++ designates a category, domain, or a package.
-++ See Also: Syntax, Domain
-ConstructorCall(): Public == Private where
- Public == SetCategory with
- constructorName: % -> Symbol
- ++ constructorName c returns the name of the constructor
- arguments: % -> List Syntax
- ++ arguments returns the list of syntax objects for the
- ++ arguments used to invoke the constructor.
-
- Private == add
- Rep == List Syntax
-
- constructorName x ==
- (first rep x)::Symbol
- arguments x ==
- rest rep x
-
- x = y ==
- rep x = rep y
-
- coerce x ==
- outputDomainConstructor(x)$Lisp
+ coerce(x: %): InputForm ==
+ x : InputForm
@
-\section{The Signature domain}
-<<domain SIG Signature>>=
-import SetCategory
-import CoercibleTo
-import List
-import Syntax
-)abbrev domain SIG Signature
-++ Author: Gabriel Dos Reis
-++ Date Created: January 10, 2008
-++ Date Last Updated: August 30, 2008
-++ Description: This is the datatype for operation signatures as
-++ used by the compiler and the interpreter. Note that this domain
-++ differs from SignatureAst.
-++ See also: ConstructorCall, Domain.
-Signature(): Public == Private where
- Public == SetCategory with
- signature: (List Syntax,Syntax) -> %
- ++ signature(s,t) constructs a Signature object with parameter
- ++ types indicaded by `s', and return type indicated by `t'.
- target: % -> Syntax
- ++ target(s) returns the target type of the signature `s'.
- source: % -> List Syntax
- ++ source(s) returns the list of parameter types of `s'.
- Private == add
- Rep == List Syntax
- signature(s,t) == per cons(t,s)
- target x == first rep x
- source x == rest rep x
- x = y == rep x = rep y
- coerce(x: %): OutputForm ==
- rarrow([s::OutputForm for s in source x]::OutputForm,
- target(x)::OutputForm)$OutputForm
-@
\section{domain ElaboratedExpression}
@@ -615,15 +547,20 @@ Literal(T: SetCategory): Public == Private where
<<domain IDENT Identifier>>=
++ Author: Gabriel Dos Reis
++ Date Created: July 5, 2008
-++ Date Last Modified: September 1, 2008
-++ Description: This domain represents identifer AST.
+++ Date Last Modified: December 17, 2008
+++ Description:
+++ This domain represents identifer AST.
+++ This domain differs from Symbol in that it does not support
+++ any form of scripting.
+++ A value of this domain is a plain old identifier.
+++
)abbrev domain IDENT Identifier
Identifier(): Public == Private where
- Public == Join(SpadSyntaxCategory, CoercibleTo Symbol)
+ Public == Join(SetCategory, CoercibleTo Symbol)
Private == add
- Rep == Symbol
- coerce(x: %): Symbol == rep x
- coerce(x: %): OutputForm == x::Symbol::OutputForm
+ x = y == EQ(x,y)$Lisp
+ coerce(x: %): Symbol == x : Symbol
+ coerce(x: %): OutputForm == x : OutputForm
@
@@ -1788,8 +1725,6 @@ SpadAst(): SpadAstExports() == add
<<*>>=
<<license>>
<<domain SYNTAX Syntax>>
-<<domain SIG Signature>>
-<<domain CTORCALL ConstructorCall>>
<<domain ELABEXPR ElaboratedExpression>>
<<category ASTCAT AbstractSyntaxCategory>>