octave-maintainers
[Top][All Lists]
Advanced

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

Re: [forge] multiples private strsplit.m


From: Ben Abbott
Subject: Re: [forge] multiples private strsplit.m
Date: Sat, 20 Jun 2015 11:12:09 -0400

> On Jun 20, 2015, at 2:19 AM, Marco Atzeri <address@hidden> wrote:
> 
> Hi,
> running tests for most forge package m-files, that I am packaging
> for cygwin, I noticed that there are some old copy of strsplit.m around
> 
> /usr/share/octave/packages/cgi-0.1.0/@cgi/private/strsplit.m
> /usr/share/octave/packages/dataframe-1.1.0/@dataframe/private/strsplit.m
> /usr/share/octave/packages/miscellaneous-1.2.1/private/strsplit.m
> 
> that have at least a problem in the test area
> 
> + pkg ('load', 'cgi')
> + test ('/usr/share/octave/packages/cgi-0.1.0/@cgi/private/strsplit.m')
> ***** assert (strsplit ("road to^hell", " ^"), {"road", "to", "hell"})
> !!!!! test failed
> ASSERT errors for:  assert (strsplit ("road to^hell", " ^"),{"road", "to", 
> "hell"})
> 
>  Location  |  Observed  |  Expected  |  Reason
>     .          O(1x1)       E(1x3)      Dimensions don't match
> + pkg ('unload', 'all')
> + endscript;
> 
> Questions:
> - any specific reason to maintain this private function in the
>  packages ?
>  If I understood correctly private functions are only used if
>  octave itself do not provide them.
> 
> - it was ever used the form
>     strsplit ("road to^hell", " ^")
> 
>  instead of
>     strsplit ("road to^hell", {" ","^"})
> 
>  for what I see the three package do not use it.
> 
> Regards
> Marco

In case it isn’t clear … If you run …

        test ('/usr/share/octave/packages/cgi-0.1.0/@cgi/private/strsplit.m’)

… from any directory other than "/usr/share/octave/packages/cgi-0.1.0/@cgi” it 
will run the tests present in the private version of strsplit, but will use the 
strsplit from Octave’s core. The private functions are only seen and used by 
m-files which are in same directory which contains the “private” directory.

In any event, if an “fgrep -n strsplit 
/usr/share/octave/packages/cgi-0.1.0/@cgi/*.m” doesn’t return anything, then 
the private version can be removed. Same for ...

        fgrep -n strsplit 
/usr/share/octave/packages/dataframe-1.1.0/@dataframe/*.m

        fgrep -n strsplit /usr/share/octave/packages/miscellaneous-1.2.1/*.m

Ben




reply via email to

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