[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
On Fri, May 11, 2001 at 09:32:35AM -0600, Bruce wrote:
> Robert Lemmen wrote:
> 
>> ok, i got the thing about the variables, although i think i want to avoid
>> effectively having two variables with the same name on one object ...
>> 
>> now to these frobs. i understand how to use them and how to restrict a method
>> to be frob-only, but what i don't get is why to make the effort. what is the
>> advantage of a frobbed call?

Frobs, hmm...

General rule: if in question, dont do it.

Frobs can be a useful hack for abstracting data, they should not be used
as 'lightweight objects' because they simply are not.  What it boils
down do is currently cold supports executing a method on both an
object and abstracted through a data hook:

    OBJECT.method(ARGS)
    DATA.method(ARGS)

Where DATA is any of the ColdC data types.  As you know, this is then
converted to:

    lookup(type(DATA)).method(DATA, ARGS)

What frobs do is just allow for a little more abstraction, as you can
control what object is called (rather than always going to the object
as defined by the type of data it is), and also what method is called
(i.e. even though you said to call .method(), you can override it and
have it call .special_method instead).

As for proper uses, this is generally to be determined on a case by
case basis.  I think Ctext is a decent usage of frobs.  Generally I
suggest people stay away from frobs until they get a concrete
understanding of ColdC.  After that then try to grok frobs.

>> btw, how is the status of this project, because it is very cool,
>> but also seems
>> to be a bit dead/sleeping

As Bruce said.  There is a bit of sleeping when it comes to a viable
core, which is the biggest unfortunate situation.  Recently I have
again been trying to shed various projects and get back into Cold.
We'll see after May how this turns out.  My original reason for even
getting into Cold was to build a neat VR world, and this is still my
goal, I just happened to get a little side tracked also trying to have
a cool driver :)

-Brandon Gillespie