octave-maintainers
[Top][All Lists]
Advanced

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

Re: Keeping both tmpnam and tempname?


From: Philip Nienhuis
Subject: Re: Keeping both tmpnam and tempname?
Date: Tue, 7 Oct 2014 12:06:27 -0700 (PDT)

Mike Miller wrote
> On Mon, Oct 06, 2014 at 13:50:21 -0700, Rik wrote:
>> Should Octave continue to keep both tmpnam and tempname in the global
>> function namespace?  tempname is the function name that Matlab uses. 
>> tmpnam is the C function name for the same behavior.  We have both and
>> one
>> is just an alias for the other.  It seems like we could unclutter things
>> a
>> bit by agreeing to just keep the Matlab compatibile name "tempname".
> 
> I'm usually in favor of keeping extra functions that match the standard
> C library.
> 
> In this case, we have "tmpnam" which is providing the functionality of
> both of the libc functions "tmpnam" (which is like Matlab's "tempname")
> and "tempnam", depending on how it's called. Then we also have "mkstemp"
> and "tmpfile". I'd vote for getting rid of "tmpnam" unless there are
> strong reasons for keeping it for compatibility.

What is exactly the problem with keeping aliases; can't tmpnam() remain to
be a simple wrapper for tempname, or vice versa as it is now? It doesn't
seem to be a big maintenance burden.

I'm all for keeping things simple where reasonable, but removing tmpnam will
lead to a number of code changes, also in OF packages. Does the benefit of
that little bit of uncluttering outweigh the work of removing tmpnam
everywhere in Octave code (inside and outside of core Octave)?

Looking in the respective help strings, I see that mkstemp, tmpfile and the
tmpnam/tempname duo each behave slightly differently. So I'd feel there seem
to be better opportunities to cut down on complexity.

The other thing is that I feel that Octave shouldn't try to be a verbatim
copy of Matlab.
A few weeks ago I saw strmatch() being deprecated, w/o an apparent reason
(or I missed that discussion); I can only surmise that it is done because ML
advises against it for some years now, yet it is still present in ML r2014b.
However, strmatch is so useful that at my workplace the Matlab addicts have
even made a strmatchi().

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Keeping-both-tmpnam-and-tempname-tp4666868p4666886.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

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