develooper Front page | perl.perl5.porters | Postings from November 2017

Re: Revisiting smart match

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
November 28, 2017 18:06
Subject:
Re: Revisiting smart match
Message ID:
20171128180617.7634.qmail@lists-nntp.develooper.com
Zefram wrote:
> Father Chrysostomos wrote:
> >I do like 'when'.  But how about 'have' meaning 'when we have'?
>                                        
> "when" reads reasonably, but has other problems that I mentioned.  "have"
> reads poorly, especially in its postfix form.  I'm not happy with either
> of them.
> 
> It's difficult to squeeze as much meaning as "handle all topics of this
> kind by this means, and this resolves the topic without needing to
> consider it further" into one word, let alone a keyword-length word.

of this kind = thus
by this means = thus

But thus(foo) is awful.

> I'd hoped that my perusal of Roget would turn something up, but it
> produced very little.  The thought process with "having" and "being"
> was that we can't get the connotation of resolution in the word, so best
> to concentrate on the other part.

I think I will continue to misread 'being' as 'it being', not as 'it
being that', which gives it the wrong meaning.

> But in the case of the truth-value
> condition, the other part is just "if", so we need a synonym for "if", and
> we had therefore better make it as distinct from "if" as possible to at
> least hint that it's not the same thing.

And we end up with 'when', which is often interchangeable with 'if'.

> The other keyword needs to mean
> "if the topic is of this kind", which is still a lot to fit into one word.

whenlike (I know, awful.)
suppose

Based on Eirik's comment, I think I like my 'beit' idea even more now,
because it has an explicit topic in it ('it'), showing that you do not
need to repeat 'it' ($_).

> >    do_stuff() generally;
>                                        
> That looks pretty Perlish to me.  The postfix qualifier is a distinctively
> Perlish construct, and with the keyword being an adverb the statement
> reads naturally as an English sentence, which is a Perlish concern.

It would be shorter to write

    do_stuff(); last;

> >                               I do not expect ever to use 'default',
> >since it really serves no purpose.
> 
> In the spirit of breaking everything at once, is it worth removing
> "default" as being too misleading?

Maybe so.

> As you point out, it behaves nothing
> like the C keyword from which it's derived.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About