2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
|
object as the origin of the movement, and that object's direction as the
direction of movement.
=== Pattern matching ===
Where an instruction is expected, you can have pattern matching. This can
be (P <pattern...>) or (,P <pattern...>) where the first one uses the
current location, and the second kind uses the position and direction of
the specified object as the matching. It pushes the found object to the
stack, or pushes zero if the pattern does not match.
<class>
Match an object of the specified class.
<dir>
Move in the specified direction. (This does not move any objects; it
only moves the cursor for pattern matching.) The direction can be
|
>
|
>
>
>
|
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
|
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
|
object as the origin of the movement, and that object's direction as the
direction of movement.
=== Pattern matching ===
Where an instruction is expected, you can have pattern matching. This can
be (<operator> <pattern...>) where the operator can be one of:
P
Find starting at the current location, with the current object's
direction. Pushes the found object, or zero if not found.
,P
Find starting at the specified object's location and direction. Pushes
the found object, or zero if not found.
=P
Searches everywhere. Pushes the found object, or zero if not found.
P*
Like P but push all found objects, or pushes nothing if not found.
,P*
Like ,P but push all found objects, or pushes nothing if not found.
=P*
Like =P but push all found objects, or pushes nothing if not found.
Inside the pattern, the following commands are allowed (although the
commands that push stuff to the stack should not be used in the patterns
with P* or ,P* or =P*):
<class>
Match an object of the specified class.
<dir>
Move in the specified direction. (This does not move any objects; it
only moves the cursor for pattern matching.) The direction can be
|