On Wed, 25 Sep 2013, Sven Schreiber wrote:
the following questions have come up:
1) This doesn't work:
<hansl>
if {1} == {}
endif
</hansl>
Actually I can understand why, just checking if it's intended.
Well, so far "{}" is usable only as a stand-alone initializer, in which
capacity it's merely decorative, since
matrix m
does exactly the same as
matrix m = {}
I guess we could make "{}" a valid usage more generally, if there's a
use-case.
(Note that "if {1}=={2} ..." is OK, it's just "{}", used other
than in
simple assignment, that's choking gretl.)
2) But this also doesn't work (with suitably defined variables):
dummy = sscanf( strsub(isodate(newepochdate),"-",""), "%d",
newdate )
while the non-nested variant does work:
<hansl>
tempstr = strsub(isodate(newepochdate),"-","")
dummy = sscanf( tempstr, "%d", newdate )
</hansl>
Here I don't see why there should be a difference -- it rather looks as
if the earlier bug with string-producing functions hasn't been fully
squashed.
The first one ought to work, agreeed, but the problem here is different
from the earlier bug. The issue is that the sscanf() function uses the
same mechanism as the (old, deprecated) "sscanf" command, which gets
passed the whole line as a single argument. I guess it's time to get rid
of the command version and redo sscanf() as a proper function.
Allin