On 2008-09-27 at 21:48 +0100, Peter Stephenson wrote: > I appreciate there's a problem here, but I'm a little bit lost as to > what exactly you're after. Do you mean you'd like the "|" in the (j,|,) > to be treated as a pattern character, but the characters substituted > from the paramater named by b not to be expanded? What I was after wasn't anywhere near as good as what you provided. I was thinking that just as we have (q) to apply shell quoting, we should have a flag to escape pattern characters, which would have laboriously allowed me to do what you've just done much more easily by avoiding the whole problem. :) Escape+join+parse_that vs only-parse-the-join > If I'm not following, you may want white chococlate mousse followed by a > cappuccino. No, but my wife would love that. > Anyway, I'm not sure why I didn't do this ages ago, it makes testing > lists of alternatives vastly easier. Oh good, that's two different uses for it which means it's definitely more broadly helpful and it's not just me. *phew* Thanks. Okay, the two attachments provide the resulting clean set operations, with a stupid bug fixed and the intersection operations cleaned up, and the Test file for these. I'm not attached to any names, but I put the first file in Functions/Misc/load_dataset and the test file depends upon that. I just named load_dataset "load_dataset-post-20080927.zsh" to remind anyone using this that it uses your new (~) parameter expansion option. I'm also not attached to this code, since messing with 'let' to have zsh understand sets in arithmetic context is more appealing to me, every time I think about it. But the two approaches should be mutually compatible and this is the one I opted for. And I *just* realised that I needed set_equal, which sets $?, to provide a clean way to test for equality, since not only are the sets not maintained in sorted order, but the need to deal with arbitrary data would lead to bugginess. *sigh* Arithmetic with no equality tests. What was I thinking? Done. Do people think superset/subset/strict_superset/strict_subset would be useful too? -Phil