On Sun, 2 Dec 2001, Sam Tregar wrote:
> On Sun, 2 Dec 2001, Michael L Maraist wrote:
> > On Sunday 02 December 2001 02:47 pm, Brent Dax wrote:
> > Perl5 just used a string as the generic c-struct handle as far as I know..
Well, generaly what I see is that when c-struct-like data (that is,
byteformatted rather then stringy data) is being read from a file, or
otherwise being manulapiated in pure perl, a string is used.  OTOH, when
the same types of maniulipuations are being preformed by XS code...

> Actually, most XS I've seen uses an SvIV and just stores a pointer using
> PTR2INT.  Then when you need to access pointer you just do an INT2PTR and
> get it back out.  Since Perl5's IV is garaunteed to be large enough for a
> pointer this all works fine.
This is a much better wording of why I wanted sizeof(INTVAL) >=
sizeof(void*).  

Speaking of which, I'd like to see a "raw" or "semanticless"
parrot chartype, which cannot be converted to anything else.  This would
let you use strings to manulipulate raw data without worring about any
semantic value it might have.  (And also keep you from having to worry
about the bytes 30 78 44 45 41 44 32 45 45 46 in a bitmap becomming the
integer 3,735,928,559.)  I just don't like implying a semantic where their
isn't one.

(BTW, this doesn't acatualy have much to do with parrot; I didn't like
implying the semantic in perl5 either, it's just that there's a good way
to deal with it in p6, because we have our choice of semantic.)

        -=- James Mastros
-- 
"In the case of alchemy v chemistry the chemists know whether it will
probably go bang before they try it (and the chemical engineers still duck
anyway)."       -=- Alan Cox



Reply via email to