REBOL3 tracker
  0.9.12 beta
Ticket #0000771 User: anonymous

Project:



rss
TypeBug Statusbuilt Date7-May-2009 09:31
Versionalpha 51 CategoryError Handling Submitted byLadislav
PlatformAll Severitymajor Prioritynormal

Summary TYPE? RETURN value doesn't return
Description the code

do does [type? return 1 2]

yields 2 in R3, while the same code yields 1 in R2.

My understanding is that the behaviour of R2 is correct.
Example code
>> do does [type? return 1 2]
== 2
>> do does [type? return 1]
== error!

Assigned ton/a Fixed inr3 master Last Update19-Feb-2014 20:06


Comments
(0000816)
BrianH
26-May-2009 18:01

The same error applies to TYPE? THROW - see #862.
(0001341)
BrianH
14-Jul-2009 01:19

The implementation of RETURN and THROW has changed in R3 to generating a special kind of error, which then throws when evaluated, similar to any other error. The effect this has on TYPE? RETURN might be too difficult to change, since it comes as a side effect of having the type spec of the value argument be [any-type!].

Given that this code pattern is arguably an error anyways, this might be a good idea to dismiss.
(0001385)
Ladislav
16-Jul-2009 13:58

An example illustrating, why the ticket should not be dismissed:

; This is how R3 works now:
>> condition: true
== true
>> loop 3 [print 1 = (if condition [break] 1)]
false
false
false

; For contrast, this is how R2 interprets it:
>> condition: true
== true
>> loop 3 [print 1 = (if condition [break] 1)]
>>
(0002061)
BrianH
3-Mar-2010 22:24

See bug #1509 for the real problem.
(0002894)
Ladislav
18-Nov-2010 14:12

In the core-tests suite

Date User Field Action Change
19-Feb-2014 20:06 BrianH Status Modified problem => built
19-Feb-2014 20:06 BrianH Fixedin Modified => r3 master
19-Feb-2013 10:29 Ladislav Description Modified -
18-Nov-2010 14:12 Ladislav Comment : 0002894 Added -
3-Mar-2010 22:24 BrianH Comment : 0002061 Added -
8-Feb-2010 14:32 Ladislav Comment : 0001385 Modified -
8-Feb-2010 14:31 Ladislav Comment : 0001385 Modified -
16-Jul-2009 13:58 Ladislav Comment : 0001385 Added -
14-Jul-2009 01:24 BrianH Comment : 0001341 Modified -
14-Jul-2009 01:21 BrianH Comment : 0001341 Modified -
14-Jul-2009 01:20 BrianH Comment : 0001341 Modified -
14-Jul-2009 01:19 BrianH Comment : 0001341 Added -
14-Jul-2009 01:15 BrianH Status Modified reviewed => problem
14-Jul-2009 01:15 BrianH Category Modified => Error Handling
26-May-2009 18:01 BrianH Comment : 0000816 Added -
14-May-2009 05:19 carl Severity Modified minor => major
7-May-2009 19:36 BrianH Code Modified -
7-May-2009 19:36 BrianH Summary Modified Return => TYPE? RETURN value doesn't return
7-May-2009 19:34 BrianH Status Modified submitted => reviewed
7-May-2009 19:34 BrianH Description Modified -
7-May-2009 09:31 Ladislav Ticket Added -