On Fri, Mar 18, 2005 at 05:01:50AM -0600, Rod Adams wrote:
: I'll try to come up with something decent, if no one beats me to it.
: Sadly, the C style  hex2int, oct2int might be the least confusing, but 
: heinously ugly.

Yes, though there are two difficulties right there in the names:
hardwiring the radix, and assuming they won't be used for fractional
values.  So they'd probably be curried from something more general.

: Could some form of C<:=> do this?
:  my uint4 @nibbles;
:  my str   $ascii;
:  @nibbles := $ascii;
:  $ascii = 'Perl Hacker';
:  say @nibbles[4];
: Would probably need some other bind operator, for the sake of type checking.
: Maybe resurrect the C/C++ union construct. hmm. I don't know.

Yes, that should probably fail the bind.  I was thinking something more
on the lines of the old "is from(@array)" that we were using to feed
arrays to rules, but since we can do that directly now, we don't need
"is from", which is wrong anyway.  "is mapped" or "is viewof" is closer.
It's really a kind of tie if you think of it in Perl 5 terms.

: But I think we can keep C<vec>, even spruce it up a little, and then 
: neglect to import it into *:: if we find something better.

Very likely there is a P5:: space for all the emulations that p5-to-p6
will rely on when it is uncertain how to refactor.  This could go there
if we want to discourage people from using it for new stuff.


Reply via email to