On Sat, 30 Apr 2005, Aaron Sherman wrote:
On Sat, 2005-04-30 at 22:24 +0800, Autrijus Tang wrote:On Sat, Apr 30, 2005 at 09:13:26AM -0500, Abhijit Mahabal wrote:I do not see how any auto-threading occurs in that code. It is completely innocuous in that sense, and I don't think that is what horrified David. What was troublesome was, I think: my Str|Int $x; $x.foo(); # runs two methods and returns a junction
That would be absolutely horrible.
Then tell me what $!.can("chars") returns, assuming that $! is implemented as an "any" junction of Int and Str values?
If $! were explicitely "Yes"|1, then I agree that it returns false|true.
I believe that in the code you wrote..
$x = ::("Int") | ::("Str") my ::($x) $y;
$x is a junction, and $y is not a junction. "type", to me, is just a sticky note attched to an object. I would not like to see autothreading on every junctive sticky. In the code above, if there were a method called .type(), then $y.type() would indeed return a junction, but not by running two methods and orring their output.
Str|Int is simply the type of "Yes"|1, isn't it?
Hmmm... I am not sure. Maybe the type is just "Junc" or something. Str|Int is also the type of 7 and of "yes".
Moreover, if the return type of a method is junctive, would you want that menthod to autothread too?
--abhijit
Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/