-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnames_and_things.txt
72 lines (45 loc) · 2.47 KB
/
names_and_things.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
We maintain a strong distinction between names and things.
Names are character strings, while things are motes.
Names are found in lexicons, and can be placed into the current
lexicon with the NAME [name] [thing] operator.
Things may be referred to by their mote identifier strings
as well as by their names, from anywhere. Avoid revealing Mote
identifier strings.
As the current lexicon does not persist beyond the life
of the parser containing it, the REMEMBER [name] operator
serves to copy a name to thing mapping into the lexicon
one level out from the current lexicon.
Within a persistent WORKSPACE, REMEMBER serves to make a name
persist.
Within a SAFE, REMEMBER will write names into the empty outer
lexicon.
Reference:
NAME name thing
stores the thing into the parser's current lexicon under the name. Name must be a string.
REMEMBER name
Copies the thing in the parser's current lexicon, if any, to the outer lexicon.
FORGET name
Deletes the lexicon entry for name in both the current and outer lexicons.
** IMPORTANT: do not prefix the name in the REMEMBER and FORGET operators
with the STRING string-escaping operator. They have that built into them, and
doing so will overwrite or erase the STRING operator.
LIST
list all available names in the current parser's lexicon, by level
WORKSPACE
creates and returns a new workspace mote one in from the current scope. This workspace can be used to
refer to the current lexicon from other places. Workspaces are intended as "user accounts" so
multiple projects can coexist in the same Motion server.
SAFE
Creates and returns a new empty workspace, with a copy of the current scope as the outer lexicon.
This has the effect that only names that have been NAMEd or PULLed into the current lexicon are available.
PULL name
copies the looked-up name into the current lexicon so that it will be available within a SAFE zone. Like
NAME, REMEMBER and FORGET, this is a macro that automatically escapes the token following it into string form.
PULLAS alias STRING outername
like PULL, but takes an initial name argument (like name). The name of the already-named thing (which must
be in an outer scope) must be escaped with the STRING escaping operator.
ENTER workspace
parse in the specified workspace
EVALIN workspace string
treat the provided string as Motion input to a parser operating in the workspace. The string is evaluated
one layer in from the workspace, so symbols NAMEd in the string do not persist in the workspace but REMEMBERed ones do.