matlab namespace

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

matlab namespace

Richard Crozier
Dear List,

Matlab are gradually introducing the use of namespaces, with a base
namespace of 'matlab', e.g. matlab.lang.makeValidName is replacing
genvarname.

My question is, how is Octave planning to deal with this? This is
important for writing portable code, for instance I already have tests
in my code for whether an object is of class 'matlab.graphics.axis.Axes'
(for checking input).

Will Octave use 'matlab', or replace 'matlab' with 'octave'? Or some
other solution?

Regards,

Richard

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Reply | Threaded
Open this post in threaded view
|

Re: matlab namespace

Richard Crozier
On 26/10/17 08:32, Richard Crozier wrote:

> Dear List,
>
> Matlab are gradually introducing the use of namespaces, with a base
> namespace of 'matlab', e.g. matlab.lang.makeValidName is replacing
> genvarname.
>
> My question is, how is Octave planning to deal with this? This is
> important for writing portable code, for instance I already have tests
> in my code for whether an object is of class 'matlab.graphics.axis.Axes'
> (for checking input).
>
> Will Octave use 'matlab', or replace 'matlab' with 'octave'? Or some
> other solution?
>
> Regards,
>
> Richard
>


No thoughts on the above at all?

Richard

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Reply | Threaded
Open this post in threaded view
|

Re: matlab namespace

Carnë Draug
On 20 November 2017 at 10:29, Richard Crozier <[hidden email]> wrote:

> On 26/10/17 08:32, Richard Crozier wrote:
>>
>> Dear List,
>>
>> Matlab are gradually introducing the use of namespaces, with a base
>> namespace of 'matlab', e.g. matlab.lang.makeValidName is replacing
>> genvarname.
>>
>> My question is, how is Octave planning to deal with this? This is
>> important for writing portable code, for instance I already have tests in my
>> code for whether an object is of class 'matlab.graphics.axis.Axes' (for
>> checking input).
>>
>> Will Octave use 'matlab', or replace 'matlab' with 'octave'? Or some other
>> solution?
>>
>> Regards,
>>
>> Richard
>>
>
>
> No thoughts on the above at all?
>
> Richard

Actually, I just came across a similar issue last week.  A colleague
was trying to run Matlab code in Octave that made use of the
matlab.mixin.heterogeneous class [1]

Maybe it's possible to import an entire namespace into another so we
could import matlab.* into the octave namespace?

Carnë

[1] https://uk.mathworks.com/help/matlab/ref/matlab.mixin.heterogeneous-class.html

Reply | Threaded
Open this post in threaded view
|

Re: matlab namespace

Richard Crozier


On 20/11/17 15:06, Carnë Draug wrote:

> On 20 November 2017 at 10:29, Richard Crozier <[hidden email]> wrote:
>> On 26/10/17 08:32, Richard Crozier wrote:
>>>
>>> Dear List,
>>>
>>> Matlab are gradually introducing the use of namespaces, with a base
>>> namespace of 'matlab', e.g. matlab.lang.makeValidName is replacing
>>> genvarname.
>>>
>>> My question is, how is Octave planning to deal with this? This is
>>> important for writing portable code, for instance I already have tests in my
>>> code for whether an object is of class 'matlab.graphics.axis.Axes' (for
>>> checking input).
>>>
>>> Will Octave use 'matlab', or replace 'matlab' with 'octave'? Or some other
>>> solution?
>>>
>>> Regards,
>>>
>>> Richard
>>>
>>
>>
>> No thoughts on the above at all?
>>
>> Richard
>
> Actually, I just came across a similar issue last week.  A colleague
> was trying to run Matlab code in Octave that made use of the
> matlab.mixin.heterogeneous class [1]
>
> Maybe it's possible to import an entire namespace into another so we
> could import matlab.* into the octave namespace?
>
> Carnë
>
> [1] https://uk.mathworks.com/help/matlab/ref/matlab.mixin.heterogeneous-class.html
>


I was thinking maybe something you could put in your .octaverc like

alias_namespace ('octave', 'matlab');

that makes 'matlab' or whatever, an alias of 'octave'.

I don't know if there's any copyright issues with using matlab, but this
would also sidestep them, since users could put what they like here.

Richard

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.