On Mon, 11 Jan 2021, Artur Tarassow wrote:
Am 11.01.21 um 20:21 schrieb Allin Cottrell:
> On Mon, 11 Jan 2021, Artur Tarassow wrote:
>
>> Am 11.01.21 um 01:29 schrieb Allin Cottrell:
>>> On Sun, 10 Jan 2021, Sven Schreiber wrote:
>>>
>>>> Hi,
>>>> another minor question before release. Consider this example:
>>>>
>>>> <hansl>
>>>> strings S = defarray("a")
>>>> print S[i] # no output, no reaction
>>>> </hansl>
>>>>
>>>> I _don't_ expect this to work, that's not the point. But
shouldn't there
>>>> be some kind of parsing error?
>>>
>>> Yes. Fixed.
>>
>> Thanks for the quick fix, Allin. However, I expected to be able to catch
>> the error by
>>
>> <hansl>
>> strings S = defarray("a")
>> catch print S[i]
>> eval $error
>> </hansl>
>>
>> but I get the error message:
>> "> S[i]
>> The symbol 'i' is undefined"
>
> You're getting a warning, no?
>
> <hansl>
> strings S = defarray("a")
> catch print S[i]
> eval $error
> print "still going!"
> </hansl>
>
> <output>
> ? strings S = defarray("a")
> ? catch print S[i]
>> S[i]
> The symbol 'i' is undefined
> ? eval $error
> 2
> still going!
> </output>
Interesting, indeed it works but only outside a function. I ran
this within a function where it stops hard [...]
I'm going to leave this one till after release. "print" is kind of
an oddity; you should find that catch works OK with "eval" instead.
Later we can consider merging eval and print, so that (a) print
works for sub-objects, as eval does, but (b) it does the current
"full dress" print job if the object turns out to be a top-level
variable.
Allin