Adam Majewski wrote:
> mok-kong shen wrote:
>
>> Being beginner, I can't understand why
>>
>> array (u,integer,5);
>> hh():=block(u[2]:333, print(u[2])); hh();
>>
>> works but on the other hand
>>
>> array (u,integer,5);
>> hh():=block(u[2]:333, print(u[2])); compile(hh); hh();
>>
>> leads to an error message.
> Maybe try single quote operator :
>
> array (u,integer,5);
> hh():=block(u[2]:333, print(u[2])); compile('hh); hh();
>
> (I think that it comes from Lisp )
Indeed that works. In another larger program of mine that runs without
the quote in the compile command, there were a number of warnings
on compilations, e.g. "Warning-> x is an undefined global variable".
With your tip I again compiled it, this time with the quote in the
compile command and found that no such warnings came out. So the
quote seems to cause some differences in general. Should one always
use the quote?
Thanks.
M. K. Shen