Dear Sven,
You got the point of my
second message absolutely exactly!
Oleh

19 грудня 2015, 17:21:08, від "Sven Schreiber" <svetosch@gmx.net>:

Am 18.12.2015 um 21:59 schrieb Allin Cottrell:
> On Fri, 18 Dec 2015, oleg_komashko@ukr.net wrote:
> 
>> Thank you, Sven It works with *matrices. Unfortunately, it seems,
>> there are no (yet?) defaults for [usual] matrices. Of course, it has a
>> way around, but many function calls in many situations would have
>> looked much shorter
> 
> Can you give us an idea of contexts in which you'd like to be able to
> define a default matrix argument, and where the pointer form is somehow
> unsuitable?
> 

While personally I'm not much concerned with a default matrix, I would
like to use this discussion to ask about the necessity of the pointer
form for marking the argument optional. And it may well be that it has
been discussed before.

To be concrete, why would it be problematic to have something like this:

<hansl-not-correct-right-now>
function void example(matrix m[null])	
  if !isnull(m)
    print m
  endif
end function

example(I(3))
</hansl-not-correct-right-now>

Changing the function signature to "matrix *m[null]" is easy enough, but
then of course you need an extra line before the call:
marg = I(3)
example(&marg)

Basically it's this extra and kind of unnecessary line that is bothering
me (and Oleh I guess) because it "contaminates" the script.

thanks,
sven

_______________________________________________
Gretl-devel mailing list
Gretl-devel@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel