help-octave
[Top][All Lists]
Advanced

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

Re: namespace support?


From: Leo Singer
Subject: Re: namespace support?
Date: Sat, 6 Feb 2010 16:45:50 -0800

One could almost write an M-file function called "import" to implement
this in Octave without modifying the interpreter.

It might work by creating function handles to functions that are not
on the path.  However, attempting to invoke a function handle that
points to an M-file that is no longer on the path results in the
following error message:

error: invalid function handle

Matlab does support function handles to functions that are no longer
on the path.  How hard would it be to implement this in Octave?

Leo Singer

> On Thu, Feb 4, 2010 at 11:20 PM, John W. Eaton <jwe at octave.org> wrote:
> > On  4-Feb-2010, Jaroslav Hajek wrote:
> >
> > | It's simpler than that, I think. It appears that newest Matlab allows
> > | prefixing some directories with "+", and
> > | +mydir/myfun.m can then be called as "mydir.myfun". Maybe it wouldn't
> > | be that hard to implement.
> > | see
> > | 
> > http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_oop/brfynt_-1.html#brf3g8k
> >
> > So packages can just be collections of functions and don't have to be
> > collections of classdef-style classes?  OK.
>
> Yes, that's my understanding. I can't check, though. The
> mypackage.myfunc syntax can also be achieved through static methods,
> which is so Java-like and so stupid, that MathWorks probably went for
> something simpler.
>
> I think this shouldn't be hard to implement.
>
> --
> RNDr. Jaroslav Hajek, PhD
> computing expert & GNU Octave developer
> Aeronautical Research and Test Institute (VZLU)
> Prague, Czech Republic
> url: www.highegg.matfyz.cz


reply via email to

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