Commit c39bd6d9 authored by Dave Cooper's avatar Dave Cooper

merged dad's edits into manual.

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