MATCH dialect (name conflict with Ren-C)


#1

Ren-C’s MATCH is a powerful variadic filtering function for values, which can even let you just call the filter function on an argument while extracting that argument as the result:

>> match parse "aaa" [some "a"]
== "aaa" ;-- whoa! how'd it do that? >:-)

In any case, that name conflicts with MATCH in QuarterMaster, which is different:

match ["three" two 1] [
    one: integer!
    two: opt 'two
    three: some string!
    four: any issue!
]
== make object! [
    one: 1
    two: 'two
    three: ["three"]
    four: _ ;-- e.g. none
]

This seems a lot like DELECT, which was discussed recently. I’d be interested to understand the differences, and if the two could be merged. If so, I think it would probably be good to change the name to not conflict with Ren-C’s MATCH, because that is something I think people are really going to want to use (once they realize how great it is!) :slight_smile:

Source code for QuarterMaster MATCH is here:


#2

Naming of functions like this is a problem. With 'match I think of two things that do or do not match, that can be there are equal or they do share some common ability.
DELECT afaik does not exist as a true word in English. DEcode diaLECT. What it is doing, as I understand it, like your 'match also, is kind of (re)ordering the arguments.
I suggest that the name of this (or the new) function reflects more this behaviour.
Some suggestions are REORDER CATALOG CODIFY LINE-UP
(As always wordhippo.com is my friend here).


#3

There’s more documentation for delect and in the wild use so I’d suggest keeping the name, and renaming QM’s match.