Em Seg, 2008-12-01 às 18:21 -0800, Darren Duncan escreveu: > I'm wondering how to write anonymous value literals of some Perl 6 basic > types, > and I didn't see mention of this in synopsis 2.
Getting away from your question entirely, I think the issue here is that while Perl 6 has support for strong typing, it is not really expected that you approach your code with such strong typing... Let me try to rephrase that... a "Bit" is something that .^does(Bit), therefore "0" and "1" can certainly be a Bit, while they can also certainly be an "Int"... But most importantly, they are probably going to be something implemented in low-level that can be used as a Bit, as a Num or as an Int. I'm not sure this is an aspect that everybody got, but there isn't really a way to tell the actual implementation type of an Object in Perl 6, you can introspect the object as long as you wish, but you'll be always asking something to that object, and the object itself is the one giving the answers, therefore it can lie about itself, and that's fine. There are even rumors that $obj.WHAT should return a canonical type, even if its implemented by some low-level optimized version... So, how to write anonymous value literals of that values? Well, you won't need to do that... daniel