On Fri, 16 Oct 2015, Sven Schreiber wrote:
Am 16.10.2015 um 11:31 schrieb Riccardo (Jack) Lucchetti:
> On Fri, 16 Oct 2015, Sven Schreiber wrote:
>
>>
>> bundle bcheck
>> bcheck.o = 2
>> print bcheck.o
>>
>> This prints the series with number 2, not the number 2 itself.
>
> This is a bug alright, but not in the way you mean (as far as I
> understand your point). "bcheck.o" is not a variable you can print:
it's
> an expression.
I guess everything is an expression in some sense; and to me it's a
variable because it just points to some memory location (or doesn't
it?), no calculation has to take place to get its value.
>
> The real bug is that the scalar contained in "bcheck.o" is interpreted
> as a series ID, which IMO shouldn't happen; but maybe Allin has a
> different perspective on this.
Yes actually this series-ID thing is somewhat vague. You could argue
that "print me", where me==2, is also intended to get to the series with
ID 2...
Yes, I think that's right and it's actually not a bug. As usual in
gretl commands (though not functions) series can be identified by ID
or name: "print 2" prints series number 2. You surely wouldn't expect
"print 2" to print the number 2; the ways to do that are
print "2"
printf "%d\n", 2
"eval 2", on the other hand, does print "2", and that again seems
right to me, since eval means "evaluate an expression, print the
result, then discard the result". By the same token, "eval bcheck.o"
will print "2" OK.
Allin