split inconsistency- why?

D

David Combs

SNIP
No. As I said, at some moment I updated the docs so that they
reflected my "current" understanding of the behaviour of split().
Unfortunately, even afer reading/cleaninig the source code, I could
not recognize all the quirks (boundary conditions!); so the
documentation is not fully "relevant".

Hope this helps,
Ilya

(1) Where is this Ilya-mostly-fixed documentation? (ie, which
version of perl?)

(2) Did you document, for yourself for maybe later use,
warning-examples of where it hit those boundary-conditions?

Even if you didn't have the time or energy to pursue
maybe fruitless task of (a) finding (not so simple) and
(b) fixing these remaining problem-areas,

it'd probably be useful to see what you did find --
just to know what *not* to approach in split-use.

(3) If this split is *that* weird and unpredictable,
how much work would it be for someone (good like you)
to implement a splitSmall with perhaps fewer features,
but at least do those things robustly, "as advertised"?

(I mean, Perl-5 will probably continue being used
in a major way (for even new projects) long past
when perl-6 starts getting used for serious work,
so it might be well worth it for someone *to*
do something like a splitSmall.)

(4) I haven't looked at perl-6 yet -- but what does *it*
provide for its own split-like capabilities?


Thanks!

David
 
I

Ilya Zakharevich

[A complimentary Cc of this posting was sent to
David Combs
(1) Where is this Ilya-mostly-fixed documentation? (ie, which
version of perl?)

I think most of the cleanup was pre-5.6. [Note that I did not claim
that all the people find my prose readable, only that it reflected the
behaviour-as-I-believed-it ;-]
(2) Did you document, for yourself for maybe later use,
warning-examples of where it hit those boundary-conditions?

Unfortunately, that time I had a lot of trust in my memory (maybe it
was justified, I can't remember now ;-).
Even if you didn't have the time or energy to pursue
maybe fruitless task of (a) finding (not so simple) and
(b) fixing these remaining problem-areas,

it'd probably be useful to see what you did find --
just to know what *not* to approach in split-use.

I think the problematic areas are split on a REx which can match an
empty substring, and split of an empty string. One example I remember
is

perl -wle "for (0..5) {@x=split /./, q(a) x $_, -1; print scalar @x}"
0
2
3
4
5
6
(3) If this split is *that* weird and unpredictable,
how much work would it be for someone (good like you)
to implement a splitSmall with perhaps fewer features,
but at least do those things robustly, "as advertised"?

As I said, this was already (mostly?) done in my

use strict 'split';

patch. But if it is not easly transferable to the current code base,
keep in mind that nowadays I will need external funding to seriously
work on Perl. (I wish I had one...)
(4) I haven't looked at perl-6 yet -- but what does *it*
provide for its own split-like capabilities?

I do not think that Perl 6 (at least in the state it was a year ago)
is going to be relevant for anything; it looks much harder than C++ or
Perl 5 to get fluent in.

Moreover, if I read what Larry said last year in his address, Perl 6
is dead. [Or course, both things may have improved during the year I
did not pay attention.]

Hope this helps,
Ilya
 
E

Eric Schwartz

Ilya Zakharevich said:
I do not think that Perl 6 (at least in the state it was a year ago)
is going to be relevant for anything; it looks much harder than C++ or
Perl 5 to get fluent in.

I'm not disagreeing with this-- though I really like some of the
things I saw at OSCON, it seems some changes were, if not backwards,
at least sideways in usability.
Moreover, if I read what Larry said last year in his address, Perl 6
is dead. [Or course, both things may have improved during the year I
did not pay attention.]

It was pretty clear from both Larry and Damian this year that Perl 6
is not only not dead, it's doing fairly well.

-=Eric
 
D

David Combs

Ilya -- thanks so much for your reply!


SNIP
I think the problematic areas are split on a REx which can match an
empty substring, and split of an empty string. One example I remember
is

perl -wle "for (0..5) {@x=split /./, q(a) x $_, -1; print scalar @x}"
0
2
3
4
5
6


As I said, this was already (mostly?) done in my

use strict 'split';

patch. But if it is not easly transferable to the current code base,

OOPS -- with the above line sitting there, I'm
not so sure that really understand the situation:

Ilya -- are you saying that you made all these fixes
to a pre-5.6 version -- and that those fixes *did not*
make their way into (then) code base, and thus
had no chance to be kept there (obviously)
in subsequent versions?

Or what?
keep in mind that nowadays I will need external funding to seriously
work on Perl. (I wish I had one...)
....

Hope this helps,
Ilya

Yes, it does, but also brought out that new question (above).

Thanks!

David
 
I

Ilya Zakharevich

[A complimentary Cc of this posting was sent to
David Combs
OOPS -- with the above line sitting there, I'm
not so sure that really understand the situation:

Ilya -- are you saying that you made all these fixes
to a pre-5.6 version -- and that those fixes *did not*
make their way into (then) code base, and thus
had no chance to be kept there (obviously)
in subsequent versions?

Yes, this is what I remember about the situation. (Since my memory is
not that good now, it *might* have been slightly different; I
definitely had a working patch; maybe what I sent to the list was not
the patch itself, but the description - though I doubt it. Anyway, it
was rejected.)

Hope this helps,
Ilya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top