[Xotcl] Re: [Xotcl] instproc vs proc

Kristoffer Lawson setok at fishpool.com
Wed Dec 13 15:27:33 CET 2000


On Wed, 13 Dec 2000, Laurent Duperval wrote:

> When do you use instproc vs. proc? I'm looking at the code I've written so
> far, and it's all instproc, I make no use of proc at all. So I'm wondering
> if it's because proc isn't used often or because I'm missing out on
> something really cool.

Well proc is something you use if you want a procedure that exists
only in that instance of an object. So if you want a procedure for
class Foo which doesn't appear in instances of Foo then you use "proc".
The same applies if you want to add a procedure to a single object.
I must admit I don't really use it much myself but it's good to have it
when you do need it, and really works with the dynamic nature of the
language.

         -     ---------- = = ---------//--+
         |    /     Kristoffer Lawson      |  www.fishpool.fi|.com
         +-> |    setok at fishpool.com       |  - - --+------
             |-- Fishpool Creations Ltd - /         |
             +-------- = - - - = ---------      /~setok/





More information about the Xotcl mailing list