Re: Special syntax for numeric constants [Was: A tentative list of vtable functions]

2000-10-25 Thread Ken Fox
David Mitchell wrote: > Well, I was assuming that there would be *a* numeric class in scope > - as defined be the innermost lexical 'use foo'. And that numeric class would remove int and num from the scope? > I assumed that Perl wouldn't be clever enough to know about all available > numberic ty

Re: Special syntax for numeric constants [Was: A tentative list of vtable functions]

2000-10-24 Thread Dan Sugalski
At 02:34 PM 10/24/00 +0100, David Mitchell wrote: >Ken Fox <[EMAIL PROTECTED]> wrote: > > David Mitchell wrote: > > > Now of course if we have the luxury of deciding that core perl 'knows' > > > about complex numbers, then of the parser can be made to recognise ... > > > > The core doesn't need t

Re: Special syntax for numeric constants [Was: A tentative list of vtable functions]

2000-10-24 Thread David Mitchell
Ken Fox <[EMAIL PROTECTED]> wrote: > David Mitchell wrote: > > Now of course if we have the luxury of deciding that core perl 'knows' > > about complex numbers, then of the parser can be made to recognise ... > > The core doesn't need to know -- that was my point. All the core needs > is the bas

Re: A tentative list of vtable functions

2000-10-04 Thread Tim Jenness
On Mon, 2 Oct 2000, Jarkko Hietaniemi wrote: > > Assuming that the perl parser generated IV SVs rather than NVs for > > the 2 constants 2,3, then my scheme would handle this fine; the IV > > It currently does so. > > > version of add() would be called, and an IV SB would result. > > "The IV ve

RE: A tentative list of vtable functions

2000-10-04 Thread Fisher Mark
> One C++ problem I just found out is memory management. It seems > that it's impossible to 'new' an object from an specified memory block. > So it's impossible to put free'd objects in memory pool and re-allocate > them next time. It can't be done by the default new operator, but you can do it

Re: A tentative list of vtable functions

2000-10-04 Thread ye, wei
Dan Sugalski wrote: > At 03:23 PM 9/29/00 -0400, ye, wei wrote: > >Dan Sugalski wrote: > > > > > At 02:29 PM 9/29/00 +0100, David Mitchell wrote: > > > >Regarding the tentative list of vtable functions: > > > >I'm rather worried about binary operators, eg 'is_equal', 'add' etc. > > > >The danger

Re: A tentative list of vtable functions

2000-10-02 Thread David Mitchell
> > would need to know a fair bit about particular user-defined types that have > > been loaded in, on order to make clever interpretations of literals. > > Precisely. Assume I want > > $a = 2 + 3i; > > to work... Which I what I suggest we abandon attempts to make the parser do intellig

Re: A tentative list of vtable functions

2000-10-02 Thread Jarkko Hietaniemi
> would need to know a fair bit about particular user-defined types that have > been loaded in, on order to make clever interpretations of literals. Precisely. Assume I want $a = 2 + 3i; to work... -- $jhi++; # http://www.iki.fi/jhi/ # There is this special biologist word we

Re: A tentative list of vtable functions

2000-10-02 Thread Jarkko Hietaniemi
> >the $c will be an NV of of 5.000, or thereabouts, een > >while $a and $b are IVs. > > Note: integers have an exact representation in floating point. There is ...as long as they are [minint, maxint]. > no "thereabouts". It is exactly 5.000. Yeah, bad example. Yours i

Re: A tentative list of vtable functions

2000-10-02 Thread David Mitchell
> > version of add() would be called, and an IV SB would result. > > "The IV version of add()"? Beware of combinatorial explosion: > addII, addIU, addUI, addUU, addIN, addNI, addNN, addblahbah Ah, but you've forgotten the point of my orginal posting (back in prehistory ;-) where given 2 mi

Re: A tentative list of vtable functions

2000-10-02 Thread David Mitchell
> For the record: I hate the current policy of defaulting to NVs for > arithmetic ops. If I say '2' I do mean an IV of 2, not an NV of > 2.000. Currently if I say > > $a = 2; > $b = 3; > $c = $a + $3; > > the $c will be an NV of of 5.000, or thereabouts, een > whi

Re: A tentative list of vtable functions

2000-10-02 Thread Jarkko Hietaniemi
> $x = 2^1000; > > would evaluate 2^1000 at compile time, and if it didnt fit into an NV > (or IV if 'use integer' is in effect), create a compile-time error. For the record: I hate the current policy of defaulting to NVs for arithmetic ops. If I say '2' I do mean an IV of 2, not an NV of 2.000

Re: A tentative list of vtable functions

2000-10-02 Thread David Mitchell
> > > Don't forget bigrats. > > > > I'm not too familiar with the concept of rational numbers in a computing > > complex. What's your definition of a (big)rat? Fixed point?? > > bigint1 / bigint2. Possibly represented as a triad of bigints, > bigint1 + bigint2 / bigint3. I'm tempted to suggest

Re: A tentative list of vtable functions

2000-09-29 Thread Dan Sugalski
At 02:29 PM 9/29/00 +0100, David Mitchell wrote: >Regarding the tentative list of vtable functions: >I'm rather worried about binary operators, eg 'is_equal', 'add' etc. >The danger with these is that they may impose a single implementation >of scalars upon us. > >As an example, suppose I wrote an

Re: A tentative list of vtable functions

2000-09-29 Thread David Mitchell
Regarding the tentative list of vtable functions: I'm rather worried about binary operators, eg 'is_equal', 'add' etc. The danger with these is that they may impose a single implementation of scalars upon us. As an example, suppose I wrote an alternative scalar implementation that was optimised f

Re: A tentative list of vtable functions

2000-09-14 Thread Nick Ing-Simmons
Nathan Torkington <[EMAIL PROTECTED]> writes: >Dan Sugalski writes: >> It's possible, for example, for a tied/overloaded/really-darned-strange >> variable to look true but still be false. If you do: >> >>$foo = $bar || $baz; >> >> and both $bar and $baz are objects, the 'naive' way is to ma

Re: A tentative list of vtable functions

2000-09-13 Thread Dan Sugalski
At 03:56 PM 9/13/00 -0400, Ken Fox wrote: >Nick Ing-Simmons wrote: > > Ken Fox <[EMAIL PROTECTED]> writes: > > >Dan Sugalski wrote: > > >> For something like: > > >> > > >>@foo = @bar || @baz; > > >> > > >> I have no problem with the call sequence looking like (pseudo-codish > here): > > >> >

Re: A tentative list of vtable functions

2000-09-13 Thread Nathan Torkington
Dan Sugalski writes: > It's possible, for example, for a tied/overloaded/really-darned-strange > variable to look true but still be false. If you do: > >$foo = $bar || $baz; > > and both $bar and $baz are objects, the 'naive' way is to make $foo be > $bar. But it's distinctly possible that

Re: A tentative list of vtable functions

2000-09-13 Thread Dan Sugalski
At 03:02 PM 9/12/00 -0400, Ken Fox wrote: >Dan Sugalski wrote: > > For something like: > > > >@foo = @bar || @baz; > > > > I have no problem with the call sequence looking like (pseudo-codish here): > > > > set_context(ARRAY, ASSIGN); > > foo->store(bar->log_or(bar, baz)); > >But log_o

Re: A tentative list of vtable functions

2000-09-13 Thread Ken Fox
Nick Ing-Simmons wrote: > Ken Fox <[EMAIL PROTECTED]> writes: > >Dan Sugalski wrote: > >> For something like: > >> > >>@foo = @bar || @baz; > >> > >> I have no problem with the call sequence looking like (pseudo-codish here): > >> > >> set_context(ARRAY, ASSIGN); > >> foo->store(bar->l

Re: A tentative list of vtable functions

2000-09-13 Thread Nick Ing-Simmons
Ken Fox <[EMAIL PROTECTED]> writes: >Dan Sugalski wrote: >> For something like: >> >>@foo = @bar || @baz; >> >> I have no problem with the call sequence looking like (pseudo-codish here): >> >> set_context(ARRAY, ASSIGN); >> foo->store(bar->log_or(bar, baz)); > >But log_or must shor

Re: A tentative list of vtable functions

2000-09-12 Thread Ken Fox
Dan Sugalski wrote: > For something like: > >@foo = @bar || @baz; > > I have no problem with the call sequence looking like (pseudo-codish here): > > set_context(ARRAY, ASSIGN); > foo->store(bar->log_or(bar, baz)); But log_or must short circuit -- I think we have to preserve that b

Re: A tentative list of vtable functions

2000-09-10 Thread Dan Sugalski
At 07:58 PM 9/9/00 +, Nick Ing-Simmons wrote: >Ken Fox <[EMAIL PROTECTED]> writes: > >Short > >circuiting should not be customizable by each type for example. > >We are already having that argument^Wdiscussion elsewhere ;-) > >But I agree variable vtables are not the place for that. As do I,

Re: A tentative list of vtable functions

2000-09-09 Thread Nick Ing-Simmons
Ken Fox <[EMAIL PROTECTED]> writes: >Short >circuiting should not be customizable by each type for example. We are already having that argument^Wdiscussion elsewhere ;-) But I agree variable vtables are not the place for that. -- Nick Ing-Simmons

Re: A tentative list of vtable functions

2000-09-08 Thread Ken Fox
Dan Sugalski wrote: > At 05:30 PM 8/31/00 -0400, Ken Fox wrote: > > before_get_value > > after_get_value > > before_set_value > > after_set_value > > > >There ought to be specializations of get_value and set_value > >that call these hooks if they're defined -- no sense in making the > >nor

other parts of the guts playing with raw access (was Re: A tentative list of vtable functions)

2000-09-02 Thread Bradley M. Kuhn
Bryan C. Warnock wrote: > I use direct, raw access in prototyping when dipping back into C for > "heavy" data manipulations - bit stream analysis, signals processing, etc. > Since I'm usually doing a lot of buffer manipulations, I don't want all > the scalar overhead that comes into play. > > >M

Re: A tentative list of vtable functions

2000-09-01 Thread Bryan C . Warnock
On Fri, 01 Sep 2000, Dan Sugalski wrote: > I'm not sure. They're there mainly for guaranteed unfiltered access to the > variable's guts, and I'm not sure what things will need that. I use direct, raw access in prototyping when dipping back into C for "heavy" data manipulations - bit stream analy

Re: A tentative list of vtable functions

2000-09-01 Thread Dan Sugalski
At 11:49 AM 9/1/00 -0500, David L. Nicol wrote: >Dan Sugalski wrote: > > > We're shooting for speed here. Any common operation that could be affected > > by the type of the variable should be represented so a custom function can > > be called that does exactly what needs to be done. > > > >

Re: A tentative list of vtable functions

2000-09-01 Thread Dan Sugalski
At 10:23 AM 9/1/00 -0700, Larry Wall wrote: >Dan Sugalski writes: >: Type returns a magic cookie value of some sort (Not sure what sort yet), >: name returns a string with the name of the type of the variable. > >Why can't the type object just stringify to the name of the type? I'd figured that t

Re: A tentative list of vtable functions

2000-09-01 Thread Dan Sugalski
At 10:25 AM 9/1/00 -0700, Larry Wall wrote: >Dan Sugalski writes: >: Anyone got anything to add before I throw together the base vtable RFC? > >So how do you call a generic method? Generic vtable method? You'd have to look up the vtable in the stash that held it and vector in through there. If

Re: A tentative list of vtable functions

2000-09-01 Thread Dan Sugalski
At 06:07 PM 9/1/00 +, Nick Ing-Simmons wrote: >Dan Sugalski <[EMAIL PROTECTED]> writes: > >is_equal (true if this thing is equal to the parameter thing) > >is_same (True if this thing is the same thing as the parameter thing) > >is_equal in what sense? (String, Number, ...) I was thin

Re: A tentative list of vtable functions

2000-09-01 Thread Chaim Frenkel
> "NI" == Nick Ing-Simmons <[EMAIL PROTECTED]> writes: NI> Dan Sugalski <[EMAIL PROTECTED]> writes: >> is_equal (true if this thing is equal to the parameter thing) >> is_same (True if this thing is the same thing as the parameter thing) NI> is_equal in what sense? (String, Number, ...) NI>

Re: A tentative list of vtable functions

2000-09-01 Thread Nick Ing-Simmons
Dan Sugalski <[EMAIL PROTECTED]> writes: >is_equal (true if this thing is equal to the parameter thing) >is_same (True if this thing is the same thing as the parameter thing) is_equal in what sense? (String, Number, ...) and how is is_same different from just comparing addresses of the t

Re: A tentative list of vtable functions

2000-09-01 Thread Larry Wall
Dan Sugalski writes: : Type returns a magic cookie value of some sort (Not sure what sort yet), : name returns a string with the name of the type of the variable. Why can't the type object just stringify to the name of the type? >From a language level, I'm inclined to say that any bare identifi

Re: A tentative list of vtable functions

2000-09-01 Thread Larry Wall
Dan Sugalski writes: : Anyone got anything to add before I throw together the base vtable RFC? So how do you call a generic method? Larry

Re: A tentative list of vtable functions

2000-09-01 Thread Chaim Frenkel
> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes: DS> Type returns a magic cookie value of some sort (Not sure what sort yet), So? What good is it? You might as well make it some sort of id. Then perl could do the equivalent vs. identical determination without asking the object to do it.

Re: A tentative list of vtable functions

2000-09-01 Thread David L. Nicol
Dan Sugalski wrote: > We're shooting for speed here. Any common operation that could be affected > by the type of the variable should be represented so a custom function can > be called that does exactly what needs to be done. > > Dan so if I want to make

Re: A tentative list of vtable functions

2000-09-01 Thread Grant M.
>>DS> get_bool >> >>Is this allowed to return a non-true/false result? Or is everything >>true or false? > >Dunno yet. I'm thinking just a true/false value, but... A tri-state bool would be really cool (i.e, true/false/undef). Although I understand that this probably isn't where Perl 6 is goi

Re: A tentative list of vtable functions

2000-09-01 Thread Dan Sugalski
At 11:11 AM 9/1/00 -0400, Chaim Frenkel wrote: > > "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes: > >DS> Okay, here's a list of functions I think should go into variable vtables. >DS> Functions marked with a * will take an optional type offset so we can >DS> handle asking for various permuta

Re: A tentative list of vtable functions

2000-09-01 Thread Chaim Frenkel
> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes: DS> Okay, here's a list of functions I think should go into variable vtables. DS> Functions marked with a * will take an optional type offset so we can DS> handle asking for various permutations of the basic type. DS> type DS> nam

Re: A tentative list of vtable functions

2000-09-01 Thread Dan Sugalski
At 01:49 AM 9/1/00 -0400, Bradley M. Kuhn wrote: >Dan Sugalski wrote: > > > > get_value > > > > set_value > > > The get/set value functions are for when something knows what the SV (or > > whatever we call it) really is and can handle the raw data. For example, > > if my code knew a SV he

Re: A tentative list of vtable functions

2000-09-01 Thread Dan Sugalski
At 01:44 AM 9/1/00 -0400, Bradley M. Kuhn wrote: >Dan Sugalski wrote: > > At 04:59 PM 8/31/00 -0400, Buddha Buck wrote: > > >At 04:43 PM 8/31/00 -0400, Dan Sugalski wrote: > > >>Okay, here's a list of functions I think should go into variable > vtables. > > >>Functions marked with a * will take a

Re: A tentative list of vtable functions

2000-09-01 Thread Dan Sugalski
At 10:46 PM 8/31/00 +, David L. Nicol wrote: >Dan Sugalski wrote: > > > > Okay, here's a list of functions I think should go into variable vtables. > >All the math functions are in here. Can the entries that my type does >not use be replaced with other functions that my type does use? That's

Re: A tentative list of vtable functions

2000-09-01 Thread Nick Ing-Simmons
David L . Nicol <[EMAIL PROTECTED]> writes: >Dan Sugalski wrote: >> >> Okay, here's a list of functions I think should go into variable vtables. > >All the math functions are in here. Can the entries that my type does >not use be replaced with other functions that my type does use? NO ! -- N

Re: A tentative list of vtable functions

2000-09-01 Thread Nick Ing-Simmons
David L . Nicol <[EMAIL PROTECTED]> writes: >Dan Sugalski wrote: >> >> Okay, here's a list of functions I think should go into variable vtables. > >All the math functions are in here. Can the entries that my type does >not use be replaced with other functions that my type does use? NO ! -- N

Re: A tentative list of vtable functions

2000-08-31 Thread Bradley M. Kuhn
Dan Sugalski wrote: > > > get_value > > > set_value > The get/set value functions are for when something knows what the SV (or > whatever we call it) really is and can handle the raw data. For example, > if my code knew a SV held a complex number (which doesn't map well to the > int/floa

Re: A tentative list of vtable functions

2000-08-31 Thread Bradley M. Kuhn
Dan Sugalski wrote: > At 04:59 PM 8/31/00 -0400, Buddha Buck wrote: > >At 04:43 PM 8/31/00 -0400, Dan Sugalski wrote: > >>Okay, here's a list of functions I think should go into variable vtables. > >>Functions marked with a * will take an optional type offset so we can > >>handle asking for vari

Re: A tentative list of vtable functions

2000-08-31 Thread Dan Sugalski
On Thu, 31 Aug 2000, Jarkko Hietaniemi wrote: > How about > > to_string * > from_string * > > as generalizations of formatted/pretty input/output and freeze/thaw > (cf printf/Data::Dumper/Storable)? Erm, I could see that, but freezing and printing are still different operations, so I'm not sur

Re: A tentative list of vtable functions

2000-08-31 Thread Jarkko Hietaniemi
How about to_string * from_string * as generalizations of formatted/pretty input/output and freeze/thaw (cf printf/Data::Dumper/Storable)? -- $jhi++; # http://www.iki.fi/jhi/ # There is this special biologist word we use for 'stable'. # It is 'dead'. -- Jack Cohen

Re: A tentative list of vtable functions

2000-08-31 Thread David L. Nicol
Dan Sugalski wrote: > > Okay, here's a list of functions I think should go into variable vtables. All the math functions are in here. Can the entries that my type does not use be replaced with other functions that my type does use? > Functions marked with a * will take an optional type offset

Re: A tentative list of vtable functions

2000-08-31 Thread Dan Sugalski
At 03:45 PM 8/31/00 -0600, Nathan Torkington wrote: >Jarkko Hietaniemi writes: > > > I'm not too worried about getting the vtbl right at the first because > > > it will be pretty obvious how it should go once the code starts to form. > > > > Some planning isn't that painful :-) > >Yes. Especially

Re: A tentative list of vtable functions

2000-08-31 Thread Dan Sugalski
At 05:30 PM 8/31/00 -0400, Ken Fox wrote: >Dan Sugalski wrote: > > get_value > > set_value > >Wouldn't these go on the SV and not on the inner type? Maybe I'm >thinking value when you're saying variable? Nope. The get/set value functions are for when something knows what the SV (or whate

Re: A tentative list of vtable functions

2000-08-31 Thread Dan Sugalski
At 03:12 PM 8/31/00 -0600, Tom Christiansen wrote: > >> get_int * > >> get_float * > > >Could you elaborate on these a lot? What's an 'int'? What's a 'float'? > >Having lately been battling a lot with quad ints and doubles vs long > doubles > >I seriously want this interface not to suc

Re: A tentative list of vtable functions

2000-08-31 Thread Dan Sugalski
At 04:05 PM 8/31/00 -0500, Jarkko Hietaniemi wrote: >I'm confused (I might have missed some discussions, being busy in other >fronts) so please bear with my silly questions. > > > type > >The basic set-in-stone types are...? int, float, string, ref, hash, array. All of which have multiple lev

Re: A tentative list of vtable functions

2000-08-31 Thread Dan Sugalski
At 04:59 PM 8/31/00 -0400, Buddha Buck wrote: >At 04:43 PM 8/31/00 -0400, Dan Sugalski wrote: >>Okay, here's a list of functions I think should go into variable vtables. >>Functions marked with a * will take an optional type offset so we can >>handle asking for various permutations of the basic

Re: A tentative list of vtable functions

2000-08-31 Thread Nathan Torkington
Jarkko Hietaniemi writes: > > I'm not too worried about getting the vtbl right at the first because > > it will be pretty obvious how it should go once the code starts to form. > > Some planning isn't that painful :-) Yes. Especially given that vtables are an unbenchmarked change. It'd be good

Re: A tentative list of vtable functions

2000-08-31 Thread Jarkko Hietaniemi
> Wouldn't these go on the SV and not on the inner type? Maybe I'm > thinking value when you're saying variable? The following seem useful > on variables too: > > before_get_value > after_get_value > before_set_value > after_set_value > > There ought to be specializations of get_value an

Re: A tentative list of vtable functions

2000-08-31 Thread Ken Fox
Dan Sugalski wrote: > get_value > set_value Wouldn't these go on the SV and not on the inner type? Maybe I'm thinking value when you're saying variable? The following seem useful on variables too: before_get_value after_get_value before_set_value after_set_value There ought to b

Re: A tentative list of vtable functions

2000-08-31 Thread Tom Christiansen
>> get_int * >> get_float * >Could you elaborate on these a lot? What's an 'int'? What's a 'float'? >Having lately been battling a lot with quad ints and doubles vs long doubles >I seriously want this interface not to suck. I was a tad concerned there, too. I'm hoping one can painles

Re: A tentative list of vtable functions

2000-08-31 Thread Jarkko Hietaniemi
I'm confused (I might have missed some discussions, being busy in other fronts) so please bear with my silly questions. > type The basic set-in-stone types are...? > name Huh? A name for what? (How does this relate to a 'string'?) > get_bool Stored as...? char? int? Boolean or

Re: A tentative list of vtable functions

2000-08-31 Thread Buddha Buck
At 04:43 PM 8/31/00 -0400, Dan Sugalski wrote: >Okay, here's a list of functions I think should go into variable vtables. >Functions marked with a * will take an optional type offset so we can >handle asking for various permutations of the basic type. Perhaps I'm missing something... Is this f

A tentative list of vtable functions

2000-08-31 Thread Dan Sugalski
Okay, here's a list of functions I think should go into variable vtables. Functions marked with a * will take an optional type offset so we can handle asking for various permutations of the basic type. type name get_bool get_string * get_int * get_float * get_value