Commit c39bd6d9 authored by Dave Cooper's avatar Dave Cooper

merged dad's edits into manual.

parent 2d0f3045
......@@ -14,6 +14,8 @@ bin
*.idx
*.log
*.toc
*.ilg
*.ind
configure.el
systems.txt
......
This diff is collapsed.
This diff is collapsed.
......@@ -80,14 +80,16 @@ written consent from Genworks International.")
;;
(asdf:run-shell-command
(format nil "cd ~a; /opt/local/bin/pdflatex -interaction=nonstopmode tutorial.tex" pdf-path))
;;(format nil "cd ~a; /opt/local/bin/pdflatex -interaction=nonstopmode tutorial.tex" pdf-path)
(format nil "cd ~a; /usr/texbin/pdflatex -interaction=nonstopmode tutorial.tex" pdf-path)
)
(asdf:run-shell-command
(format nil "cd ~a; /opt/local/bin/makeindex tutorial" pdf-path))
(format nil "cd ~a; /usr/texbin/makeindex tutorial" pdf-path))
(dotimes (n level)
(asdf:run-shell-command
(format nil "cd ~a; /opt/local/bin/pdflatex -interaction=nonstopmode tutorial.tex" pdf-path)))))
(format nil "cd ~a; /usr/texbin/pdflatex -interaction=nonstopmode tutorial.tex" pdf-path)))))
(define-object assembly (com.genworks.dom:assembly)
......
......@@ -23,17 +23,18 @@
(defparameter *understanding-common-lisp*
`((:chapter :title "Understanding Common Lisp")
(:p "Gendl is a superset of Common Lisp, and is embedded in Common
Lisp. This means that when working with Gendl, you have the full power
of CL available to you. The lowest-level expressions in a Gendl
(:p "GDL is a superset of Common Lisp, and is embedded in Common
Lisp. This means that when working with GDL, you have the full power
of CL available to you. The lowest-level expressions in a GDL
definition are CL ``symbolic expressions,'' or ``s-expressions.''
This chapter will familiarize you with CL s-expressions.")
((:section :title "S-expression Fundamentals")
(:p "S-expressions can be used in your definitions to establish
the value of a particular "
(:emph "slot")
" in an object, which will be computed on-demand. You can also
evaluate S-expressions at the toplevel "
" (i.e. named data value) in an object, which will be
computed on-demand. You can also evaluate S-expressions at the
toplevel "
(:texttt "gdl-user\\textgreater")
" prompt, and see the result immediately. In fact, this toplevel prompt is called a "
(:emph "read-eval-print")
......@@ -73,7 +74,8 @@ processes the expression according to the following rules:")
(:item "If the expression is an "
(:emph "atom")
" (e.g. a non-list datatype such as a number, text
string, or literal symbol), it simply evaluates to itself. Examples: "
string, or literal symbol), it simply returns itself as its evaluated
value. Examples: "
((:list :style :itemize)
(:item (:verbatim "gdl-user> 99
99"))
......@@ -94,8 +96,10 @@ single-quote. Symbols are allowed to have dashes (``-'') and most
other special characters. By convention, the dash is used as a word
separator in CL symbols.")
(:item "If the expression is a list (i.e. is surrounded by
parentheses), CL processes the "
(:item "If the expression is a "
(:emph "list")
" (i.e. is surrounded by parentheses), CL processes
the "
(:emph "first")
" element in this list as an "
(:emph "operator name")
......@@ -108,7 +112,7 @@ arguments, and can return zero or more return-values. Some operators
evaluate their arguments immediately and work directly on those
values (these are called "
(:emph "functions")
". Other operators expand into other code. These are called "
"). Other operators expand into other code. These are called "
(:emph "special operators")
" or "
(:emph "macros")
......@@ -133,7 +137,7 @@ arrays, and hash tables. CL contains "
(:emph "symbols")
" as well, which typically are used as names for other data elements.")
(:p "Regarding data types, CL follows a paradigm called dynamic
(:p "Regarding data types, CL follows a system called dynamic
typing. Basically this means that values have type, but variables do
not necessarily have type, and typically variables are not
``pre-declared'' to be of a particular type.")
......@@ -202,7 +206,7 @@ evaluate to themselves when included in an expression.")
", then enough arguments to match the "
(:emph "format directives")
" in the format-string. Format directives begin with the
tilde character (~). The format-directive "
tilde character (\\~). The format-directive "
(:texttt "~a")
" indicates that the printed representation of the corresonding argument should simpy be
substituted into the format-string at the point where it occurs.")
......@@ -214,16 +218,16 @@ substituted into the format-string at the point where it occurs.")
" on Input/Output, but for now, a familiarity with the simple use of "
(:texttt "(format nil ...")
" will be helpful for Chapter "
(:ref "chapter:understandinggendlcoregdlsyntax")
(:ref "chapter:understandinggdlcoregdlsyntax")
"."))
((:subsection :title "Symbols")
(:p "Symbols are such an important data structure in CL, that people
(:p "Symbols are such an important data structure in CL that people
sometimes refer to CL as a ``Symbolic Computing Language.'' Symbols
are a type of CL object which provides your program with a built-in
mechanism to store and retrieve values and functions, as well as being
capacity to store and retrieve values and functions, as well as being
useful in their own right. A symbol is most often known by its name
(actually a string), but in fact there is much more to a symbol than
its name. In addition to the name, symbols also contain a "
......@@ -244,7 +248,7 @@ contain any value, allowing the symbol to act as a global variable, or "
(:emph "plist")
" slot, can contain an arbitrary amount of information.")
(:p "This separation of the symbol data structure into function, value, and
plist slots is one obvious distinction between Common Lisp and most
plist slots is one fundamental distinction between Common Lisp and most
other Lisp dialects. Most other dialects allow only one (1) ``thing''
to be stored in the symbol data structure, other than its name
(e.g. either a function or a value, but not both at the same
......@@ -262,13 +266,16 @@ contrive arbitrary abbreviations such as "
".")
(:p "How symbols are evaluated depends on where they occur in an
expression. As we have seen, if a symbol appears first in a list
expression, as with the "
expression. As we have seen, if a "
(:emph "symbol")
" appears first in a list expression, as with the "
(:texttt "+")
" in "
(:texttt "(+ 2 2)")
", the symbol is evaluated for its function slot. If the first
element of an expression indeed has a function in its function slot, then any
element of an expression indeed has a "
(:emph "function")
" in its function slot, then any
subsequent symbol in the expression is taken as a variable, and it is evaluated
for its global or local value, depending on its scope (more on variables and
scope later).")
......@@ -294,15 +301,15 @@ and generate other CL programs. Likewise, CL programs can read and
manipulate other CL programs in a natural manner. This cannot be said
of most other languages, and is one of the primary distinguishing
characteristics of Lisp as a language.")
(:p "Textually, a list is defined as zero or more elements surrounded by
parentheses. The elements can be objects of any valid CL data types,
(:p "Textually, a list is defined as zero or more items surrounded by
parentheses. The items can be objects of any valid CL data types,
such as numbers, strings, symbols, lists, or other kinds of
objects. As we have seen, you must quote a literal list to evaluate it
or CL will assume you are calling a function. Now look at the
following list:"
(:verbatim "(defun hello () (write-string \"Hello, World!\"))")
"This list also happens to be a valid CL program (function definition,
in this case). Don't worry about analyzing the function definition
in this case). Don't concern yourself about analyzing the function definition
right now, but do take a few moments to convince yourself that it
meets the requirements for a list.")
......@@ -408,7 +415,7 @@ it is called a "
(:emph "value")
". The key is typically an actual keyword symbol --- that is,
a symbol preceded by a colon (:). The value can be any value, such as
a number, a string, or even a Gendl object representing something
a number, a string, or even a GDL object representing something
complex such as an aircraft.
A plist can be constructed in the same manner as any list, e.g. with the "
......@@ -445,10 +452,10 @@ appending them together. Like many CL functions, append does not "
", that is, it simply returns a new list as a return-value, but does not modify its
arguments in any way:"
(:verbatim "
gdl-user> (defparameter my-slides (introduction welcome lists functions))
gdl-user> (defparameter my-slides '(introduction welcome lists functions))
(introduction welcome lists functions)
gdl-user> (append my-slides (numbers))
gdl-user> (append my-slides '(numbers))
(introduction welcome lists functions numbers)
gdl-user> my-slides
......
......@@ -22,47 +22,49 @@
(in-package :gendl-doc)
(defparameter *understanding-gendl*
`((:chapter :title "Understanding Gendl --- Core GDL Syntax")
`((:chapter :title "Understanding GDL --- Core GDL Syntax")
(:p "Now that you have a basic grasp of Common Lisp syntax (or, more accurately, "
(:emph "lack")
" of syntax), we will jump directly into the Gendl framework. By using Gendl you can formulate most of
your engineering and computing problems in a natural way, without becoming bogged down in the complexity of
the Common Lisp Object System (CLOS).")
(:emph "absence")
" of syntax), we will move directly into the GDL
framework. By using GDL you can formulate most of your engineering and
computing problems in a natural way, without becoming entangled in the
complexity of the Common Lisp Object System (CLOS).")
(:p "The Gendl product is a commercially available KBE system
dual-licensed under the Affero Gnu Public License and a Proprietary
license. The core GDL language is a proposed standard for a
vendor-neutral KBE language.")
(:p "The GDL product is a commercially available KBE system with
Proprietary licensing. The Gendl Project is an open-source Common
Lisp library which contains the core language kernel of GDL, and is
licensed under the terms of the Affero Gnu Public License. The core
GDL language is a proposed standard for a vendor-neutral KBE
language.")
(:p "As discussed in the previous chapter, GDL is based on and
is a superset of ANSI Common Lisp. Because ANSI CL is unencumbered and
an open standard, with several commercial and free implementations, it
is a good wager that applications written in it will continue to be
usable 50, 100, or even hundreds of years from now.")
(:p "As we mentioned in the previous chapter, Gendl is based on
and is a superset of ANSI Common Lisp. Because ANSI CL is an
unencumbered, open standard with several commercial and free
implementations, it is a good bet that applications written in it will
continue to function 50, 100, or even hundreds of years from now.")
(:p "Note that the historical name of Gendl was ``GDL,'' and this name persists throughout the product
for example appearing occasionally in documentation for naming Common Lisp packages.")
((:section :title "Defining a Working Package")
(:p "In Common Lisp, "
(:emph "packages")
" are a mechanism to separate symbols into
namespaces. Using packages it is possible to avoid naming collisions
in large projects. Consider this analogy: in the United States,
telephone numbers consist of a three-digit area code and a seven-digit
namespaces. Using packages it is possible to avoid naming conflicts in
large projects. Consider this analogy: in the United States, telephone
numbers consist of a three-digit area code and a seven-digit
number. The same seven-digit number can occur in two or more separate
area codes, without causing a conflict.")
(:p "The macro "
(:texttt "gdl:define-package")
"is used to set up a new working package in Gendl.")
"is used to set up a new working package in GDL.")
(:p "Example:"
(:verbatim "(gdl:define-package :yoyodyne)")
" will establish a new package called "
(:texttt ":yoyodyne")
" which has all the Gendl operators available.")
" which has all the GDL operators available.")
(:p "The "
(:texttt ":gdl-user")
......@@ -70,7 +72,7 @@ area codes, without causing a conflict.")
you do not wish to make a new package just for scratch work.")
(:p "For real projects it is recommended that you make and work in your own
Gendl package, defined as above with "
GDL package, defined as above with "
(:texttt "gdl:define-package")
".")
......@@ -169,8 +171,9 @@ GDL functions can also take other non-specialized arguments, just like a normal
"))
"As you can see, a GDL Object is analogous in some ways to a "
(:texttt "defun")
", where the input-slots are like arguments to the function, and the computed-slots
are like return-values. But seen another way, each attribute in a GDL object is like a function in its own right.
", where the input-slots are like arguments to the function,
and the computed-slots are like return-values. But seen another way,
each slot in a GDL object serves as function in its own right.
The referencing macro "
(:texttt (:indexed "the"))
......@@ -196,7 +199,7 @@ symbols (i.e.\\ preceded by a colon), and the "
(:texttt "the")
" macro will process them appropriately.")
((:section :title "Making Instances and Sending Messages")
"Once we have defined an object such as the example above, we can use
"Once we have defined an object, such as the example above, we can use
the constructor function "
(:texttt (:indexed "make-object"))
" in order to create an "
......@@ -388,7 +391,7 @@ A passed-in value will override the default expression.")))
((:section :title "Summary")
"This chapter has provided a minimal introduction to the core
Gendl syntax. In subsequent chapters we will cover more specialized
aspects of the Gendl language, introducing new Common Lisp concepts as
GDL syntax. In subsequent chapters we will cover more specialized
aspects of the GDL language, introducing new Common Lisp concepts as
they are required along the way.")))
......@@ -16,7 +16,8 @@
;; 2. WHERE ARE WE?
(defvar *gendl-home* (file-truename (concat (file-name-directory (file-truename load-file-name)) "../")))
(defvar *gendl-home* (file-truename (concat (file-name-directory
(file-truename load-file-name)) "../")))
;; 3. CONFGURGE EMACS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment