Re: Not-so-smart matching (was Re: How to make a new operator.)

2012-03-25 Thread Damian Conway
yary suggested:

> In a situation like this, I reach for a thesaurus

The standout from that list for me is: 'consonance'.
Second favorite is: 'gibe' or 'jibe'.

But the underlying operation is .ACCEPTS(),
so perhaps the operation should be referred to
as "acceptance" or "acceptibility".

Damian


Re: Not-so-smart matching (was Re: How to make a new operator.)

2012-03-25 Thread yary
I also like "agreement", "conformance"... In a situation like this, I
reach for a thesaurus- very useful when looking for just the right
name for a variable/method name/way to describe a concept. Here's a
grab bag to start with:

accord, agree, conformance, conformation, conformity, congruence,
congruity, consensus, consonance, correspondence, harmony, unison
agree, fit, correspond, compeer, meet, gibe, pair, mate, twin, cope with, touch

Fit, correspond, congruity, harmonize seem like other good
descriptions for the concept. Fit is especially good due to its
brevity, and congruence is good due to the use of ~~ as the smartmatch
aka congruence/fitness/agreement/harmonizing/correspondence/conformance
operator.

(Bikeshed?)

-y



On Sun, Mar 25, 2012 at 12:35 AM, David Green  wrote:
> On 2012-March-21, at 6:38 pm, Daniel Carrera wrote:
>> The idea of smart-matching a function just doesn't quite fit with my brain. 
>> I can memorize the fact that smart-matching 7 and &foo means evaluating 
>> foo(7) and seeing if the value is true, but I can't say I "understand" it.
>
> Maybe it just needs a better name.  "Match" implies that two (or more) things 
> are being compared against each other, and that's how smart-matching started 
> out, but it's been generalised beyond that.  The underlying .ACCEPTS method 
> suggests "acceptance"... but that's too broad (a function can "accept" args 
> without returning true).  "Agreement" fits, in the sense of "that [food] 
> agrees with me", but I think it suggests equality a bit too strongly.  
> "Accordance"?  "Conformance"?  "Validation"?  That seems a good match (ahem) 
> for the concept: ~~ checks whether some value is "valid" (or "desired"?) 
> according to certain criteria.  The obvious way to validate some value 
> against a simple string or number is to compare them; or against a pattern, 
> to see if the value matches; but given a function, you check the value by 
> passing it to the function and seeing whether it says yea or nay.
>
> I'm not sure "validation" or "validity" is the best name, but it conforms 
> better to what smart-"matching" does.  Or "conformance"  Hm.  But 
> terminology that sets up the appropriate expectations is a good thing.
>
>
> -David
>


Not-so-smart matching (was Re: How to make a new operator.)

2012-03-24 Thread David Green
On 2012-March-21, at 6:38 pm, Daniel Carrera wrote:
> The idea of smart-matching a function just doesn't quite fit with my brain. I 
> can memorize the fact that smart-matching 7 and &foo means evaluating foo(7) 
> and seeing if the value is true, but I can't say I "understand" it.

Maybe it just needs a better name.  "Match" implies that two (or more) things 
are being compared against each other, and that's how smart-matching started 
out, but it's been generalised beyond that.  The underlying .ACCEPTS method 
suggests "acceptance"... but that's too broad (a function can "accept" args 
without returning true).  "Agreement" fits, in the sense of "that [food] agrees 
with me", but I think it suggests equality a bit too strongly.  "Accordance"?  
"Conformance"?  "Validation"?  That seems a good match (ahem) for the concept: 
~~ checks whether some value is "valid" (or "desired"?) according to certain 
criteria.  The obvious way to validate some value against a simple string or 
number is to compare them; or against a pattern, to see if the value matches; 
but given a function, you check the value by passing it to the function and 
seeing whether it says yea or nay.  

I'm not sure "validation" or "validity" is the best name, but it conforms 
better to what smart-"matching" does.  Or "conformance"  Hm.  But 
terminology that sets up the appropriate expectations is a good thing.


-David