tilde variables
new kind of variable
- ~v is instantiated with a list of symbols
- the elements of this list (not the list itself) are inserted when instantiated
- example
pattern is (~greeting ?name )
dictionary is ((~greeting (hello there)) (?name alice))
result is (hello there alice)
- ~v can be instantiated by an empty list
matching
- how many matches now?
- can have several matches for same pattern and datum
- example datum (hello friend alice)
pattern (~greeting ~name) produces three matches, these:
((~greeting (hello) (~name (friend alice)))
((~greeting (hello friend) (~name (alice)))
and also these:
((~greeting ()) (~name (hello friend alice)))
((~greeting (hello friend alice) (~name ()))