help-octave
[Top][All Lists]
Advanced

[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)

Hello,

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 
@myclass/myclass.m
function p = myclass() 
p.val = randn(10, 1);
p = class(p, myclass);
@myclass/subasgn.m
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 ?

Regards

Pascal


-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/class-feval-builtin-tp3244708p3244708.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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