Re: s/true/better name/

2005-03-17 Thread Aldo Calpini
John Macdonald wrote: A shotgun brainstorming of possible operator names: well, I didn't follow this thread very closely (and I don't know if it is officially closed :-) but I suddenly thought about yes. what about: $x = not $a or $b; # vs $x = yes $a or $b; $yesno = yes any(@foo) ==

splat operator and context

2005-03-09 Thread Aldo Calpini
I was trying to implement unary * (list flatten or splat operator) in pugs yesterday, and I came to the conclusion that I really don't grok how context works in Perl6 (I also really don't grok Haskell, but this is another story...). if I understand correctly, all these are equivalents: my @a

Re: splat operator and context

2005-03-09 Thread Aldo Calpini
Juerd wrote: my @a = 1,2,3; my $a = 1,2,3; These are (my @a = 1), 2, 3; (my $a = 1), 2, 3; if I understand precedence correctly. (S03) right, sure. I vaguely remember something about comma instead of parens being the list constructor, but maybe it was just in my fantasy. and thanks for

Re: Comma in (sub) traits?

2005-03-07 Thread Aldo Calpini
wolverian wrote: Hello all, while writing some experimental code with Pugs, I realised that it is a bit hard for me to parse the following type of declaration: sub greeting (Str $person) returns Str is export { Hello, $person } don't know if it helps, but I guess that you can also

Re: Optional binding

2005-03-07 Thread Aldo Calpini
David Storrs wrote: Urk. I, for one, will definitely find this surprising. I would have expected: x = whatever; $y = 1; z = 2 3 to obtain what you have expected, you need to explicitly treat the array as a list of values with the unary splat: foo($x, [EMAIL PROTECTED]); But I suppose it's

Re: Optional binding

2005-03-07 Thread Aldo Calpini
Larry Wall wrote: Or, assuming you might want to generalize to N dimensions someday, just sub bar ([EMAIL PROTECTED]) {...} and deal with it as in Perl 5 as a variadic list. I suppose one could say sub bar ([EMAIL PROTECTED] is shape(3)) {...} and get checking on the argument count. if I

Re: Adding linear interpolation to an array

2005-03-07 Thread Aldo Calpini
Dave Whipp wrote: Does defining the invocant as Num @self is constant constrain the application of the role to read-only uses of indices? I don't think you need is constant. arguments are readonly by default, unless you give them the is rw trait. I guess that is constant means that you can

Re: scoping functions as list operators?

2005-02-25 Thread Aldo Calpini
Stéphane Payrard wrote: # set? I don't think so. my $a, $b, $c set 1..3 ; # alphabetic like and, or, xor? # and what precedence relative to them? well, I'm not sure the feature is good, but I have some idea about the sign that could be used for this :-) we have

Re: proposal: use \ as none junction delimeter

2005-02-11 Thread Aldo Calpini
Thomas Sandlaß wrote: my $x = 1|2|3; # any my $x = 1^2^3; # one my $x = 123; # all my $x = 1\2\3; # none [...] if $a $b { ... } # and if $a || $b { ... } # or if $a ^^ $b { ... } # xor if $a // $b { ... } # err if $a \\ $b { ... } # nor Well? that's all very Huffy (short

Re: [OT] Perl 6 Summary for 2004-10-01 through 2004-10-17

2004-10-26 Thread Aldo Calpini
Larry Wall wrote: I suppose if I were Archimedes I'd have climbed back out and shouted Eureka, but as far as I know Archimedes never made it to Italy, so it didn't occur to me... well, Archimedes *was* italian. for some meaning of italian, at least. he was born in Syracuse (the one in Sicily, not

Re: String interpolation

2004-07-21 Thread Aldo Calpini
Larry Wall wrote: Hmm. That makes me wonder what the slice notation for everything is. maybe @foo[..] (a short form for @foo[0..Inf]) ? %foo{..} should also be allowed, of course (which unfortunately is not a short form for 0..Inf). or perhaps, with a slight analogy with filesystems, @foo[*]

simple grammar example

2004-06-09 Thread Aldo Calpini
hello gentlemen, I'm preparing a talk about Perl6 for the Italian Perl Workshop, and I would like to have a slide comparing a BNF (yacc/bison) grammar to a Perl6 one, to show how powerful in parsing/lexing Perl6 regexen are. so I ask your assistance in helping me putting up a simple, yet

Re: Named parameters vs. slurpy hash syntax: brittle call syntax!

2004-05-06 Thread Aldo Calpini
On Thu, 2004-05-06 at 02:36, Dov Wasserman wrote: After the New And Improved logError() routine is rolled out, it seems to me that this log statement should generate a compile-time error, since the named Int parameter prio is given a non-integer argument HIGH. At best, this should be a

Re: Named parameters vs. slurpy hash syntax: brittle call syntax!

2004-05-06 Thread Aldo Calpini
On Thu, 2004-05-06 at 02:36, Dov Wasserman wrote: To distinguish these two cases, what if we used the := binding operator to bind an argument to a named parameter: logError($err_msg, prio := 3); but how would this look like to a subroutine that is not defined to accept a named parameter

Re: A12: on inheriting wrappers

2004-05-04 Thread Aldo Calpini
On Fri, 2004-04-30 at 19:01, Larry Wall wrote: That would almost certainly fail with an error saying that it couldn't find your new subroutine. The sigil does not imply dispatch, and the default .new is inherited, not autogenerated, last I checked. :-) ouch. too true. so I guess my Animal

A12: on inheriting wrappers

2004-04-30 Thread Aldo Calpini
let's suppose I want to build a class that keeps track of the objects it creates. let's suppose that I want this class to be the base for a variety of classes. let's suppose that I decide, rather than fiddling with the default constructor, to wrap it up. something like: class Animal {

Re: A12 Versioning

2004-04-29 Thread Aldo Calpini
On Mon, 2004-04-26 at 16:20, Richard Proctor wrote: Issues: 1) Why does this only use Version and Author? Suppose there are versions for different oses or that use other particular libraries that are wanted or not? personally, I think this should be handled in the class itself. you always

Re: A12: a doubt about .meta, .dispatcher and final methods

2004-04-29 Thread Aldo Calpini
On Fri, 2004-04-23 at 17:24, Larry Wall wrote: [...] On the sixth hand, by that argument, since .dispatcher is aiming at a Class, it should be an uppercase C. :-) why not wash all these hands altogether? IDEA 1 implementing a final trait should be trivial enough (it just throws an

A12: a doubt about .meta, .dispatcher and final methods

2004-04-23 Thread Aldo Calpini
hello, sorry if this has been discussed before, I did a quick search in the Archive and the summaries but can't find a similar topic. I've just read A12, and while I really like the inherent orthogonality of the whole object system as it is (will be) implemented, there is something that puzzles

Re: A12: a doubt about .meta, .dispatcher and final methods

2004-04-23 Thread Aldo Calpini
Aaron Sherman wrote: However, in existing CPAN modules that I happen to have in my cache at the moment: [...] So it's not THAT bad. hmmm... I think you should probably also grep for modules that do something like: my $self = { meta = 'something', dispatcher =

A6: objects and/or types (was: P6FC)

2003-03-14 Thread Aldo Calpini
Simon Cozens wrote: ...and I don't know if macros are actually objects and can be tossed around, or if they're just part of the compilation process. they have their proper place in the diagram Larry put in A6. furthermore, he says: These syntactic forms correspond the various Routine types in

P6FC

2003-03-13 Thread Aldo Calpini
hello everybody, I'm just a poor newbie here, so please bear with me :-) while reading the last Apocalypse I thought that maybe time has come to write things down (like the recent effort on properties), so I started to put down a tentative class hierarchy of the Perl6 language (I call it P6FC