^
x underground ?y]
but
[^^
x underground ??y],
and with variable
x
having the value
[the national gallery].
What would the relevant database entry need to look like in order for the
search pattern to match it, in such a way that the variable
y
would be assigned the value
[trafalgar square]? Why?
[the nearest underground station to^
x is^
y]
Explain why the use of double up-arrows is preferable.
[mon june 29 - went fishing]
[tue june 30 - visited planetarium]
and so on.
define excise(item); vars x y; if database matches [??x ^item ??y] then [^^x ^^y] -> database; [^item has been removed] => else [sorry - ^item is not there] => endif; enddefine;
Imagine that your diary database (see the previous question) erroneously contains an entry for the nonexistent date: wed june 31. Show how the procedure excise might be used with a suitable list pattern to delete that particular entry. Using excise as a model, write a procedure replace, with two arguments, which finds a given entry in the database and replaces it with a new item.