id
int64 0
45.1k
| file_name
stringlengths 4
68
| file_path
stringlengths 14
193
| content
stringlengths 32
9.62M
| size
int64 32
9.62M
| language
stringclasses 1
value | extension
stringclasses 6
values | total_lines
int64 1
136k
| avg_line_length
float64 3
903k
| max_line_length
int64 3
4.51M
| alphanum_fraction
float64 0
1
| repo_name
stringclasses 779
values | repo_stars
int64 0
882
| repo_forks
int64 0
108
| repo_open_issues
int64 0
90
| repo_license
stringclasses 8
values | repo_extraction_date
stringclasses 146
values | sha
stringlengths 64
64
| __index_level_0__
int64 0
45.1k
| exdup_ids_cmlisp_stkv2
sequencelengths 1
47
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36,978 | file-ordering.isc | lisp-mirror_gendl/documentation/tutorial/source/file-ordering.isc | ;;
;; Copyright 2002, 2009, 2012 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
("package" "parameters" "introduction" "installation" "basic-operation" "upgrade-notes"
"understanding-common-lisp" "understanding-gendl" "advanced-common-lisp" "advanced-gendl"
"tasty-environment" "gendl-geometry" "custom-user-interfaces" "bibliography") | 1,119 | Common Lisp | .l | 23 | 46.782609 | 94 | 0.756387 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 3b26fb58cea6d3cbcf36abec447a9408d1dbf9e9b42442999865c82e72c71691 | 36,978 | [
-1
] |
36,985 | understanding-gendl.gdl | lisp-mirror_gendl/documentation/tutorial/source/understanding-gendl.gdl | ;;
;; Copyright 2002, 2009, 2012 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gendl-doc)
(defparameter *understanding-gendl*
`((:chapter :title "Understanding GDL --- Core GDL Syntax")
(:p "Now that you have a basic familiarity with Common Lisp
syntax (or, more accurately, the "
(:emph "absence")
" of syntax), we will move directly into the Genworks GDL
framework. By using GDL you can formulate most of your engineering and
computing problems in a natural way, without becoming involved in the
complexity of the Common Lisp Object System (CLOS).")
(: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
is an open standard, with several commercial and free implementations,
it is a good wager that applications written in it will continue to be
usable for the balance of this century, and beyond. Many commercial
products have a shelf life only until a new product comes along. Being
based in ANSI Common Lisp ensures GDL's permanence.")
(: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.]")
((: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'' conflicts in
large projects. Consider this analogy: in the United States, telephone
numbers are preceded by a three-digit area code and then consist of 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 GDL.")
(:p " ")
(:p "Example:"
(:verbatim "(gdl:define-package :yoyodyne)")
" will establish a new package (i.e. ``area code'')
called "
(:texttt ":yoyodyne")
" which has all the GDL operators available.")
(:p "The "
(:texttt ":gdl-user")
" package is an empty, pre-defined package for your use if
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
GDL package, defined as above with "
(:texttt "gdl:define-package")
".")
(:p (:emph "A Note for advanced users:")
" Packages defined with "
(:texttt "gdl:define-package")
" will implicitly "
(:emph "use")
" the "
(:texttt ":gdl")
" package and the "
(:texttt ":common-lisp")
" package, so you will have access to all exported symbols
in these packages without prefixing them with their package name.
You may extend this behavior, by calling "
(:texttt "gdl:define-package")
" and adding additional packages to use with "
(:texttt "(:use ...)")
". For example, if you want to work in a package with access to GDL operators,
Common Lisp operators, and symbols from the "
(:texttt ":cl-json")
" package "
(:footnote "CL-JSON is a free third-party library for handling JSON format, a common data format used
for Internet applications.")
", you could set it up as follows:"
(:verbatim " (ql:quickload :cl-json)
(gdl:define-package :yoyodyne (:use :cl-json))")
"The first form ensures that the cl-json code module is
actually fetched and loaded. The second form defines a package with
the "
(:texttt ":cl-json")
" operators available to it."))
((:section :title "Define-Object")
(:index "objects!defining")
(:emph (:indexed "Define-object")) " is the basic macro for defining objects in GDL. An object
definition maps directly into a Lisp (CLOS) class definition.
The "
(:texttt "define-object")
" macro takes three basic arguments:"
((:list :style :itemize)
(:item "a "
(:emph "name")
", which is a symbol;")
(:item "a "
(:emph (:indexed "mixin-list"))
", which is a list of symbols naming other objects from which the current object
will inherit characteristics;")
(:item "a "
(:emph (:indexed "specification-plist"))
", which is spliced in (i.e.\\ doesn't have its own surrounding
parentheses) after the mixin-list, and describes
the object model by specifying properties of the object (messages, contained objects, etc.)
The specification-plist typically makes up the bulk of the object definition."))
"
Here are descriptions of the most common keywords making up the specification-plist:"
((:list :style :description)
((:item :word (:indexed "input-slots"))
"specify information to be passed into the object instance when it is created.")
((:item :word (:indexed "computed-slots"))
"are actually cached methods, with expressions to compute and return a value.")
((:item :word (:indexed "objects"))
"specify other instances to be ``contained'' within this instance.")
((:item :word (:indexed "functions"))
"are (uncached) functions ``of'' the object, i.e.\\ they
operate just as normal CL functions, and accept arguments just like
normal CL functions, with the added feature that you can also use "
(:emph "the")
" referencing, to refer to messages or reference chains
which are available to the current object."))
"Figure "
(:ref "fig:object-hello")
" shows a simple example, which contains two input-slots, "
(:texttt "first-name")
" and "
(:texttt "last-name")
", and a single computed-slot, "
(:texttt "greeting")
"."
((:boxed-figure :caption "Example of Simple Object Definition"
:label "fig:object-hello")
(:verbatim "
(define-object hello ()
:input-slots (first-name last-name)
:computed-slots
((greeting (format nil \"Hello, ~a ~a!!\"
(the first-name)
(the last-name)))))
"))
"A GDL Object is analogous in some ways to a CL "
(: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 slot in a GDL object serves as function in its own right.
The referencing macro "
(:texttt (:indexed "the"))
" shadows CL's "
(:texttt "the")
" (which is a seldom-used type declaration operator). "
(:texttt "The")
" in GDL is a macro which is used to reference the value of other messages
within the same object or within contained objects. In the above example, we are using "
(:texttt "the")
" to refer to the values of the messages (input-slots) named "
(:texttt "first-name")
" and "
(:texttt "last-name")
".
Note that messages used with "
(:texttt "the")
" are given as symbols. These symbols are unaffected by the current Lisp "
(:texttt "*package*")
", so they can be specified either as plain unquoted symbols or as keyword
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
the constructor function "
(:texttt (:indexed "make-object"))
" in order to create an "
(:emph "instance")
" of it. "
(:emph "Instance")
", in this context, means a single occurence of the object with
tangible values assigned to its input-slots. By way of analogy: an "
(:emph "object definition")
" is like a blueprint for a house; an "
(:emph "instance")
" is like an actual house. The "
(:texttt "make-object")
" function is very similar to the CLOS "
(:texttt (:indexed "make-instance"))
" function. Here we create an instance of "
(:texttt "hello")
" with specified values for "
(:texttt "first-name")
" and "
(:texttt "last-name")
" (the required input-slots), and assign this instance as the value of the symbol "
(:texttt "my-instance")
":"
(:verbatim "
GDL-USER(16): (setq my-instance
(make-object 'hello :first-name \"John\"
:last-name \"Doe\"))
#<HELLO @ #x218f39c2>")
"Note that keyword symbols are used to ``tag'' the input values. And the return-value of "
(:emph "make-object")
" is an instance of class "
(:texttt "hello")
". Now that we have an instance, we can use the operator "
(:texttt (:indexed "the-object"))
" to send messages to this instance:"
(:verbatim "
GDL-USER(17): (the-object my-instance greeting)
\"Hello, John Doe!!\"")
(:texttt "The-object")
" is similar to "
(:texttt "the")
", but as its first argument it takes an expression which evaluates to an
object instance. "
(:texttt "The")
", by contrast, assumes that the object instance is the lexical variable "
(:texttt (:indexed "self"))
", which is automatically set within the lexical context of a "
(:texttt "define-object")
".
Like "
(:texttt "the")
", "
(:texttt "the-object")
" evaluates all but the first of its arguments as package-immune symbols,
so although keyword symbols may be used, this is not a requirement, and plain,
unquoted symbols will work just fine.
For convenience, you can also set "
(:texttt "self")
" manually at the CL Command Prompt, and use "
(:texttt "the")
" instead of "
(:texttt "the-object")
" for referencing:"
(:verbatim "
GDL-USER(18): (setq self
(make-object 'hello :first-name \"John\"
:last-name \"Doe\"))
#<HELLO @ #x218f406a>
GDL-USER(19): (the greeting)
\"Hello, John Doe!!\"")
"In actual fact, "
(:texttt "(the ...)")
" simply expands into "
(:texttt "(the-object self ...)")
".")
((:section :title "Objects")
(:index "objects")
(:index "containment!object")
(:index "objects!child")
(:index "objects!contained")
"The "
(:texttt ":objects")
" keyword specifies a list of ``contained'' instances,
where each instance is considered to be a ``child'' object of the current
object. Each child object is of a specified type, which itself must be defined
with "
(:texttt "define-object")
" before the child object can be instantiated.
Inputs to each instance are specified as a plist of keywords and
value expressions, spliced in after the object's name and type
specification. These inputs must match the inputs protocol (i.e.\\ the input-slots)
of the object being instantiated. Figure "
(:ref "fig:object-city")
" shows an example of an object which contains some child objects."
((:boxed-figure :caption "Object Containing Child Objects"
:label "fig:object-city")
(:verbatim "
(define-object city ()
:computed-slots
((total-water-usage (+ (the hotel water-usage)
(the bank water-usage))))
:objects
((hotel :type 'hotel
:size :large)
(bank :type 'bank
:size :medium)))
"))
"In this example, "
(:texttt "hotel")
" and "
(:texttt "bank")
" are presumed to be already (or soon to be) defined as objects themselves,
which each answer the "
(:texttt "water-usage")
" message. The "
(:emph (:indexed "reference chains"))
":"
(:verbatim "(the hotel water-usage)")
" and "
(:verbatim "(the bank water-usage)")
" provide the mechanism to access messages within the child object instances.
These child objects become instantiated "
(:emph "on demand")
", which means that the first time these instances, or any of their messages,
are referenced, the actual instance will be created "
(:emph "and")
" cached for future reference.")
((:boxed-figure :caption "Sample Data and Object Definition to Contain U.S. Presidents"
:label "fig:object-presidents-container")
(:verbatim "
(defparameter *presidents-data*
'((:name
\"Carter\"
:term 1976)
(:name \"Reagan\"
:term 1980)
(:name \"Bush\"
:term 1988)
(:name \"Clinton\"
:term 1992)))
(define-object presidents-container ()
:input-slots
((data *presidents-data*))
:objects
((presidents :type 'president
:sequence (:size (length (the data)))
:name (getf (nth (the-child index) (the data)) :name)
:term (getf (nth (the-child index) (the data)) :term))))
"))
((:section :title "Sequences of Objects and Input-slots with a Default Expression")
"Objects may be "
(:emph "sequenced")
(:index "Objects!sequenced")
(:index "sequences")
(:index "object sequences")
", to specify, in effect, an array or list of object instances. The most
common type of sequence is called a "
(:emph "fixed size")
" sequence. See Figure "
(:ref "fig:object-presidents-container")
" for an example of an object which contains a sequenced set
of instances representing successive U.S. presidents. Each member of
the sequenced set is fed inputs from a list of plists, which simulates
a relational database table (essentially a ``list of rows'').
Note the following from this example:"
((:list :style :itemize)
(:item "In order to sequence an object, the input keyword "
(:texttt ":sequence")
" is added, with a list consisting of the keyword "
(:texttt (:indexed ":size"))
" followed by an expression which must evaluate to a number.")
(:item "In the input-slots, "
(:texttt "data")
" is specified together with a default expression. Used this way,
input-slots function as a hybrid of computed-slots and input-slots, allowing a "
(:emph "default expression")
" as with computed-slots, but allowing a value to be passed in on
instantiation or from the parent, as with an input-slot which has no default expression.
A passed-in value will override the default expression.")))
((:section :title "Summary")
"This chapter has provided an introduction to the core GDL
syntax. As with any language, practice (that is, usage) makes
perfect. The chapters that follow will cover more specialized aspects
of the GDL language, introducing additional Common Lisp concepts as
they are required along the way.")))
| 16,029 | Common Lisp | .l | 370 | 36.659459 | 106 | 0.651508 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 60496b8b353da1863c8d8b611d83cc61b8eb9b7fcc11582b79080f58823ebf91 | 36,985 | [
-1
] |
36,989 | advanced-gendl.gdl | lisp-mirror_gendl/documentation/tutorial/source/advanced-gendl.gdl | ;;
;; Copyright 2002, 2009, 2012 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gendl-doc)
(defparameter *advanced-gendl*
`((:chapter :title "Advanced GDL")
))
| 951 | Common Lisp | .l | 24 | 38 | 70 | 0.751082 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | c28a51fb0b288e1ff8580068c4ad2c3b4fbdbf3e1f8757a76b97cadbcc216af3 | 36,989 | [
-1
] |
36,994 | gwl-usage.txt | lisp-mirror_gendl/documentation/historical/doc/gwl-usage.txt | ;;
;; Copyright 2002, 2009 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
Basic GWL Overview and Syntax
=============================
This file contains basic information and usage instructions for the
Generative Web Language System (GWL), as it ships with General-purpose
Declarative Language (GDL).
1 Testing your Installation
===========================
After you have installed according to install.htm:
o Make sure you have started AllegroServe with:
(net.aserve:start :port 9000)
(you may choose any free port in place of 9000)
o In your web browser, go to:
http://<hostname>:<port>/demos/robot
e.g. http://localhost:9000/demos/robot
You should see a page with a simple robot assembly made from boxes. If
the robot shows up as well as the orange graphical "compass" below the
graphics viewport, your installation is likely working correctly.
If you are interested you can see the code for this test part in
<gdl-home>/gwl-samples/source/robot.lisp
2 Syntax
============
The following describes the syntax which is specific to GWL as
distinct from the underlying host language (i.e. GDL)
In general, the full capabilities of the host language remain
available under GWL. Please see Common Lisp and/or GDL documentation
as appropriate.
2.1 GWL:Define-Package
======================
The macro Gwl:Define-Package is used to set up a new working package
in Gwl.
To see exactly what it is doing, try a macroexpand-1 on a call
to Gwl:Define-Package.
Example:
(Gwl:define-package :Gwl-user)
The :Gwl-user package is an empty, pre-defined package for your
use if you do not wish to make a new package just for scratch work.
For real projects it is recommended that you make and work in your
own Gwl package.
3 Basic Usage
=============
Every gdl object whose instances are to be presented as a web page in an
application must:
1. Mix in base-html-sheet or a subclass thereof;
2. define a :function called Write-HTML-Sheet
The Write-HTML-Sheet function is a normal HTML synthesis function which
should make use of the htmlgen "html" macro. It does not need to take
any arguments.
Please see the htmlgen documentation (in <gdl-home>/doc/aserve/) with
the AllegroServe distribution for full details on the use of htmlgen.
Example:
(define-object president (base-html-sheet)
:input-slots
((name "Carter")
(term 1976))
:functions
((write-html-sheet ()
(html
(:html
(:head (:title (format nil "Info on President: ~a" (the name))))
(:body
(:table
(:tr (:td "Name") (:td "Term"))
(:tr (:td (:princ (the name))) (:td (:princ (the term)))))))))))
Access this part with the URL:
http://<host>:<port>/make?part=gwl-user::president
Once a page has been defined with its Write-HTML-Sheet function, a user
may instantiate it by visiting the pre-defined search URL ``make'' and
specifying the symbol for the part type after the question mark, for
example:
http://mie.genworks.com:9000/make?part=gwl-user::president
(Note you would not need the double-colon if "president" were exported
from "gwl-user" package).
The above URL would display the resultant HTML from running its
Write-HTML-Sheet function with default toplevel inputs.
Presentation of a form for toplevel inputs is not yet implemented
in Gwl.
4 Page Linking
==============
Creating hypertext links to other pages in the page hierarchy is
generally accomplished with the built-in method :Write-Self-Link.
This method, when called on a particular page instance, will write
a hypertext link referring to that page instance.
The hypertext link is made up from the unique root-path of the target
part, as well as an instance-id, which identifies the particular
root-level instance which is the ``root'' of the relevant page
hierarchy. While this may in some cases correspond to one "user" or
session, in general there can be a many-to-many relationship between
user sessions and root-level instances. In the current implementation
there is no direct support for multiple users sharing the same
instance. Currently nothing prevents multiple users from multiple web
browsers from visiting the same instance; however there is not yet any
automatic concurrency control for multiple users modifying the
underlying parts, so for an interactive application with
fillout-forms, the underlying parts could get into an inconsistent
state.
Example:
(define-object presidents-container (base-html-sheet)
:input-slots
((data '((:last-name "Carter" :term 1976)
(:last-name "Clinton" :term 1992))))
:objects
((presidents :type 'president-display
:sequence (:size (length (the data)))
:last-name (getf (nth (the-child index)
(the data))
:last-name)
:term (getf (nth (the-child index)
(the data))
:term)))
:functions
((write-html-sheet
()
(html
(:html
(:head (:title "Links to Presidents"))
(:body
(:h1 "Links to the Presidents")
(:ol
(dolist (president (list-elements (the presidents)))
(html
(:li (the-object president (write-self-link))))))))))))
(define-object president-display (base-html-sheet)
:input-slots
(last-name term)
:computed-slots
((strings-for-display (the last-name)))
:functions
((write-html-sheet
()
(html
(:html
(:head (:title (:princ (the last-name))))
(:body
(:h1 (:princ (the last-name)))
"Term: " (:princ (the term))
(:p (the (write-back-link)))))))))
Access this part with the URL:
http://<host>:<port>/make?part=gwl-user::presidents-container
The write-html-sheet function in presidents-container will write an
enumerated list, where each item in the list will be a hypertext link
leading to the respective President's actual page instance. The label
text to be displayed for the link will default to the
strings-for-display of the given President object, which defaults to
the page name and index number. This default can be overridden as
necessary.
Note the use of the write-back-link function in
presidents-display. This will generate a link back to the
return-object of the object, which defaults to the object's parent.
5 Form Handling
===============
*******************
NOTE: This section is outdated. The forms interface for GWL has been
upgraded with the base-form-control object. Please see the reference
documentation in the GWL package for base-form-control for detailed
instructions on its use. This section will be updated to
reflect the new practices.
*******************
Forms are generated using the gwl macro with-html-form. You wrap this
macro around the HTMLgen code which creates the contents of the
form:
(with-html-form ()
;; the body of your form goes here
)
This macro generates code similar to the following (do not be concerned if
you do not understand the meaning of the following code):
((:form :method :post :action "/answer")
;;
;; Some internal GWL code goes here automatically
;;
;; the body of your form goes here
)
The above code-snippet would be included in a Write-HTML-Sheet function
of a page definition.
By default, the same object which generates the form will also respond
to the form, and is also the object which will have its settable slots
modified based on form fields (i.e. html "inputs") of the same
name. You can override the default by specifying a "bashee" and/or
"respondent" as slots in the requestor object (i.e. the object which
is generating the form), for example:
:computed-slots
((respondent (the some-other-object))
(bashee (the yet-another-object)))
Any :settable :computed-slots in the bashee object (which, again,
defaults to the "requestor," i.e. the same object which is generating
the form) may be specified as :input values in the form. Their types
will be inferred automatically and converted appropriately. If a type
on a slot is variable, it is best to make its default be a string,
then have your application read from the string (with the
"read-safe-string" function).
Note that only those input values which have actually changed
(according to equalp) will be set into the corresponding
:computed-slot. Ones which remain the same will be left alone
(to avoid unnecessary dependency updating in the model).
Any :input values in the form which are not :settable :computed-slots
in the object will be collected and returned as part of the special
query-plist message when the response page's write-html-sheet method
is invoked, where query-plist is a plist containing keywords
representing the form field names, and values which will be strings
representing the submitted values.
(define-object hello-form (base-html-sheet)
:computed-slots ((username "Jack" :settable))
:functions
((write-html-sheet
()
(html
(:html
(:head (:title "Sample Form"))
(:body
(:p "Hello there, " (:princ (the username)) "!")
(:p (with-html-form ()
((:input :type :text :name :username
:value (the username)))
((:input :type :submit :name :submit
:value " Change Name! "))))))))))
Access this part with the URL:
http://<host>:<port>/make?part=gwl-user::hello-form
6 Including Graphics
====================
The techniques for displaying graphics with GWL is not completely
finalized, but the folowing example is how to do it for now. Note the
use of the view-object :hidden-object, and the write-geometry method:
(define-object box-display (base-html-sheet)
:computed-slots
((length 10 :settable)
(width 10 :settable)
(height 10 :settable))
:objects
((box :type 'box)) ;; :length, :width, :height are descendant.
:hidden-objects
((view-object :type 'graphics-preferences
:object (the box) ;; can also be a list
:main-sheet self
:width 500 :height 500 ;; image pixel resolution
;;(the :view) defaults to :trimetric.
:projection-vector (getf *standard-views* (the view))))
:functions
((write-html-sheet
()
(html
(:html
(:head (:title "Box Display"))
((:body :bgcolor (gethash :quartz *color-table*))
(:center (:h2 "Box Display"))
((with-html-form ()
(:table (:tr (:td "Length:")
(:td ((:input :type :text :name :length :size 5 :value (the length)))))
(:tr (:td "Height:")
(:td ((:input :type :text :name :height :size 5 :value (the height)))))
(:tr (:td "Width:")
(:td ((:input :type :text :name :width :size 5 :value (the width))))))
(:p ((:input :type :submit :name :submit :value " OK "))))
(:p (the (write-geometry))))))))))
Access this part with the URL:
http://<host>:<port>/make?part=gwl-user::box-display
7 Publishing URLs for GWL Objects
=================================
You can publish a URL for a given part, to avoid having to type the
"make?" expression in the URL, using the AllegroServe publish
function, as per the following example:
(publish :path "/demos/bus"
:function #'(lambda(req ent)
(gwl-make-object req ent "bus:assembly")))
8 Sample Applications
=====================
We distribute three sample applications, in the <gdl-home>/gwl-samples/
directory:
robot.lisp (the simple test part described above)
ledger (a small application for keeping track of accounts and transactions)
bus (a basic North American school bus model)
| 12,257 | Common Lisp | .l | 289 | 38.82699 | 81 | 0.719017 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | df9c3a61a6040f16d37f8d161e9bb49b25a7e1c05eba2410196dc70b502374a8 | 36,994 | [
-1
] |
36,995 | utilities.txt | lisp-mirror_gendl/documentation/historical/doc/utilities.txt | ;;
;; Copyright 2002, 2009 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
Utility Functions, Macros, and Types Defined in GDL
====================================================
NOTE: These are also included in the reference documentation available from a running GDL session at
http://localhost:<port>/yadd
(defun 3d-distance (point-1 point-2)
"Return a number which is the three-dimensional distance from point-1 to point-2")
(defun 3d-vector-to-array (vector)
"Returns a Lisp array of numbers from a 3d-vector.")
;;
;; NOTE: matrix:add-matrix is also available, from the CMU repository.
;; it works similarly to this function.
;;
(defun add-matrices (&rest matrices)
"Adds together matrices of similar rank.")
(defun add-vectors (&rest vectors)
"Return a new vector, the result of addition")
(defun alignment (axis1 vector1 &optional axis2 vector2 axis3 vector3)
"Returns a transformation matrix corresponding to the given axes and vectors. Axis3
and vector3 should be given only if you want the transformation matrix to have a
left-handed coordinate system -- otherwise vector3 will default to the cross
of vector1 and vector2 (in the appropriate order).")
(defun alist2plist (alist)
"Returns a plist converted from an assoc-list")
(defun always (arg)
"Always returns T.")
(defun angle-between-vectors (vector-1 vector-2 &optional reference-vector &key (epsilon *zero-epsilon*) -ve)
"Returns smallest positive angle between vector-1 and vector-2, if reference-vector
is nil. If non-nil, reference-vector indicates the direction of positive rotation.
If -ve is non-nil, true negative angles will be returned. Epsilon is used to check
for angles close to zero or 2pi.")
(defun angle-between-vectors-d (vector-1 vector-2 &optional reference-vector -ve)
"return the angle (in degrees) between the two vectors, in degrees. If
no reference-vector given, return smallest possible angle. If direction
vector is given, return according to right-hand rule. If \"-ve\" is given,
return negative number for angle if it really is negative according to
right-hand rule.")
(defun array-to-3d-vector (array)
"Returns a 3d-vector from a 3-by-1 Lisp array of numbers.")
(defun coincident-point? (point-1 point-2 &key (tolerance *zero-epsilon*))
"Returns t if the distance between point-1 and point-2 is less
than epsilon. The default epsilon is *zero-epsilon*.")
;;
;;NOTE: create-obliqueness currently computes absolute obliqueness -
;; computation relative to self's parent is not yet implemented.")
;;
(defun create-obliqueness (v1 name-v1 v2 name-v2 self)
"Compute absolute transformation matrix. v1 and v2 are vectors,
name-v1 and name-v2 are direction keywords such as :front, :right,
etc. v1 and v2 should be normal to each other.")
(defun cross-vectors (vector-1 vector-2)
"Compute the cross-product of vector-1 and vector-2, a new vector.")
(defun degree (degrees &optional (minutes 0) (seconds 0))
"Converts degrees to radians")
(defun dot-vectors (vector-1 vector-2)
"Compute the dot-product of vector-1 and vector-2, a number.")
(defun ensure-list (possible-list)
"Returns a list from possible-list")
(defun flatten (list)
"Returns a flat list with all nesting (and all NIL values) removed.")
(defun get-x (point)
"Returns X component of point or vector")
(defun get-y (point)
"Returns Y component of point or vector")
(defun get-z (point)
"Returns Z component of point or vector")
(defun half (num)
"Divides number by two.")
(defun index-filter (function list)
"Returns items from list for whose indices function is true.")
(defun inter-circle-circle (center-1 radius-1 center-2 radius-2 positive-angle? &key (tolerance *zero-epsilon*))
"Returns one of two points of intersection between two circles, or NIL if there is no intersection.")
(defun inter-circle-sphere (circle-center circle-radius circle-plane-normal
sphere-center sphere-radius positive-angle? &key (tolerance *zero-epsilon*))
"Returns one of two points of intersection between circle and sphere, or NIL if there is no intersection.")
(defun inter-line-plane (p-line u-line p-plane u-plane)
"Return single point of intersection between line and plane or NIL if
no intersections. p-line is a point on the line, u-line is direction
vector of the line, p-plane is a point on the plane, and u-plane is
normal vector to the plane.")
(defun inter-line-sphere (p-line u-line center radius side-vector)
"Takes point on the line (p-line), direction vector of line (u-line),
center of sphere (center), radius of sphere (radius), and a
side-selection vector (side-vector) to decide between two possible
intersections, and return either a point or NIL.")
(defun lastcar (list)
"Returns last element of list.")
(defun length-vector (vector)
"Returns the vector's magnitude.")
(defun list-of-numbers (num1 num2 &optional (increment 1))
"Returns a list of numbers starting from num2 going to num2 incremented by increment.")
(defun make-keyword (string)
"Converts string or symbol into a keyword symbol.")
(defmacro make-vector (x y z)
"Return a 3D vector of double-floats.")
(defmacro make-point (x y z)
"Return a 3D vector of double-floats (points are identical with vectors).")
(defun make-transform (list-of-lists)
"Converts a list of lists into a tranformation matrix.")
(defun mapsend (object-list message)
"Sends message, which should evaluate to a keyword, to each object in object-list,
and returns a new list with each resultant value.")
(defun maptree (node function &optional (accept? #'always)
(prune? #'never)
(get-children :children))
"Returns the list resulting from applying function to each object
in a defpart tree starting from node, accepting only those which pass
the accept? function, stopping tree recursion at those which pass the
prune? function, and using the get-children message to compute the
children of a given object.")
(defun matrix*vector (matrix vector)
"Multiplies matrix by vector with compatible rank.")
;;
;; From Paul Graham ANSI Common Lisp
;;
(defun most (function list)
"return member of list which returns max when function applied.
As second value return actual max value (return-value of function)")
;;
;; NOTE: matrix:multiply-matrix is also available, from the CMU repository.
;; it works similarly to this function.
;;
(defun multiply-matrices (matrix-1 matrix-2)
"Multiplies one matrix by another of compatible rank.")
(defun near-to? (number near-to &optional (tolerance *zero-epsilon*))
"Predicate to test if number is within tolerance of
near-to. The default tolerance is *zero-epsilon*.")
(defun near-zero? (number &optional (tolerance *zero-epsilon*))
"Returns T if number is within tolerance of zero.")
(defun never (arg)
"Always returns NIL.")
(defun number-format (number &optional decimal-places)
"Returns string representing number rounded to specified number of decimal places.")
(defun number-round (number &optional decimal-places)
"Returns double-float of number rounded to specified number of decimal places.")
(defun orthogonal-component (vector reference-vector)
"Returns the vector closest to reference-vector which is normal to vector.")
(deftype part-name-symbol ()
"(typep <object> part-name-symbol) will return true for objects which are
symbols naming a defpart.")
(defun plist2pairs (plist)
"Return a list of lists, each a pair, from a plist")
(defun plist-keys (plist)
"Return list of the keywords from a plist.")
(defun plist-values (plist)
"Return list of the values from a plist.")
(defmacro print-variables (&rest vars)
"Print variable name and value as with prin1, and newline.")
(defun projected-vector (vector plane-normal)
"Returns new vector representing vector projected onto plane of plane-normal.")
(defun proj-point-on-line (3d-point line-point vector)
"Returns a 3D-Point. Drops a point onto a line. 3D-point is a global
point. Line-point is a point on the line. Vector is a unit vector in the
direction of the line.")
(defun pythagorize (&rest numbers)
"Number. Returns the square root of the sum of the squares of <i>numbers</i>.")
(defun radians-to-degrees (radians)
"convert radians to degrees")
(defun read-safe-string (string)
"Returns result of reading values from string without risk of Lisp
evaluating anything (e.g. with ``#.'' directive).")
(defun replace-substring (string old new)
"Returns new string, replacing all occurences of old with new in string")
(defun remove-plist-key (plist key)
"Return a new plist with specified key and its value removed.")
(defun reverse-vector (vector)
"Returns the reverse-direction vector.")
(defmacro roll (axis angle &rest other-axes-and-angles)
"Returns a transformation matrix based on rotation about axis by some
angle. Axis is specified symbolically from the following list: [:lateral
:longitudinal :vertical]. Angle is specified in radians. Any number of
axis-angle pairs can be specified.
NOTE: this macro must be called from within the context of a defpart since it
relies on the part's local orientation.")
(defun rotate-point (point center normal &key (arc-length nil) (angle nil))
"Returns a coordinate rotated about a center in the plane defined by the
normal vector. The rotation can be either defined by an arc length or an
angle (specified in radians). A second value is also returned. This is
the angle of rotation.")
(defun rotate-point-d (point center normal &key (arc-length nil) (angle nil))
"Returns a coordinate rotated about a center in the plane defined by the
normal vector. The rotation can be either defined by an arc length or an
angle (specified in degrees). A second value is also returned. This is
the angle of rotation.")
(defun rotate-vector (vector angle normal)
"Rotates vector, which is a global vector, around
normal, which is a vector normal around which to
rotate, by an amount of rotation specified by
angle, which is given in radians.")
(defun rotate-vector-d (vector degrees normal)
"Same as rotate-vector, but takes the angle in degrees.")
(defun rotation (vector angle)
"Returns a transformation matrix based on a rotation of some <i>angle</i>,
specified in radians, about an arbitrary <i>vector</i>.")
(defun safe-sort (list &rest args)
"Same as sort, but does not modify list given as argument.")
(defun same-direction-vectors? (vector-1 vector-2 &key (tolerance *zero-epsilon*))
"Predicate to test if angle between two vectors is within tolerance of zero.")
(defun scalar*matrix (scalar matrix)
"Multiplies the scalar number by the matrix and returns a new matrix.")
(defun scalar*vector (scalar vector)
"Multiplies the scalar number by the vector and returns a new vector.")
(defmacro send (object message)
"Send message, which should be a keyword symbol, to object. Unlike the-object,
this does not handle reference chains.")
(defun split (string &optional (split-chars (list #\space #\newline #\return #\tab)))
"Returns a list of strings, the result of splitting string by any of the split-chars.")
(defun string-append (&rest args)
"Returns concatenated string from args, each of which should be a string")
(defun subtract-vectors (&rest vectors)
"Return a new vector, the result of subtraction")
(defun transform-and-translate-point (vector transform trans-vector)
"3D-Point. Returns the product of vector, which is a row vector,
and transform, which is a 3x3 rotation matrix, translated by
trans-vector.")
(defun transform-numeric-point (vector transform)
"3D-Point. Returns the product of vector, which is a row
vector, and transform, which is a 3x3 rotation matrix.")
(defmacro translate (origin &rest offsets)
"Translate a point within a defpart instance by any number of directions
and distances. Directions can be :up, :down, :left, :right, :front, :rear.
Distances should be numbers. example: (translate (the :point) :up 2 :right 3)
NOTE: this macro must be called within the context of a defpart since it
relies on the part's local orientation.")
(defun translate-along-vector (point vector distance)
"Return a new point which is the point translated
along the vector by the specified distance")
(defun transpose-matrix (matrix)
"Transpose rows and columns of matrix.")
(defun twice (num)
"Multiplies number by two.")
(defun undefpart (part)
"Clears most definitions associated with part, which should be a (quoted) symbol.")
(defun unitize-vector (vector)
"Returns the normalized unit vector")
(defun zero-vector? (vector)
"Returns T if vector has zero magnitude.")
(defun ^2 (x)
"return number squared")
| 13,540 | Common Lisp | .l | 258 | 49.934109 | 112 | 0.759259 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | c17964eb15b4b2d88b6db0573e56d8165b3779af68d9464c56e152d408d3af19 | 36,995 | [
-1
] |
36,996 | index.xml | lisp-mirror_gendl/documentation/historical/doc/index.xml | <?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="/static/xsl/clixdoc.xsl" ?>
<clix:documentation xmlns='http://www.w3.org/1999/xhtml' xmlns:clix='http://bknr.net/clixdoc'>
<clix:title>GDL/GWL 1.5 Documentation
</clix:title>
<clix:short-description>
How to use General-purpose Declarative Language to do "KBE" as well as
web applications to deploy those models.
</clix:short-description>
<h2><center>GDL/GWL 1.5 Documentation</center></h2>
<center> <i>interim update for gdl1578</i> </center>
<clix:chapter name="contents" title="Contents"></clix:chapter>
<clix:contents></clix:contents>
<blockquote>
<clix:chapter name="abstract" title="Becoming an effective GDL developer">
<p>
Becoming effective with GDL consists of three (3) basic skills:
<ol>
<li> Editing text and managing files with Gnu Emacs (yes, other
editors will work, but Emacs provides special support and only Emacs
is supported by Genworks);
</li>
<li>
Very basic Common Lisp programming;
</li>
<li>
Writing Object Definitions in GDL itself, using the define-object macro.
</li>
</ol>
</p>
<p>
Beyond this, if you want to create nice Web applications with GDL, it
helps to know something about HTML and server-based computing. But
these concepts can be picked up over time and are not necessary to get
started or to make simple applications or 3D geometric objects.
</p>
</clix:chapter>
</blockquote>
<clix:chapter name="install" title="Basic Installation">
<p>
To download the software and retrieve license keys:
<ol>
<li>
Visit the following URL:
<pre>
http://www.genworks.com/dl
</pre>
</li>
<li>
Enter your email address. If you don't have an email address on file with Genworks,
send email to licensing -at- genworks -dot- com
</li>
<li>
Read and accept the applicable license agreement and click the checkbox
</li>
<li>
Click the link to download the .zip or .exe install file, and start
the download to a known location on your computer.
</li>
<li>
Click the "Retrieve License Key" link, to have your license key file(s)
emailed to you.
</li>
</ol>
<p>
GDL is currently distributed for all the platforms as a self-contained
"zip" file which does not requiring official administrator
installation, or an install executable ("exe") file.
To install the downloaded software, you can either:
<ul>
<li>unzip the "zip" file to a known location</li>
or
<li>run the installer executable (exe) file and follow the prompts</li>
</ul>
After the GDL application directory is in place (typically in
"c:/Program Files" on Windows, or "/usr/local/" on Linux), you have to
copy your license file into that GDL application directory. The
license file was obtained via email in a previous step, and should be
named either "devel.lic" for Enterprise or Student editions, or
"gdl.lic" for Professional/Trial versions.
Now you can start the GDL development environment by running the
included "run-gdl.bat" startup script (Windows) or "run-gdl" script
(Linux/Mac).
</p>
NOTE on Windows, the Start Menu item which gets installed by the
Windows installation is not the usual way to start GDL (it will start
it without Emacs, which is not what you normally want). This will be
updated in a future release, but to start GDL with emacs, you should
simply navigate to the GDL installation directory and run the batch
file:
<pre>
run-gdl.bat
</pre>
This will start Emacs and should give you the welcome screen with
instructions for starting GDL itself within Emacs.
</p>
</clix:chapter>
<clix:chapter name="emacs" title="Getting Started with Emacs">
<i>(Note -- a license key file is not required in order to get started
with Emacs) </i>
<p>
Start Emacs with the GDL environment with the "run-gdl.bat" script
(Windows) or the "run-gdl" shell-script (Linux). Emacs should come up
with instructions for:
<ol>
<li> doing the Emacs tutorial, </li>
<li> starting the GDL process, and </li>
<li> special keychord shortcuts for working with GDL </li>
</ol>
</p>
</clix:chapter>
<clix:chapter name="cl" title="Getting Started with Common Lisp">
The following resources should provide sufficient CL background to start
with GDL:
<ul>
<li> <a href="blt.pdf"> Basic Lisp Techniques</a> (Chapters 1, 2, 3)</li>
<li> <a href="http://www.genworks.com/training-g101"> Online CL Training
Slides</a> <i>(designed to be used with lecture)</i></li>
<li><a href="http://www.norvig.com/luv-slides.ps"> Norvig and Pitman Lisp Style Guide </a></li>
<li> <a href="http://www.franz.com/support/documentation/current/ansicl/ansicl.htm"> Full ANSI Common Lisp Specification</a> <i>(for later reference)</i></li>
</ul>
</clix:chapter>
<clix:chapter name="gdl-start" title="Getting Started with GDL Itself">
<ul>
<li><a href="gdl-tutorial.pdf">GDL Tutorial</a>
<i>A Tutorial for GDL. This tutorial is somewhat outdated and we hope to
have it revised relatively soon, but it still gives a decent overview
of the fundamentals.</i></li>
<li> <a href="http://www.genworks.com/training-g102"> Online GDL Training
Slides</a> <i>(designed to be used with lecture)</i></li>
</ul>
</clix:chapter>
<clix:chapter name="gdl-reference" title="Reference Documentation for GDL Objects, Operators, and Parameters">
<ul>
<li><a href="http://www.genworks.com/downloads/customer-documentation/reference/index.html">GDL Reference</a>
<i>This is where you will spend 95% of your time after you are
familiar with the basics. This documentation is auto-generated from
GDL when we do the builds, so it gets updated with every new patch
release. We are also working on a context-sensitive interface to this
documentation from the live Emacs editing session. For now you have to
refer to the Web version, and look up the object, message, or operator
you want to know about.</i></li>
</ul>
</clix:chapter>
<clix:chapter name="other-doc" title="Other Documentation and Reference">
Currently, some of these files are in PDF format, some of the files
are plaintext, and some are linked HTML.
<ul>
<li><a href="bootstrap.txt">Managing Projects</a>
<i>Utilities for compiling and loading your GDL codebases.</i>
</li>
<li><a href="usage.txt">GDL Usage</a>
<i>Concise GDL Language Specification.</i></li>
<li><a href="gwl-usage.txt">GWL Usage</a>
<i>Concise syntax guide to Web User Interface layer -- currently being updated for new GDL Ajax features</i></li>
<li><a href="ta2.html">Testing and Tracking Utility (Ta2)</a>
<i>Overview of GDL's graphical development testing and inspection utility -- this will soon be replaced with a functionally equivalent, but CSS-styled, upgrade, name yet to be determined.</i></li>
<li><a href="make-gdl-app.txt">Generating Runtime Applications</a>
<i>Generating runtime GDL and GDL/GWL applications (this is under construction,
to be released with 1577 Enterprise)</i></li>
<li><a href="output-formats.txt">Output Formats and Lenses</a>
<i>Creating output from GDL objects in various formats.</i></li>
<li><a href="drawing.txt">GDL Drawing Package</a>
<i>Creating Engineering Drawings with Dimensions and Annotations, as well as Typeset Text Blocks</i></li>
<li><a href="reserved.txt">Reserved Symbols</a>
<i>A listing of certain symbols you should avoid using as message names in your own apps,
to avoid clashes with pre-defined GDL/GWL message names.</i></li>
<li><a href="translators.txt">Conversion Tools</a>
<i>Conversion tools for object-oriented code in legacy Lisp-based and KBE formats.</i></li>
</ul>
</clix:chapter>
<clix:chapter name="support" title="Customer Support">
<p>
<b>Evaluation and Student Licensees are not entitled to support directly
from Genworks.</b> -- Please register for
the <a href="http://groups.google.com/group/genworks">Genworks Google
Group</a> then post your questions there.
</p>
<p>
For commercial licensees, Genworks Customer support is usually
available on U.S. business days from 9am to 5pm Michigan time (Eastern
Standard Time, same as New York). Support for all included components
of GDL/GWL is provided by Genworks as your single point of
contact. Our VAR agreements with vendors such as Franz Inc. and SMS
stipulate that Genworks' customers contact only Genworks for support,
and not e.g. Franz Inc. or SMS directly. As necessary Genworks will
follow up with our vendors for second-level support on Allegro CL,
SMLib, etc.
</p>
<p>
Genworks Technical Support can be reached at:
<ul>
<li>[email protected]</li>
<li>+1 248-330-2979</li> (telephone for emergencies only, please).
</ul></p>
</clix:chapter>
<clix:chapter name="copyright-legal" title="Copyright/Legal Notice">
<small><i>
All information contained in this documentation set is copyright
(c) 2009, Genworks International, and is intended exclusively for
use in operating a properly licensed installation of the Genworks
GDL/GWL product.
It may not be redistributed or otherwise used for any other purpose.
</i></small>
</clix:chapter>
</clix:documentation>
| 8,978 | Common Lisp | .l | 206 | 41.830097 | 196 | 0.768396 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | a4149020aec96cb604446988f0ff4d593fe3ff8c93031f5b239ac19618c3dc4f | 36,996 | [
-1
] |
36,997 | ta2.html | lisp-mirror_gendl/documentation/historical/doc/ta2.html | <html>
<head><title>Ta2 Introduction</title></head>
<body>
<h2><center> Ta2 Introduction </center></h2>
<i>Note: Ta2 is currently being redesigned with a jQuery and CSS styled front-end, and the name may change.
The basic functionality will remain the same.</i>
<pre>
Testing and Tracking Utility (Ta2)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
You can bring up any object in GDL, which mixes at least base-object
into its root-level part, by visiting the URL:
http://<host>:<port>/ta2
e.g. http://localhost:9000/ta2
Then enter your object's package::name (or package:name if exported).
Ta2 follows the "select-and-match" paradigm -- you first "select" a
mode of operation with one of the buttons, then "match" that mode to
any object in the tree or inspector by clicking.
Here is a rundown of the common buttons. They have tooltips which
will pop up when you hover the mouse over them. The ones with "..."
mean you first select the button to go into that "mode," then select
one or more objects either in the tree or in the inspector to apply
the selected action. The ones with "!" do an immediate action.
I... Inspect (make the inspector show the selected object).
DL... Draw Leaves in graphics viewport (replacing any existing).
DN... Draw Node in graphics viewport (replacing any existing).
AL... Add Leaves in graphics viewport.
AL*... Add Leaves individually (so they can be deleted individually).
DL... (duplicate label, needs renaming) Delete Leaves.
AN... Add Node in graphics viewport.
UN... Update selected node to reflect any compiled code changes.
B... Break on selected object.
UI... visit UI (if there is a main-sheet or write-html-sheet).
UH... visit UI in place of graphics viewport frame.
SR... Set Root of tree to selected object.
UR! Up Root one level in the tree.
RR! Reset Root to true root in the tree.
CL! clear the graphics and color/line thickness settings.
F! toggle Frames on and off (default is on).
U! Update from current node down to reflect any compiled code changes.
UF! Update from the root node down to reflect any compiled code changes.
Notes:
o The toplevel of any object tree instantiated in Ta2 has to mix in
at least base-object.
o You can directly start a Ta2 session by visiting the "/ta2" uri
in your web browser, then specifying either an object name
prepended with package name and single or double colon, e.g:
gwl-user::robot-assembly
or by specifying a Lisp expression which will evaluate to an object
instance.
o The Break command (either from Ta2 or from the developer links in a
normal UI) automatically sets toplevel self to the broken-upon
object in the Lisp console window. It no longer actually "breaks"
the webserver thread!
</pre>
</body>
</html>
| 2,957 | Common Lisp | .l | 56 | 47.892857 | 107 | 0.706843 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 8e9d8e02efbfe76639ec56d834ed382eecfaae49dc716f4439c0c67b598aa0f1 | 36,997 | [
-1
] |
36,998 | translators.txt | lisp-mirror_gendl/documentation/historical/doc/translators.txt | ;;
;; Copyright 2002, 2009 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
Conversion Tools for Code in Legacy Formats
===========================================
GDL provides a limited set of tools for converting legacy code into
the GDL native syntax. Currently the tools provide some capability for
converting code in the icad-style defpart format. While these tools
can help in migrating legacy code, it is recommended that you consider
doing new development in the GDL native syntax (described in the file
"usage.txt" and in the reference documentation), because this syntax
will be better supported by Genworks into the future and is intended
as a more general-purpose syntax for all types of applications, not
necessarily just CAD-centric ones.
This document provides a rough description of the mapping done by the
conversion tools; it is by no means exhaustive, and you should still
inspect the converted results (using the "convert-defparts" function
for example), to ensure that the generated GDL-native code is in fact
doing what you intended. Please understand that there are many subtle
differences in going from icad, a very large and complex Flavors-based
object system, to GDL, a relatively new and simple, small, CLOS-based
system. Legacy icad-style code will require testing and vetting, and
may require some rewriting, to ensure that it is functioning properly
with the GDL compiler and runtime system.
1 Loading the conversion tools
==============================
Load the conversion tools using the "require" facility as follows:
(require :defpart)
If you are licensed for the conversion tools, this will load without
errors (currently, all licensed GDL seats are licensed for the
conversion tools).
2 Converting code as a one-time process
=======================================
You can convert files from the legacy icad-style syntax to GDL-native
syntax with the "convert-defparts" function. This function takes
either a filename or a directory containing source files, and will
convert all defparts, defwriters, and defcompanions to the closest
available GDL analogs. Each defpart, defwriter, and defcompanion will
be placed in its own output file in the system temporary directory,
in a subdirectory named for the package, as follows:
/tmp/<package>/<entity-name>.lisp
For companions, the filename will be constructed from both the
"writer" name and the "object" name making up the companion.
3 Converting code on the fly
============================
You can also keep your legacy code in the legacy format, and the
conversion tools will convert it on the fly as part of the
compilation process. This is not recommended as a long-term strategy,
however, unless you have a requirement to continue using your code
both in the legacy icad environment as well as in the GDL
environment.
Appendix A: GDL Object Hierarchy
================================
For a normal GDL object, the class hierarchy is as follows:
T
..Standard-Class
...Vanilla-Mixin
....<local object type>
T and Standard-Class are built-in CLOS classes. Vanilla-Mixin is a
base GDL type which provides many of the foundational messages for a
GDL object. See the reference documentation on vanilla-mixin for
details. (note: the name for the GDL "vanilla-mixin" is inspired by
the old Steve's Ice Cream in Ann Arbor, MI, and is not connected with
"vanilla-mixin" from the Flavors object system).
Base-object is mixed into most of the geometric primitives, and you
can mix it into your own parts. It provides the basic messages for the
reference box sizes, position, and orientation, as well as other
standard spatial messages. See the reference documentation for
base-object for details.
Appendix B: Mapping from defpart to define-object
=================================================
Object Definition Sections
==========================
defpart -> define-object
Note that in all the examples below, message names can be normal
symbols, they need not be keyword symbols (although there is no harm
in using keywords). The symbol must be literally present at compile
time; if you want to evaluate a message name at runtime, you can use
the "evaluate" special symbol as in icad. In this case you should
stick with keyword symbols:
(setq key :length)
(the (evaluate key)) == (the length)
:inputs -> :input-slots (without default values):
...
:input-slots
(length width height)
...
:optional-inputs -> :input-slots (with default values):
Note that each input-slot is within its own set of parentheses,
unlike icad optional-inputs which are expressed in plist format:
...
:input-slots
((length 10) (width 20) (height (+ (the length) (the width))))
...
:modifiable-inputs, :modifiable-optional-inputs -> In GDL, these are
the same as :input-slots described above, with the addition of the
:settable modifier for :modifiable-optional-inputs. Required
inputs are by defaultt "settable" (i.e. modifiable) and the
:settable modifier is not required or added by the translator.
:attributes -> :computed-slots
Note that each computed-slot is within its own set of parentheses,
unlike icad attributes which are expressed in plist format:
:computed-slots
((length 10)
(width (twice (the length))))
Note also that message names can be normal symbols, they need not
be keyword symbols (although there is no harm in using keywords).
:modifiable-attributes -> :computed-slots with the :settable modifier
keyword:
:computed-slots
((length 10 :settable)
(width (twice (the length)) :settable))
:parts -> :objects
:pseudo-parts -> :hidden-objects
The :type of an object or hidden-object _must_ evaluate to a
symbol. This means you have to quote it even if it is a literal
symbol:
:objects
((mybox :type 'box
...))
Special keywords Within a Part Specification:
=============================================
:type (:series <num>) -> :type (:size <num>)
...
:quantify (:series <num>) -> :sequence (:size <num>)
...
:quantify (:variable <list>) -> :sequence (:indices <list>)
...
:with-attributes -> :pass-down
Positioning and Orienting
=========================
There are _no_ special positioning or orienting keywords such as
:on-top, :in-front, :postion-about, etc. In GDL you position and
orient using :center and :orientation as inputs to the object or as
messages defined within the object. See the reference documentation
on base-object for more information on this.
UPDATE: Based on a customer request, the translator has been
supplemented to to handle some of the symbolic :position
and :orientation semantics from icad. Currently this
feature is not documented and handles only a subset of the
keywords. Please contact us if you would like more
information on this feature.
:methods -> :functions
Messages which take arguments are called "functions" in GDL, since
they are more similar to Common Lisp functions than CLOS methods in
that the arguments to a GDL function cannot be specialized as one
would expect with a normal CLOS defmethod. Note however that since
GDL is CLOS-based, you are free to define normal CLOS defmethods
using GDL object types as argument discriminators, as well as mix
in standard CLOS classes with your GDL objects and vice-versa (this
ability to mix CLOS classes with GDL objects is true in theory, at
the time of this writing however it may need some testing and
vetting in real use).
As with other message names, the names for :functions can be normal
literal unquoted symbols or keyword symbols. The need not be
keyword symbols.
NOTE: GDL's define-object also supports a :methods section, which
contains true CLOS-style methods which can have their
arguments specialized in the same manner as normal CLOS
methods. This feature is not yet documented so please contact
us if you would like more information on it.
:spec-attributes, :layout -> Not supported.
Consider using the GWL web-based application server system as an
alternative to legacy PUI code. Contact us if you require
conversion support.
:trials -> Not supported.
If you are a supported customer, please do not hesitate to contact
Genworks for information on several alternative approaches to
searching and optimizing.
Appendix C: defcompanion, defwriter
===================================
In GDL the macros define-view and define-format provide some roughly
comparable functionality. Please see the reference documentation for
each of these macros for details.
| 9,625 | Common Lisp | .l | 191 | 46.732984 | 70 | 0.733326 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | a4dadfae9599a180ff8afa4a422f65ee5de8515fcde14a1253d18df767bd1423 | 36,998 | [
-1
] |
36,999 | make-gdl-app.txt | lisp-mirror_gendl/documentation/historical/doc/make-gdl-app.txt |
Instructions for Generating a Runtime
GDL or GDL/GWL Application
=======================================================
Please see the YADD Reference Documentation for make-gdl-app in the
GDL package.
| 231 | Common Lisp | .l | 5 | 39.4 | 68 | 0.542601 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | fea047efc49fad33010f85c90e423710814508554ad71b90e30f798be50b87d3 | 36,999 | [
-1
] |
37,001 | examples.gif | lisp-mirror_gendl/documentation/historical/doc/training-slides/g102/images/examples.gif | GIF89a™ & |