No registered users in community xowiki
in last 10 minutes
in last 10 minutes
[Xotcl] Re: [Xotcl] instproc vs proc
From: Kristoffer Lawson <setok_at_fishpool.com>
Date: Wed, 13 Dec 2000 16:27:33 +0200 (EET)
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/
Date: Wed, 13 Dec 2000 16:27:33 +0200 (EET)
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/