operator: list-to-words
description:
list-to-words sp
convert the given superposition into a comma-separated word list
it is the inverse of words-to-list
examples:
list-to-words |x>
|x>
list-to-words (|x> + |y>)
|x and y>
list-to-words (|x> + |y> + |z>)
|x, y and z>
list-to-words (|a> + |b> + |c> + |d> + |e>)
|a, b, c, d and e>
friends |Eric> => |Sam> + |Harry> + |Mary> + |Liz>
list-to-words friends |Eric>
|Sam, Harry, Mary and Liz>
-- demonstration of inverse property:
words-to-list list-to-words (|a> + |b> + |c> + |d> + |e>)
|a> + |b> + |c> + |d> + |e>
future:
maybe also have an 'or' version too: 'x, y or z'
handle sequences better
see also:
words-to-list
Home