Re: Junctions as arguments (Pugs bug)

2006-12-20 Thread Jonathan Rockway
Ovid wrote:
(reversed the message a bit)
   is 'b', any('a' .. 'h'), 'junctions should work';

This looks like a Test bug; it's doing something like:

   is 'b', 'a' # not ok
   is 'b', 'b' # ok
   is 'b', 'c' # not ok
   ...

If you write:

   ok 'b' === any('a'..'h')

The result is one passing test.


 That outputs something like the following on my system (Version: 6.2.13
 (r14927))

   any(VInt 1,VInt 2,VInt 3,VInt 4)
   any(VRef Scalar:0x2aa80e0)

My question is, what is the expected output of say-ing a junction?
Should say (1|2|3) randomly print 1, 2, or 3?  Should say (123)
say 1, then say 2, then say 3?

I can understand it going either way (although I'd lean towards what
Ovid is expecting), but it would be good to hear what others think
before tests are committed.


-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup;


Re: Junctions as arguments (Pugs bug)

2006-12-20 Thread Larry Wall
On Wed, Dec 20, 2006 at 10:26:41AM -0600, Jonathan Rockway wrote:
: Ovid wrote:
: (reversed the message a bit)
:is 'b', any('a' .. 'h'), 'junctions should work';
: 
: This looks like a Test bug; it's doing something like:
: 
:is 'b', 'a' # not ok
:is 'b', 'b' # ok
:is 'b', 'c' # not ok
:...
: 
: If you write:
: 
:ok 'b' === any('a'..'h')
: 
: The result is one passing test.
: 
: 
:  That outputs something like the following on my system (Version: 6.2.13
:  (r14927))
: 
:any(VInt 1,VInt 2,VInt 3,VInt 4)
:any(VRef Scalar:0x2aa80e0)
: 
: My question is, what is the expected output of say-ing a junction?
: Should say (1|2|3) randomly print 1, 2, or 3?  Should say (123)
: say 1, then say 2, then say 3?
: 
: I can understand it going either way (although I'd lean towards what
: Ovid is expecting), but it would be good to hear what others think
: before tests are committed.

What you're seeing is standard autothreading behavior, which is
described in S09, Junctions.  To avoid autothreading, a routine must
declare itself prepared to handle junctions with an appropriate type
signature, and I'm not sure we want to complicate Test to that extent,
since it makes it harder to port.

Larry