On 31 October 2011 21:00, Søren Hauberg <so...@hauberg.org> wrote: > man, 31 10 2011 kl. 20:52 +0000, skrev Carnë Draug: >> Hi >> >> while trying to port the perl Lingua::EN::Numbers module, I found that >> matlab's image processing toolbox had the iptnum2ordinal function so I >> wrote a clone of it too. However, this function has nothing to do with >> image processing (it takes a number and returns the ordinal such as 1 >> = first, 23 = 23rd). Should it still go in the image package? >> >> Here's the code anyway >> https://gitorious.org/octave-devel/inputparser/blobs/master/iptnum2ordinal.m > > Hmm, that's a weird place to put a function like that. Perhaps it's more > suited for the 'general' package or the 'strings' package? Given that > Matlab has it in their implementation as part of their image processing > tools I guess we can do the same if you think that's better.
I guess it depends if we want the image package to also be a clone of the image processing toolbox. My opinion would be to add it to the image package as a wrapper to a function in the general package (because in core, num2str is in general) named num2ordinal (without the "ipt" prefix). >From their online documentation, it appears they added this function to help people write their own tools with nicely formatted error messages such as "the second argument is incorrect". Unlike us, matlab toolboxes can't have an extra toolbox as dependency. I'm guessing every package will have its set of functions designed to help checking input. Carnë ------------------------------------------------------------------------------ Get your Android app more play: Bring it to the BlackBerry PlayBook in minutes. BlackBerry App World™ now supports Android™ Apps for the BlackBerry® PlayBook™. Discover just how easy and simple it is! http://p.sf.net/sfu/android-dev2dev _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev