strange behaviour on creating cell array with canonicalize_file_name()

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

strange behaviour on creating cell array with canonicalize_file_name()

Richard Crozier
I'm seeing the following behaviour on hg id ef5a12a487b9+ (classdef)

>> x = {canonicalize_file_name ('')}
error: Invalid call to canonicalize_file_name.  Correct usage is:

  -- Built-in Function: [CNAME, STATUS, MSG] = canonicalize_file_name
           (FNAME)


Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the [hidden email]
mailing list.
>> x = canonicalize_file_name ('')
x =

Is this expected/reproducible by others? Why can't the output of  
canonicalize_file_name be put in a cell?

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: strange behaviour on creating cell array with canonicalize_file_name()

Mike Miller
On Tue, Oct 22, 2013 at 13:00:18 +0100, Richard Crozier wrote:

> I'm seeing the following behaviour on hg id ef5a12a487b9+ (classdef)
>
> >>x = {canonicalize_file_name ('')}
> error: Invalid call to canonicalize_file_name.  Correct usage is:
>
>  -- Built-in Function: [CNAME, STATUS, MSG] = canonicalize_file_name
>           (FNAME)
>
>
> Additional help for built-in functions and operators is
> available in the online version of the manual.  Use the command
> 'doc <topic>' to search the manual index.
>
> Help and information about Octave is also available on the WWW
> at http://www.octave.org and via the [hidden email]
> mailing list.
> >>x = canonicalize_file_name ('')
> x =
>
> Is this expected/reproducible by others? Why can't the output of
> canonicalize_file_name be put in a cell?

Yes, this is expected. Nothing specific to the particular function you
are calling. See

  http://www.gnu.org/software/octave/doc/interpreter/Octave-Sources-_0028m_002dfiles_0029.html

The parser interprets space inside of [] or {} as separating elements of
the matrix or cell array, so canonicalize_file_name is called with no
arguments. For these kinds of uses, you have to remove the space after
the function name.

--
mike
Reply | Threaded
Open this post in threaded view
|

Re: strange behaviour on creating cell array with canonicalize_file_name()

Richard Crozier
On 22/10/2013 13:59, Mike Miller wrote:
> On Tue, Oct 22, 2013 at 13:00:18 +0100, Richard Crozier wrote:
 >
> The parser interprets space inside of [] or {} as separating elements of
> the matrix or cell array, so canonicalize_file_name is called with no
> arguments. For these kinds of uses, you have to remove the space after
> the function name.
>

Ahh, yes, thanks, that rings a bell. Thanks for explaining.

Richard

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