|
|
1.1 root 1: Date: 25 Apr 1980 1546-PST (Friday)
2: From: mike at UCLA Computer Science VAX (Mike Urban)
3: Subject: ATTN: DDL Implementors
4: To: cc (UCLA Computer Club)
5:
6: I would like the following changes made in DDL:
7:
8: 1) Friendlier Parsing. You should be able to say
9: give troll the knife
10: and get away with it (with "knife" as Dobj and "troll" as Iobj). You
11: should get messages like "I don't know how to tke" in the event
12: of a bad verb, and "I think 'north' is a verb" in the event
13: of a weird parse like "push north wall". You should be able
14: to say things like "e.s.s.take thing. eat thing. look" and have
15: the parser treat the "." as equivalent to and end-of-line.
16: /* ACCOMPLISHED 6/13/80. Syntax errors are now
17: of the form "I don't know how to xxx" if an unknown
18: word is encountered (the whole word, not just 5 letters
19: is printed); "I don't know the word 'xxxxxx'" for other
20: unknown words; and "I don't understand, because I
21: think 'xxxxxx' is a [noun/verb/adjective/etc]" for
22: other syntax errors. The separator was already
23: built into the lexer, but it's a comma, not a period.
24: And VERB IOBJ DOBJ is a legal syntax now, but
25: VERB PREP IOBJ DOBJ isn't (tho it's easy to add) */
26: MAYBE
27: (if it isn't hard), you should be able to say "take this, that, the other"
28: and have a more sophisticated control loop which causes it to act
29: like "take this. take that. take the other" with the EXCEPTION that
30: no daemon/fuse processing is performed (no turn increment) and that
31: the whole thing can be short-circuited by an appropriate Exit code.
32:
33: 2) Generalized routine and object handling. The routines associated with
34: objects should be properties of that object just like the others. The
35: constants that tell WHICH property is, say, the Action property should
36: be predefined. So ($setp room1 LDESC Rubbl) would set the long
37: description of room1 to the routine Rubbl (which describes the rubble
38: left by the explosion you just triggered...).
39:
40: /*** ACCOMPLISHED 6/6/80 ***/
41:
42: 3) Improved global handling. The programmer shouldn't have to know the
43: "address" of his globals. Instead, a construct like
44: VAR score
45: would be the equivalent of saying "score = xxx" where xxx is one less
46: than the last VAR done.
47:
48: /*** ACCOMPLISHED 5/29/80 ***/
49:
50:
51: 4) Improved grammeme access. There should be predefined VARs which
52: contain the values of ($verb) ($dobj) and ($iobj). You should
53: be able to re-assign these. SO, you should be able to say
54: turn off lamp
55: and the PreVerb routine for "turn" might contain something like
56: (($eq @Iobj off):
57: ($setg Verb douse)
58: ($setg Iobj 0)
59: )
60: /*** Accomplished 6/12/80; Only change in
61: ddlrun is #defines for verbtodo, etc */
62:
63: Because verbs don't have properties, we may wish for functions
64: to access their preverb and action routines as well.
65:
66: 5) String handling: It'd sure be nice to have someone type
67: incant "abra ca dabra"
68: and be able to talk about ($subs Dobj @var 1) or ($indx @Dobj "abra")
69: or whatever. I don't know exactly how to implement it yet.
70: /*** Accomplished 7/28/80; STRINGs are negative-valued
71: objects. If the lexer gets a string, it puts it into
72: a temporary string area (that is flushed every turn) and
73: returns an index (not pointer) into that are as a negative
74: number. The parser knows about these and can handle
75: verb string and verb string prep iobj sentences.
76: (the latter being for "Incant "rise" over seed".)
77:
78: If the dobj or iobj of an input is a string, the dobj
79: and iobj routines called are the ones associated with
80: the object STRING (if such is defined by the DDL
81: programmer). At present, the functions $substr, $length
82: and $eqst are defined. $substr returns a negative
83: pointer into the temp string area; this can be stored
84: in a global, for example. A permanent string area
85: is available, but I haven't written the function
86: ($sets glbl string) which would move the string to the
87: permanent area and put its index therein into glbl.
88: Mike ***/
89: /*** On 8/20/80, I added a new function (which, mirable dictu,
90: will allow coding of the "echo" room!), ($read), which
91: pauses, gets a line of input, and returns the line as
92: a string! Gee, if we code up ($pars str verb dobj iobj)...
93:
94: 6) Ctrl-D should terminate the program. Ctrl-C should interrupt whatever
95: is happening and begin a new turn.
96: Note that this may leave things in a bad state.
97:
98: 7) New language construct: (WHILE condexp : formlist) is essentially
99: equivalent to (condexp : formlist ($____ formlist+condexp)) where
100: "($____ formlist+condexp)" is a new operator, JUMPB (jump back),
101: which is just like the current $.... jump forward instruction, but
102: (obviously) negative, and unconditional. It goes back exactly to
103: the beginning of the test.
104: /*** ACCOMPLISHED 8/18/80 --Mike ***/
105:
106: 8) New routine ($rand n) produces a somewhat random number in the range
107: 1..n . /*** ACCOMPLISHED 8/18/80 ***/
108:
109: 9) DDLRUN sources should be reorganized so as to enable recompilation
110: of less than the entire program if some less global change (such
111: as the addition of a new routine, or a bug fix in the parser) is
112: made.
113: /*** Somewhat accomplished 10/80. Still needs
114: work. In particular, changes in extvars.c must
115: be reflected in extvars.h ***/
116:
117: 10) The symbol table, and the hash routine, are simple-minded. The
118: 5-character limitation on names is a real pain for some people.
119: For example, you can't even fake the Zork puzzle room by allowing
120: someone to say "push northern wall".
121: These changes don't have to go together.
122:
123: /*** ACCOMPLISHED(!!) 11/80. Identifiers are pretty
124: much as long as you like. The symbol table,
125: now alphabetized, contains indices (not pointers)
126: into a pool of identifiers that starts at
127: sbrk(0). A binary search algorithm is used.
128: This will enable a future version to respond
129: correctly to unambiguous abbreviations for
130: things at runtime (like news for the aard
131: newspaper, for a cogent example). This
132: hasn't been tested for portability to a
133: PDP-11 under V7, so beware. As of 11/18,
134: the symbol table is still unencrypted ***/
135: /*** The runtime parser recognizes unambiguous
136: abbreviations. The symbol table is still
137: unencrypted. 1/81 ***/
138:
139: 11) It should be available on a micro.
140: /* Not yet. But the thinking has begun! */
141: /* This will necessitate some rearchitecture
142: especially wrt buffering of routines/strings */
143:
144: 12) The ACTION routine for verbs should execute AFTER the action
145: routine for your room; this enables east(ACTION) to correctly
146: default to ($say "Can't go that way.") and allow one to generally
147: live without $hit and $miss, crocky routines that they are.
148: See ../sample (espec. transit.ddl) for a specimen of how this works.
149:
150: /* 11/80 */
151:
152: 13) Routines that get the action and preaction routines for verbs
153: should be made available.
154:
155: 14) Fuses and daemons aren't QUITE right (fuses go off after your daemon
156: has typed a prompt, for a real-world example). Maybe they
157: shd be on a homogenized priority queue?
158:
159: 15) It should be frozen real soon.
160: /* As of 1/81, we're STILL thinking in terms
161: of "just this ONE more feature..." Damn. */
162:
163:
164:
165: Mike
166:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.