octave-maintainers
[Top][All Lists]
Advanced

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

Re: dataframe dereferencing


From: Judd Storrs
Subject: Re: dataframe dereferencing
Date: Thu, 2 Sep 2010 10:34:06 -0400

On Thu, Sep 2, 2010 at 10:24 AM, CdeMills <address@hidden> wrote:
For the first point: cell() is already a builtin function, so you have to
emulate a method call on a dataframe object, this is the purpose of
x.cell(some_range).


I'm not sure I understand what you are saying. Classes can overload builtin functions. For example, create a directory called @foo and the following files:

@foo/foo.m:
function foo = foo()
  foo.data = 1 ;
  foo = class(foo, "foo") ;
endfunction

@foo/cell.m:
function cell(foo)
  "Hello, world!"
endfunction

Then in octave this is what happens:

octave:1> f = foo 
f = <class foo>
octave:2> cell(f)
ans = Hello, world!



--judd


reply via email to

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