PDD 4: Internal data types

2001-03-02 Thread Dan Sugalski
Yes, I know I promised the GC PDD, but this was simpler and half finished. Now it's all finished, and can be used some in both the vtable PDD and the utility functions PDD. -Cut here with a sharp knife =head1 TITLE Perl's internal data types =head1 VERSION 1 =head2 CURRENT

Re: PDD 4: Internal data types

2001-03-02 Thread Dan Sugalski
At 01:36 PM 3/2/2001 -0500, Andy Dougherty wrote: On Fri, 2 Mar 2001, Dan Sugalski wrote: =head2 Intger data types Integer data types are generically referred to as CINTs. There is an CINT typedef that is guaranteed to hold any integer type. [gazing into crystal ball . . . ] I predict

RE: Questions about PDD 4: Internal data types

2001-03-02 Thread Dan Sugalski
At 02:01 PM 3/2/2001 -0500, wiz wrote: =item BINARY (0) =item ASCII (1) =item EBCDIC (2) =item UTF_8 (3) =item UTF_32 (4) =item NATIVE_1 (5) through NATIVE_3 (7) A little more complex, but why not use bits 3-7 as actual flags: 7|6|5|4|3|2|1|0 0 0 0 0 1 x x x = UTF UTF_8 0 0 0 1 1 x

Re: Questions about PDD 4: Internal data types

2001-03-02 Thread Nicholas Clark
On Fri, Mar 02, 2001 at 02:01:35PM -0500, Dan Sugalski wrote: At 02:01 PM 3/2/2001 -0500, wiz wrote: =item BINARY (0) =item ASCII (1) =item EBCDIC (2) =item UTF_8 (3) =item UTF_32 (4) =item NATIVE_1 (5) through NATIVE_3 (7) A little more complex, but why not use bits 3-7 as

Questions about PDD 4: Internal data types

2001-03-02 Thread Hong Zhang
Integer data types are generically referred to as CINTs. There is an CINT typedef that is guaranteed to hold any integer type. Does such thing exist? Unless it is BIGINT. Should we scrap the buffer pointer and just tack the buffer on the end of the structure? Saves a level of indirection,

Re: Questions about PDD 4: Internal data types

2001-03-02 Thread Dan Sugalski
At 10:31 AM 3/2/2001 -0800, Hong Zhang wrote: Integer data types are generically referred to as CINTs. There is an CINT typedef that is guaranteed to hold any integer type. Does such thing exist? Unless it is BIGINT. I'm confused here, looks like you're missing some words from those

Re: PDD 4: Internal data types

2001-03-02 Thread Andy Dougherty
On Fri, 2 Mar 2001, Dan Sugalski wrote: =head2 Intger data types Integer data types are generically referred to as CINTs. There is an CINT typedef that is guaranteed to hold any integer type. [gazing into crystal ball . . . ] I predict some header somewhere is going to already #define

Re: Questions about PDD 4: Internal data types

2001-03-02 Thread Andy Dougherty
On Fri, 2 Mar 2001, Dan Sugalski wrote: At 10:31 AM 3/2/2001 -0800, Hong Zhang wrote: Integer data types are generically referred to as CINTs. There is an CINT typedef that is guaranteed to hold any integer type. The intention is that if you need to deal with integers in an abstract

Re: PDD 4: Internal data types

2001-03-02 Thread Jarkko Hietaniemi
On Fri, Mar 02, 2001 at 12:05:59PM -0800, Hong Zhang wrote: at some points it becomes necessary to have an unsigned type for "the largest integer" which in this case would be 72 bits. [and on a machine with nothing larger than 32 will be 32] Sure. The size of an INT will probably be

Re: Questions about PDD 4: Internal data types

2001-03-02 Thread Hong Zhang
I believe we should use low bits for tagging. It will make switch case much faster. If you still emphasize on speed, we can make 0x05 = UTF-8 0x06 = UTF-16 0x07 = UTF-32 #define IS_UTF_ANY(a) \ (((a)-flags 0x07) = UTF-8) However, I don't believe it is needed. Hong If your interest is

RE: Questions about PDD 4: Internal data types

2001-03-02 Thread NeonEdge
If your interest is in speed alone, then adding UTF_16 might offer options as well: FORMAT (enc_flags): 7|6|5|4|3|2|1|0 x x 0 0 1 x x x = UTF_8 x x 0 1 0 x x x = UTF_16 x x 1 0 0 x x x = UTF_32 then: #define UTF 56 utf_encoding = UTF enc_flags; if( utf_encoding ) { cout "String is UTF_"

Re: PDD 4: Internal data types

2001-03-02 Thread Hong Zhang
at some points it becomes necessary to have an unsigned type for "the largest integer" which in this case would be 72 bits. [and on a machine with nothing larger than 32 will be 32] Sure. The size of an INT will probably be either 32 or 64 bits, depending both on the size of an IV and the

Re: PDD 4: Internal data types

2001-03-02 Thread Uri Guttman
"DS" == Dan Sugalski [EMAIL PROTECTED] writes: DS One needs to specify *which* PDP is the target. The PDP-11 was the DS most popular of the bunch, and it's a 16-bit machine. One of the DS TOPS machines was 36 bit, IIRC, with either 7 or 9 bit DS chars. (Can't remember which) i don't

Re: PDD 4: Internal data types

2001-03-02 Thread Dan Sugalski
At 01:38 PM 3/2/2001 -0800, Hong Zhang wrote: I was hoping to get us something that was guaranteed to hold an integer, no matter what it was, so you could do something like: struct thingie { UV type; INT my_int; } What is the purpose of doing this? At this point

Re: PDD 4: Internal data types

2001-03-02 Thread Dan Sugalski
At 12:05 PM 3/2/2001 -0800, Hong Zhang wrote: at some points it becomes necessary to have an unsigned type for "the largest integer" which in this case would be 72 bits. [and on a machine with nothing larger than 32 will be 32] Sure. The size of an INT will probably be either 32 or 64

Re: PDD 4: Internal data types

2001-03-02 Thread Hong Zhang
I was hoping to get us something that was guaranteed to hold an integer, no matter what it was, so you could do something like: struct thingie { UV type; INT my_int; } What is the purpose of doing this? The SV is guaranteed to hold anything. Why we need a type that can