Red: cannot set `err` word to any value

Created on 4 Sep 2017  路  4Comments  路  Source: red/red

"Fantastic beasts and where to find them":

>> abracadabra: try [1 / 0]
*** Math Error: attempt to divide by zero
*** Where: /
*** Stack:  

>> ? abracadabra
ABRACADABRA is an error! value: make error! [
    code: 400
    type: 'math
    id: 'zero-divide
    arg1: none
    arg2: none
    arg3: none
    near: none
    where: '/
    stack: -161007704
]
>> err: probe try [1 / 0]
make error! [
    code: 400
    type: 'math
    id: 'zero-divide
    arg1: none
    arg2: none
    arg3: none
    near: none
    where: '/
    stack: -161007692
]
*** Math Error: attempt to divide by zero
*** Where: /
*** Stack: probe  

>> ? err
ERR is a none! value: none
status.built status.tested type.bug

All 4 comments

Actually it's not possible to set err to any value:

>> err: 1
== 1
>> err
== none

Eagle eye @Oldes !

It is set here https://github.com/red/red/blob/master/environment/console/engine.red#L177 using set/any which function does not detect as local.

Nice catch and fix!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

toomasv picture toomasv  路  8Comments

loziniak picture loziniak  路  5Comments

theSherwood picture theSherwood  路  7Comments

SteeveGit picture SteeveGit  路  8Comments

tmpbci picture tmpbci  路  8Comments