Re: A12: Required Named Parameters Strike Back!

2004-05-05 Thread Abhijit A. Mahabal
On Wed, 5 May 2004, John Siracusa wrote: > Anyway, once we're spelling things out, don't forget to throw in some > traits for params that are required and must be provided as pairs. > Damian promised! ;) Looking thru what exists of P6C I saw this in P6C/Nodes.pm: use Class::Struct P6C::signatur

Re: Required Named Params and "go write your own grammar"

2004-05-04 Thread Abhijit A. Mahabal
On Tue, 4 May 2004, Luke Palmer wrote: > Abhijit A. Mahabal writes: > > Needing to know "the entire P6 grammar" isn't mouth watering. > > grammar Grammar::ReqNamed { > is Grammar::Perl; Ah, I see. That does answer my question. I had forgotten that g

Required Named Params and "go write your own grammar"

2004-05-04 Thread Abhijit A. Mahabal
Either way, I'd appreciate any thoughts/answers/pointers on this. --Abhijit Abhijit A. Mahabal http://www.cs.indiana.edu/~amahabal/

Re: A12: on inheriting wrappers

2004-04-30 Thread Abhijit A. Mahabal
> > role Logging { > > POST { > > foreach ( ::_.meta.getmethods() ) -> $method { > > $method.wrap( { > > log($somewhere, "calling $method"); > > call; > > log($somewhere, "called $method"); > >

Re: A12: on inheriting wrappers

2004-04-30 Thread Abhijit A. Mahabal
On Fri, 30 Apr 2004, Aldo Calpini wrote: > so I wanted to explore the possible interoperability of wrappers and > classes. another example I can think of: > role Logging { > POST { > foreach ( ::_.meta.getmethods() ) -> $method { > $method.wrap( { >

Re: A12: on inheriting wrappers

2004-04-30 Thread Abhijit A. Mahabal
On Fri, 30 Apr 2004, Aldo Calpini wrote: > 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, t

Re: MethodMaker techniques in Perl 6

2004-04-25 Thread Abhijit A. Mahabal
On Sun, 25 Apr 2004, Dave Whipp wrote: > > "Abhijit A. Mahabal" <[EMAIL PROTECTED]> wrote: > > Symbol tables and typeglobs and such belong to A10... and the * has been > > stolen... so I'll just speculate in pseudocode. > > Blocks-are-subroutines mak

Re: MethodMaker techniques in Perl 6

2004-04-25 Thread Abhijit A. Mahabal
On Sat, 24 Apr 2004, John Siracusa wrote: > Based on the "default accessors and encapsulation" thread, it seems like a > Perl 6 equivalent of Class::MethodMaker will be still be useful in our (or > at least "my") Brave New World. I've been pondering the best way to create > such a beast in Perl

A question about binary does

2004-04-22 Thread Abhijit A. Mahabal
extended{ # is this: die if any collision in any class method difference ($other where Set) {...} } $collector.stamps.difference(...); # okay $collector.coins.difference(...); # Is that legal? # In other words, is the singleton class like a closure or like a first-class class? Abhijit A

Re: A12: syntax to call Attributes

2004-04-21 Thread Abhijit A. Mahabal
On Wed, 21 Apr 2004, Brent 'Dax' Royal-Gordon wrote: > Which actually brings up an interesting question: > > class Silly { > has $.thing=1; > has @.thing=(2, 3); > has %.thing=(4 => 5, 6 => 7); > } I had assumed that'd be illegal: each of $.thing, @.thing and

Re: Is Dog|undef a legal type?

2004-04-19 Thread Abhijit A. Mahabal
> Abhijit A. Mahabal skribis 2004-04-19 11:00 (-0500): > > when Dog: ... > > when Array: ... > > Shouldn't that be: > > when Dog { ... } > when Array { ... } > > Or is there some .when that I have not yet heard of? Guilty as charged. My Perl6 is getting rusty... --Abhijit

Re: Apo 12: Space in method calls

2004-04-19 Thread Abhijit A. Mahabal
> No, obviously arguments. Okay, I see the problem. What you're missing > is that in an earlier Apocalypse, we said that postfix subscripts > and argument lists may not have an intervening space. Oh, I see. Yes, I had missed that. Thanks for clearing that up. --Abhijit

Is Dog|undef a legal type?

2004-04-19 Thread Abhijit A. Mahabal
: ... #obviously $obj can be a ref to an array, not itself an array } --Abhijit Abhijit A. Mahabal http://www.cs.indiana.edu/~amahabal/

Re: Apo 12: Space in method calls

2004-04-19 Thread Abhijit A. Mahabal
On Mon, 19 Apr 2004, Larry Wall wrote: > On Sat, Apr 17, 2004 at 01:07:44PM -0500, Abhijit A. Mahabal wrote: > : $obj.method ($x + $y) + $z > : > : >From the earlier examples (like $obj.method +1), I got the impression that > : you look ahead until you find a term or an operat

Apo 12: Space in method calls

2004-04-17 Thread Abhijit A. Mahabal
ull term, all by itself, and in that case would not this mean ($obj.method($x + $y)) + $z, the same as the other call it is contrasted with: $obj.method($x + $y) + $z What am I missing? --Abhijit Abhijit A. Mahabal http://www.cs.indiana.edu/~amahabal/

RE: Array/Hash Slices, multidimensional

2004-04-16 Thread Abhijit A. Mahabal
On Fri, 16 Apr 2004, Aaron Sherman wrote: > > > @matrix... = <<1 0 0 1>>; > > In the case of: > > @matrix = <<1 2 3 4 5>>; > > You need only add the type: > > int @matrix = <<1 2 3 4 5>>; > There is no string phase, or at least should never be. > The compiler can > pre-compute the

Array/Hash Slices, multidimensional

2004-04-15 Thread Abhijit A. Mahabal
I say %foo... = <<10 100 15 150>>; for some definition of ...? I don't claim that we'd need that frequently. We probably do need the array version of the same problem frequently, though: @matrix... = <<1 0 0 1>>; At least we'd need it more frequently if we had it. A2 says that something like this will be supported, come A9. --Abhijit Abhijit A. Mahabal http://www.cs.indiana.edu/~amahabal/

Re: but true

2003-12-19 Thread Abhijit A. Mahabal
On Fri, 19 Dec 2003, Larry Wall wrote: > On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: > : Of course, when I do: > : > : my $x = 0 but (true|false); > : > : then what happens? > > That's the problem with making them methods. Any such operational > definition is going to get y

Macro question

2003-08-02 Thread Abhijit A. Mahabal
This is a rather silly question: The code: macro foo() { return {my $x = 7} } foo; print $x; is equivalent to which of the following? {my $x = 7} print $x; or my $x = 7; print $x; Thanx, abhi.

macros and is parsed

2003-08-02 Thread Abhijit A. Mahabal
it that the absence of an explicit "is parsed" changes the behaviour (for efficiency reasons, perhaps, as many common uses will parse arguments in standard ways [though act in mind warping ways] ) ? abhi. Abhijit A. Mahabalhttp://cs.indiana.edu/~amahabal/

Re: Junctions & Set Theory

2003-08-01 Thread Abhijit A. Mahabal
On Fri, 1 Aug 2003, Derek Ross wrote: > Do junctions have a direct representation as predicate logic statements? > In particular, do the following logic statements correspond directly > to the following perl6 junctions: > > LOGIC PERL6 JUNCTION (DESCRIP) > =

Re: Perl 6's for() signature

2003-08-01 Thread Abhijit A. Mahabal
nd the next one is outside the call sub next_routine {...} It seems to me, then, that calls to user defined subs will need to end with a semi-colon. Abhi Abhijit A. Mahabal Home: 520 N. Grant St, Apt #2 Graduate Student, Bloomington IN 474