On Wed, Sep 27, 2000 at 05:29:22AM -0000, Perl6 RFC Librarian wrote:
> $ok = try $scalar;
> $ok = try @array
> $ok = try %hash;
> $ok = try ⊂
I'd like to see a more specific name for these. 'try' is too useful a word
for core to gobble it up for everything (IMHO). attempt_lock? Or simply
put these in a module and not export try by default. (Also, try might get
used for exceptions -- or would at least confuse people who expect it to be.)
Also, it'd be nice if an implicit join was done if a Thread was used in a
stringifying or numifying context. That way, you could treat it as a
function call that ran until it was acatualy needed, as in $factorial27 =
async{factorial(27)}, and somewhere later in your program, did a computation
involving it. At that point, $factorial27 would be forced to take a value
(to whit, 27!), and would no longer be a Thread. OTOH, this is broken wrt
things not returning numbers or strings (IE lists or refs), and makes
numifying/stringifying a mutator, which is probably a Bad Thing.
However, it seems amazingly useful. Hm, I think it could be done easily
enough as a wrapper class.
Sorry I didn't get these in on v2; I don't follow the perl6-language* lists
as well as I probably should. Too much trafic, to little time.
-=- James Mastros
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GU>CS d->-- s-:- a20 C++ UL+++@ P+++>+++++ L++@ E-() N o? K? w@ M-- !V
PS++ PE Y+ PGP(-) t++@ 5+ X+++ R+ tv+ b+++ DI+ D+ G e>++ h! r- y?
------END GEEK CODE BLOCK------