>>>>> "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.

DS> name returns a string with the name of the type of the variable.

DS> get_bool
>> 
>> Is this allowed to return a non-true/false result? Or is everything
>> true or false?

DS> Dunno yet. I'm thinking just a true/false value, but...

Allow an undef return. I hope to be able to get Larry to approve
tristate logic.

DS> get_string *
DS> get_int *
DS> get_float *

>> What does the optional type argument do?

DS> Provides an index into the table of functions.

You then lose fast access. These will then always be a double indirection.

>> What about collection types?

DS> That's up in the air. get_int could, for example, return the number of 
DS> entries in the hash or array. Or not.

Don't do that. Sounds like a hack.

>> Why not simply collapse these into a single one with an option argument?
>> What should a get_* do if inappropriate for its type?

DS> Either return something as best it can (like what we do now when you use a 
DS> string in numeric context, for example) or throw an error.

Hrmph. So are you going with throws? 

DS> get_value
>> 
>> What does this do that the above three do not?

DS> Raw data.

I'm not sure I like that. If something is using the vtbl, most likely it
is a third party. A third party shouldn't want to use anything other than
the official interface. If the interface isn't fast enough or good enough 
we would have to rework it.

DS> add *
DS> subtract *
DS> multiply *
DS> divide *
DS> modulus *
>> 
>> Where is the argument to be added/subtracted/etc. ? On the stack?

DS> Passed as a parameter, I expect.

Then why is this in the vtbl? Okay, I'm confused. Who is doing adding?
Perl (aka the TIL) or one of the operands?

>> How does THIS figure out how to get THAT to give a usable value?

DS> That's what the type parameter's for...

You're back to a big switch!


Lost in a maze of subroutines that all look alike.
<chaim>
-- 
Chaim Frenkel                                        Nonlinear Knowledge, Inc.
[EMAIL PROTECTED]                                               +1-718-236-0183

Reply via email to