[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

class: feval <-> builtin ?

From: CdeMills
Subject: class: feval <-> builtin ?
Date: Fri, 28 Jan 2011 07:25:15 -0800 (PST)


While implementing the dataframe class, I posted a few times code snippets.
There were discussions about overloading functions, and in the
implementation access the Octave builtin.

Let say I have 
function p = myclass() 
p.val = randn(10, 1);
p = class(p, myclass);
function p = subsasgn(p, S, RHS)
# handle the content of S(1)
# handle the rest of S
p.val = subsasgn(p.val, S(2:end), RHS)

What's best at this point to avoid a recursive call, granted that none of
the class members are of type 'myclass' ?

- use subsasgn as written and let Octave sort the right call based upon
signature of the first argument
- use feval(@subsasgn, p.val, ...)
- use builtin(@subsasgn, p.val, ...)

What in the case of at least one of the class members defined in terms of
another class ?



View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]