[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DEFSYSTEM
- To: BUG-LISPM at MIT-AI
- Subject: DEFSYSTEM
- From: Charles Rich <RICH at MIT-AI>
- Date: Fri ,22 Jan 82 18:42:00 EDT
Another suggestion for a basic facility which would
greatly increase the user programmability:
How about adding a psuedo simple transformation :IF
with the syntax (:IF condition (transf) (transf)).
Typically the condition would test a special variable
set by a keyword. This would provide a very general
method of conditionalizing the construction of systems based on
switches. I tried to construct this behavior two ways
but finally concluded it has to be installed as a builtin
feature. First I tried to do it as a defsystem-macro
which would be called as follows (with the appropriate
extra stuff to define :IF and a local variable for the
switch and a keyword to set it, etc.)
(DEFSYSTEM ...
(:IF *SWITCH* (:MODULE FOO "foo1") (:MODULE FOO "foo2"))
(:FASLOAD FOO))
but this lost because the condition was evaluated at
the time the defsystem was DEFINED instead of when MAKE-SYSTEM
was called.
Then I thought of trying to make :FASLOAD-IF a simple transformation
so I could say:
(:FASLOAD-IF *SWITCH FOO1 FOO2)
but that lost too because the syntax for simple transformations
is fixed by the parser.
I really think this would be a good idea. --Chuck.