In <[EMAIL PROTECTED]>, Bart Lateur writes:
:Yes, but RFC 93 has some other disadvantages.

In respect of the number of calls, there seems nothing in RFC 93
to stop us permitting the callback to return more or fewer than the
requested number of characters. So a filehandle, for example, could
choose to return some multiple of 4K blocks for every request. A
socket conenction that applies a line-based protocol would probably
read a line at a time, while another socket might return just those
characters available to read without blocking.

:Furthermore, where is the resulting buffer stored? People usually still
:want a copy of their data, to do yet other things with. Here, the data
:has disappeared into thin air. The only way to get it, is putting
:capturing parens in the regex.

It seems to me that $` and $& are the right solutions here. I assume
that perl6 will not allow this to cause an overreaching performance
problem. In this context we have the additional advantage that the
only copy of the accumulated string is owned by the regexp engine,
so no additional copy need be made to protect it.

:Compared to that, RFC 93 feels like a straightjacket. To me.

Strangely it feels uncommonly liberating to me.

:You may have to completely rewrite your script. So much for code reuse.

I don't believe that it need be so painful to take advantage of it
in existing code. We can ease that by providing a selection of
helpful ready-rolled routines for common tasks.

Hugo

Reply via email to