[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Speaking of Syntax
Date: Tue, 10 Nov 87 07:03:43 PST
From: David Kriegman <kriegs@coyote.stanford.edu>
Speaking of defining syntaxes, I've defined some syntaxes such as
has been mentioned, and I'd like the editor to be "smart" about the
syntax when it formats the s-expression. The default s-expression
puts in too many spaces. My syntax looks something like this: [...]
If you are defining a macro you can define the indentation for
zwei using declare as in the examples below.
;;; 1Example 1:
0(defmacro 2def-animal 0(name &body attributes)
(declare (zwei:indentation 1 1))
`(def-animal ',name ',attributes))
(def-animal BABOON
:species monkey
:weight (0 100)
:color brown)
;;; 1Example 2:
0(defmacro 2def-animal 0(name &body attributes)
(declare (zwei:indentation 1 3 3 2))
`(def-animal ',name ',attributes))
(def-animal BABOON
:species monkey
:weight (0 100)
:color brown)
You can also use the function ZWEI:DEFINDENTATION to define special indentations.
(def-animals 2(baboon chimp)
0 :species money
:weight (0 100))
(zwei:defindentation (def-animals 1 1))
(def-animals 2(baboon chimp)
0 :species money
:weight (0 100))
I define several indentations that over ride some of the defaults.
They are listed below:
(zwei:defindentation 3(defvar 0 7 1 4 2 1)0) ; 4For the documentation string
0(zwei:defindentation 3(defconstant 0 12 1 4 2 1)0)
(zwei:defindentation 3(defparameter 0 13 1 4 2 1)0)
(zwei:defindentation 3(defflavor 0 10 1 5 3 1)0) ; 4For flavor definitions
3(0zwei:defindentation (3:default-init-plist 0 3)0)
(zwei:defindentation 3(make-instance 1 5)0)
(zwei:defindentation 3(tv:make-window 1 4)0) ; 4Misc.
0(zwei:defindentation 3(0define-presentation-to-command-translator3 0 10 1 5 3 1)0)
(zwei:defindentation 3(:layout 0 8)0) ; 4Constraint frames
0(zwei:defindentation 3(:sizes 0 7)0)
(zwei:defindentation 3(login-forms 0 3)0) ; 4Login forms in lispm-init files
0(zwei:defindentation (if 3 0)) ; 4Make multiple else clauses look funny.
0(zwei:defindentation 3(0define-presentation-to-command-translator3 0 10 1 5 3 10))
-- David D. Loeffler