High-level MPPV
HMPPV is based on MPPV. It has some instructions that are a shorthand for commonly used combinations of instructions in MPPV. And in addition to the type of values provided by MPPV, it has strings.Instructions
Here,extfocus
(extended focus) is either a focus, or
a field selection that may also be compound (like x.f.f
).
The type for strings is str
and string values must be
delimited by double quotes ("), and a backslash (\) and a double quote
inside a string must be preceded (escaped) by an additional backslash.
The set of characters that may appear in a string are the alphanumeric
characters, the punctuation characters, the space, and the newline in the
form of \n
.
extfocus = new
- Create a new atom and assign it to
extfocus
. Whenextfocus
is a field selection, it must be of type atom. extfocus1 = extfocus2
- Assign the value in
extfocus2
toextfocus1
. Whenextfocus1
is a field selection, the field must be of the same type as the value inextfocus2
. extfocus.+f
- Add a field of type atom to the atom selected by
extfocus
. extfocus.+f = new
- Add a field of type atom to the atom selected by
extfocus
, and assign it a newly created atom. extfocus1.+f = extfocus2
- Add a field of type atom to the atom selected by
extfocus1
, and assign it the aotm selected byextfocus2
. extfocus.+f:t
- Add a field of type
t
to the atom selected byextfocus
. extfocus.+f:t = u
- Add a field of type
t
to the atom selected byextfocus
and assign it the valueu
. extfocus1.+f:t = extfocus2
- Add a field of type
t
to the atom selected byextfocus1
and assign it the value selected byextfocus2
. extfocus.-f
- Removes the field
f
from the atom selected byextfocus
. Returnsfalse
when the atom has no fieldf
. extfocus/f
- Returns
true
when the atom selected byextfocus
has a fieldf
, andfalse
otherwise. extfocus1 == extfocus2
- Comparison of the values selected by
extfocus1
andextfocus2
. Returnstrue
when the values selected byextfocus1
andextfocus2
are the same or contain the same atom, andfalse
otherwise. extfocus?
- Returns
true
when the value selected byextfocus
is an atom, andfalse
otherwise. extfocus?t
- Returns
true
when the value selected byextfocus
is of typet
, andfalse
otherwise.
Example
The following list of MPPV instructionsh1 = x.f; h1 = h1.f; h2 = new; h1.f = h2
can be written with HMPPV as
x.f.f.f = new