On 26 March 2010 01:54, Søren Hauberg <[email protected]> wrote:
> tor, 25 03 2010 kl. 21:54 -0400, skrev Carnë Draug:
>> Also, I've noticed another possible bug in this function. If there's
>> only one file selected, the output is a string, if not, is a cell
>> array. That's ok because when I write the code, I define if I want
>> just 'single' or 'multiple'. However, if I choose 'mutiple', the user
>> still has the possibility to pick only one file, making the output a
>> string instead of a cell array. Is this behavior desirable or should I
>> change it to always place the output in a cell array if 'multiple' is
>> on, even if there's only one file?
>
> It sounds reasonable to me to fix this behaviour. Go ahead. I am not
> sure if it is best to always return a cell array (also when using
> 'single') or if we should only always return a cell array when using
> 'multiple'. If you decide to fix this, I'll let you make the
> decision :-)

I slept over this and I think it's better to return a cell array only
with 'mutiple'. I have three reasons for this:
1 - when someone picks 'single', he'll be most likely expecting a string;
2 - If only one string is expected as output, then he probably doesn't
want to write {1} through the code. In the case that he does want the
string in a cell array, together with other stuff, it makes more sense
to be him doing it, and place the output in the right cell;
3 - backwards compatibility.

Carnë Draug

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to