* Rev. Chip <rev.chip@gmail.com> [2012-07-12 00:35]:
> On Wed, Jul 11, 2012 at 12:38:41PM -0700, Father Chrysostomos via RT wrote:
> > Which part of the baby? Your patch, if I remember, exposed the
> > stringiness or numericity as an API [...]
>
> Yes, insofar as conversions no longer lose track of the original type.
>
> > which I think is a bad idea; not for technical reasons, but because
> > it is too much of a cultural shift.
>
> Can't agree. Culture is subjective and interactive; we both form it
> and are formed by it. And we interact with the outside world, some of
> which has very strong opinions on strings vs. numbers. Ever ask Larry
> if he wishes he'd made a boolean type? I think he would, and we'd all
> be better off.
This is a nonsensical statement. If it were true on the face of it then
the smartmatch operator would not be causing the problems that it does.
The problem is that a language is a whole. You cannot change parts of to
work in ways that do not harmonise with other parts and expect the whole
to continue to fit together equally well. A successful â€cultural shiftâ€
of the sort you postulate would in truth require razing most of the
language and doing over the entire design starting from key decisions
about the data model. (I believe if you did a good job with it based on
the premises implied, you would be led to a design much alike Python in
its data model and set of operators. That is not a bad thing per se but
I would have less interest in the result than I do in Perl as she is.)
> > If we start allowing code to say if(is_string($arg)){...} then this
> > will open up a can of worms. We will just end up with more CPAN
> > modules that don’t ‘do things right’, partly because ‘right’ has
> > been redefined in some peoples’ minds.
Two responses, FC:
1. In most cases such code will be as buggy as code that tries to look
at the UTF8 flag now. I believe the response should then be the same
as it is now to people who write code that looks at the UTF8 flag:
“stop thatâ€.
2. It does not make a good argument against the patch because people
*already* try to write such code with such as `looks_like_number`;
this patch would at least allow such code to work better in those
cases where that is motivated by a legitimate desire, of which cases
there are a few (most prominently to my mind, JSON de-/serialisers).
Ultimately I believe Chip’s patch really makes no serious difference to
the language, but will alleviates some of the pain when having to do
things in Perl that cut against its grain to some extent. That seems
desirable.
> I can't undererstand this argument. It's not that I disagree with it,
> I don't understand what the argument *is*. Could you please be more
> specific? Beware of being persuasive with a slippery slope argument,
> too.
I think the issue with his argument is that you overestimate the impact
of your patch on the semantics of the language, or at least you present
it in language that so overestimates it. And after unwittingly following
you into that ditch, FC is noticing and complaining that down there is
not a good place to be. In a manner of speaking the slope is yours and
the slip is his. :-)
> > There is also the problem that all dumping modules will become
> > officially buggy overnight.
>
> Now I know you're missing the point. Dumping modules already
> distinguish numbers from strings.
And the reason it isn’t causing problems is that no one is relying on
that distinction in any deep way, as well they still shouldn’t even once
your patch is in place. He who starts to will find that problems follow.
Essentially your patch, to me, boils down to more reliable serialisation
for formats with a data model pickier than Perl’s, as well as fewer bugs
in the bitwise operators (which really means those operators should be
redesigned and the old design removed with prejudice; unfortunately that
is a lot less realistic than it is for smartmatch), and suchlike polish.
Therefore I like it.
Regards,
--
Aristotle Pagaltzis // <
http://plasmasturm.org/>