[Scilab-users] Dump the output of a function

Clément David Clement.David at esi-group.com
Tue Feb 6 18:13:30 CET 2018


Le mercredi 17 janvier 2018 à 20:36 +0100, Samuel Gougeon a écrit :
> Le 17/01/2018 à 20:26, Samuel Gougeon a écrit :
> > Le 17/01/2018 à 18:16, antoine monmayrant a écrit :
> > > Hello all, 
> > > 
> > > 
> > > I might say something really stupid, but can't we define a special variable like %eps, %i, etc
> > > to act as a black hole ? 
> > > Something like %null (like piping to /dev/null or a null pointer) or a better name
> > > (%blackhole, %lostforever, %byebye, ;-) ). 
> > > The idea being that no memory is allocated when someone try to affect some value to it: 
> > > 
> > > [%null,%null,kb] = intersect(grand(1,10,"uin",0,9), grand(1,10,"uin",0,9)); 
> >  
> > A true black hole has even no name :)
> > Otherwise, the shorter the better, and "_" would be nice after deprecating _() (*).
> > 
> > Anyway, IMO this black hole feature has a very low priority compared to some other ones, like
> > some big regressions (bug 13808 = 14881, sparse() with repeated indices, etc etc) or some very
> > and longly expected ones like a varprot()...
> > 
> > Samuel
> > 
> > (*) it could be renamed something like _tr() (standing for translate).
> > The number of occurrences of _() to be converted in the Scilab native code is very important,
> > but the conversion might be automated (since the gettext() scanner has a reliable detection
> > criterium, and only .sci, .sce, .tst and .dia.ref files are targeted
>  
> sorry, that's wrong. Other files in C, C++ etc, and xml have _() occurences as well.
> But it's possible to parse them with no issue, since the scanner  does it.

Exact the `_ = gettext` has been stolen from the C usage of gettext. In C the '_' is defined as a
macro for gettext and is used for the same purpose: how to have the simplest identifier possible for
some hidden purpose ?

To me, Samuel proposition to deprecate "_" usage is really good; having "_" defined by default is
weird as there is two usage for this symbol (think from Go/Python users and from C users).

Thanks,

--
Clément


More information about the users mailing list