Re: mixed numeric and string SVs.

2000-12-21 Thread Nick Ing-Simmons
David Mitchell <[EMAIL PROTECTED]> writes: >> > 2. Each SV has 2 vtable pointers - one for it's numeric representation >> > (if any), and one for its string represenation (if any). Flexible, but >> > may require an extra 4/8 bytes per SV. >> >> It may not be terrible. How big is the average SV al

Re: mixed numeric and string SVs.

2000-12-20 Thread Nicholas Clark
On Wed, Dec 20, 2000 at 04:03:39PM +, David Mitchell wrote: > > >1. We no longer save conversions, so > > > $i="3"; $j+=$i for (...); > > >does an aton() or similar each time round the loop > > > > Well just the 1st time - then it is a number... > > Err, option (1) was explicity suggesting

Re: mixed numeric and string SVs.

2000-12-20 Thread David Mitchell
> >1. We no longer save conversions, so > > $i="3"; $j+=$i for (...); > >does an aton() or similar each time round the loop > > Well just the 1st time - then it is a number... Err, option (1) was explicity suggesting we *dont* save the result of the conversion, so aton() *would* have to be c

Re: mixed numeric and string SVs.

2000-12-20 Thread Nick Ing-Simmons
David Mitchell <[EMAIL PROTECTED]> writes: >Has anyone given thought to how an SV can contain both a numeric value >and string value in Perl6? >Given the arbitrary number of numeric and string types that the vatble >scheme of Perl6 support it will be unviable to to have special types >for all perm

Re: mixed numeric and string SVs.

2000-12-20 Thread David Mitchell
> > It seems to me the following options are poossible: > > > > 1. We no longer save conversions, so > > $i="3"; $j+=$i for (...); > > does an aton() or similar each time round the loop > > I fear this would be a performance hit. I'm told TCL pre version 8 was > like this - everything's a st

Re: mixed numeric and string SVs.

2000-12-20 Thread Jarkko Hietaniemi
On Wed, Dec 20, 2000 at 03:06:06PM +, Nicholas Clark wrote: > On Wed, Dec 20, 2000 at 09:00:47AM -0600, Jarkko Hietaniemi wrote: > > > struct { > > IV whatitis; > > more a perl5 question - why IV not int? > int might be smaller and "more natural" (your words) That's K&R's words, not mi

Re: mixed numeric and string SVs.

2000-12-20 Thread Nicholas Clark
On Wed, Dec 20, 2000 at 09:00:47AM -0600, Jarkko Hietaniemi wrote: > struct { > IV whatitis; more a perl5 question - why IV not int? int might be smaller and "more natural" (your words) eg why does looks_like_number return IV not int? and various other bits of the perl API use IV? Nicholas

Re: mixed numeric and string SVs.

2000-12-20 Thread Jarkko Hietaniemi
> > 3. We decree that all string to numeric conversions should return > > a particular numeric type (eg NV), and that all numeric to string > > conversions should similary convert to a fixed string type (eg utf8). > > (Although I'm not sure that really helps.) > > Feels like a bad plan, as it can

Re: mixed numeric and string SVs.

2000-12-20 Thread Nicholas Clark
On Wed, Dec 20, 2000 at 02:26:12PM +, David Mitchell wrote: > Has anyone given thought to how an SV can contain both a numeric value > and string value in Perl6? > Given the arbitrary number of numeric and string types that the vatble > scheme of Perl6 support it will be unviable to to have sp

mixed numeric and string SVs.

2000-12-20 Thread David Mitchell
Has anyone given thought to how an SV can contain both a numeric value and string value in Perl6? Given the arbitrary number of numeric and string types that the vatble scheme of Perl6 support it will be unviable to to have special types for all permuations (eg, utf8_nv, unicode32_iv, ascii_bitint