<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear all (the few, the self-chosen :) lurking here)<div><br></div><div>I have been fiddling about with a "pattern compiler" to be made part of a compiler-macro for MATCH-CASE. After reading a few things here and there, I came to the conclusion that for CL and CL-UNIFICATION there is no need for anything particularly sophisticated (things like "partial test/evaluation merging" and whatnot), but I also started to think that maybe it would be better to introduce new syntax. Something along the lines of</div><div><br></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"> </span>(PAT (<object> &key …) <clauses>)</font></div><div><br></div><div>Now. This may look simple, but suppose you wanted to do something like</div><div><br></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"> </span>(let ((x 42)) (y 123))</font></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"> </span> (pat (x y)</font></div><div><span style="font-family: Courier; "><span class="Apple-tab-span" style="white-space:pre"> </span> ((42 123) t)</span></div><div><span style="font-family: Courier; "> (_ 'not-matched)))</span></div><div><br></div><div>Now, while in principle this is easy (you just have a "list" instead of an object as first element), things may become hairy very soon when you want to add keywords affecting the matching process (cfr the MATCH-CASE syntax</div><div><br></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"> </span>match-case (<object> &key errorp default-substitution) <clauses></font></div><div><br></div><div>where grouping is used for the keyword variables <span style="font-family: Courier; ">errorp default-substitution</span>). With this consideration in mind the above example would become</div><div><br></div><div><div><font face="Courier"><span class="Apple-tab-span" style="white-space: pre; "> </span>(let ((x 42)) (y 123))</font></div><div><font face="Courier"><span class="Apple-tab-span" style="white-space: pre; "> </span> (pat <font color="#ff2600">((x y))</font></font></div><div><span style="font-family: Courier; "><span class="Apple-tab-span" style="white-space: pre; "> </span> ((42 123) t)</span></div><div><span style="font-family: Courier; "> (_ 'not-matched)))</span></div></div><div><br></div><div>So the questions I have for you are two: (1) do you have any ideas about syntax, even at the cost of introducing some "spurious infix" bit? (2) the PAT above should be really be named MATCH-CASE, but that is already taken; for the sake of backward compatibility, do you think that PAT or CASE-MATCH or SELECT or whatever should be used for the new syntax?</div><div><br></div><div>Cheers</div><div><br><div>--<br>Marco Antoniotti<br><br></div><br></div></body></html>