Open fare opened 12 years ago
I have the similar idea.
It would be better if the matcher gives the somewhat similar interface to the constructor.
and I am thinking about this:
(array (5 5)
((_ _ _ _ _)
___________
a-row
___________
(a _____ b)))
a-row
is an displaced array(array (101 101)
((_ (column 99) _)
(column 49)
a
(column 49)
(_ _ _ _ _)))
if it doesn't accept an execute-time value, something like 49 might be a choice.
__49__
This is addressed in Trivia, in combination with inline patterns. https://github.com/guicho271828/trivia/blob/master/level2/arrays.lisp
To supersede cl-match, we need to be able to match arrays of arbitrary dimensions.
e.g. an array of rank 3:
same array using explicit dimensions:
same array using an array as a pattern:
Oh, what about checking the specialized array type? Makes things even worse.