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 levels,
for want of a better word.
For example, the int type progression might go:
int8
int16
int32
int64
bigint
Though I'm trying to work out some way to register types at runtime or
something.
> > name
>
>Huh? A name for what? (How does this relate to a 'string'?)
variable type. What prints out when you do a ref() on it, more or less.
> > get_bool
>
>Stored as...? char? int? Boolean or Trilean?
Returned as a true/false value. The thing is responsible for figuring out
if it's true or false.
> > get_string *
>
>'a string' is a tuple(pointer, size)? or tuple(pointer, size,
>allocated_size)?
>or tuple(pointer, size, allocated_size, ook_like_initial_offset_hack?)
>Have 'slices' (tuple(offset, size) aliases to strings) been considered?
Magic String Thingie. :)
I've not put a lot of thought into this--I'm thinking at least a buffer
start/buffer length pair would be in order.
This return may be of any of the string types (raw bytes, characters,
UTF8/16/32) depending on the type you ask for.
> > 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.
That's what the * is for--it indicates that this isn't a plain vtable
entry, rather a pointer to another table. What type of int or float you get
back depends on which entry in the table you call.
> > add *
>
>How does the mapping from native ints to bigints happen?
Dunno yet.
> > logical_or
> > logical_and
> > logical_not
>
>logical_xor?
Do we have one, or will we? (^^?)
> > bind (For =~)
>
>Hmmmh. Why is this a lowlevel op?
As much for arrays and hashes as anything else.
@foo =~ s/bar/baz/;
to operate on every member of the array.
> > repeat (For x)
>
>Ditto.
As above. I'm not tightly attached to the idea, though.
> > Anyone got anything to add before I throw together the base vtable RFC?
>
>As I said I must be missing something (like what does 'vtable' mean :-)
Virtual table. Rather than taking a variable's type and whipping through a
monster switch statement to figure out how to get a value out, you just
call the magic vtable function and the object knows how to give you what
you want. Plus it means the variable can handle locking if appropriate, as
the vtable functions for a shared variable can lock itself, for example,
while the vtable for an unshared one wouldn't, thus saving the overhead.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk