octave-maintainers
[Top][All Lists]
Advanced

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

Re: core, matlab, & OF name conflicts [Was: strsplit needs an update]


From: Ben Abbott
Subject: Re: core, matlab, & OF name conflicts [Was: strsplit needs an update]
Date: Sun, 31 Mar 2013 11:04:40 -0400

On Mar 31, 2013, at 10:54 AM, Richard Crozier wrote:

> On 31/03/2013 15:28, Ben Abbott wrote:
> 
>> On Mar 31, 2013, at 9:05 AM, Ben Abbott wrote:
>> 
>>> On Mar 31, 2013, at 7:53 AM, Carnë Draug wrote:
>>> 
>>>> On 30 March 2013 15:50, Ben Abbott <address@hidden> wrote:
>>>> 
>>>>> On Mar 27, 2013, at 12:50 PM, Jordi Gutiérrez Hermoso wrote:
>>>>> 
>>>>>> So this is why it's always an annoyance to try to implement something
>>>>>> before Matlab... We've had strsplit since 2009 in Octave, and in 2013,
>>>>>> TMW finally implements it themselves, with a differing calling form
>>>>>> than ours:
>>>>>> 
>>>>>>  http://www.mathworks.com/help/matlab/ref/strsplit.html
>>>>>> 
>>>>>> Anyone feel like chasing after this?
>>>>>> 
>>>>>> - Jordi G. H.
>>>>> I've prepared a version that is compatible with Matlab, but compatibility 
>>>>> means that the current behavior must be broken.  There are many files 
>>>>> which rely upon strsplit().
>>>>> 
>>>>> [...]
>>>>> 
>>>>> I've modified the files to use the new version, and produced a changeset. 
>>>>>  I don't see any regressions, but this may break some code on 
>>>>> Octave-Forge.
>>>> It does. There's a couple of functions in OF that use strsplit. The
>>>> problem would be matching a new release of Octave and packages that
>>>> make use of it.
>>>> 
>>>> Is anyone interested in contacting Mathworks to propose formation of
>>>> some sort of consortium to avoid this sort of things in the future? :p
>>>> 
>>>> Carnë
>>> In addition to Mathwork's new strsplit(), they have introduced strjoin().
>>> 
>>>     http://www.mathworks.com/help/matlab/ref/strjoin.html
>>> 
>>> Once strjoin() is added the compatible version may be used to obtain the 
>>> conventional behavior by ...
>>> 
>>>     cstrsplit = @(str,del, collapsedelimiters=false) strsplit (strjoin 
>>> (cellstr (str), del(1)), num2cell (del(:)), collapsedelimiters)
>>> 
>>> The strjoin() function is also a problem for OF.
>>> 
>>>     http://octave.sourceforge.net/strings/function/strjoin.html
>>> 
>>> However, the OF implementation does provide a good starting point for 
>>> implementing strjoin() for Octave's core.
>>> 
>>> Ben
>> The conflicts between names of m-files isn't going away.  Should a naming 
>> convention for OF packages be adopted to reduce the likelihood of a name 
>> conflict between Octave core and/or Matlab?
>> 
>> Perhaps the package functions could begin with a prefix?  For example, all 
>> control package functions could begin with "ctrl_".  Thus foo.m becomes 
>> ctrl_foo.m?
>> 
>> Ben
> 
> Isn't the real issue here a lack of namespaces? With the new classdef branch 
> I believe the Matlab 'package' structure (adding + to the start of 
> directories to sort-of make them into a namespace) is being implemented. 
> Perhaps forge packages could start using this? Otherwise it will just keep 
> happening. Alternatively, a superior namespace scheme could be implemented in 
> Octave (just like that you know, it's easy isn't it? ;-) ).
> 
> Richard

That is a much better solution!

        
http://www.mathworks.com/help/matlab/matlab_oop/scoping-classes-with-packages.html

Ben




reply via email to

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