forked from Juerd/shalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tracking.txt
86 lines (64 loc) · 1.88 KB
/
tracking.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
73
74
75
76
77
78
79
80
81
82
83
84
85
Goal: a system for tracking physical objects
With a simple barcode driven user interface, the user can specify that a Thing
is either in a Container, at a Place, or in the hands of a Person.
Object hierachy:
- Command
- Thing
has Location
- Location
can be "hidden", which also hides its Things from lists
- Container
does Thing
does Place
- Person
is-a Place
These all share a single namespace, and are stored as simple JSON-compatible
objects. Metadata is mostly stored as text strings; no need for fancy things.
Input is given as a list of scanned barcodes. The list ends with a command,
which then operates on the given list. A command can require further operands,
given after the command.
Command "is-at", "@":
The second operand of is-at has to be a Place. This command is implied when
scanning a Person after scanning one or more Things.
hammer
is-at
infodesk
-> result: hammer's new location is recorded
# Note: indentation provided for legability; not required in input!
spanner
hammer
is-at
infodesk
-> result: both hammer and spanner are now at infodesk
box42
is-at
shelfB3
-> result: box42's location is updated to shelfB3
hammer
spanner
-> result: incomplete input, no command given
Command "info":
box42
info
-> result: info about box42's contents (as a thing, and as a location)
hammer
info
-> result: information about the hammer's whereabouts and its recent history
hammer
screwdriver
info
-> result: error, info does not work on a list of objects
Command "help":
hammer
help
-> result: error, help does not take arguments
help
-> result: short help text
Command "cancel" or "abort":
hammer
cancel
-> result: empty stack
hammer
box42
abort
-> result: empty stack