[perl #63634] [BUG] repeated take($x) all get the same value

2009-03-04 Thread abhijit mahabal
# New Ticket Created by "abhijit mahabal" # Please include the string: [perl #63634] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=63634 > my @y = gather { my $x = 0; for 1..5 { $x++;

Re: proposal: 404 method

2005-06-20 Thread Abhijit Mahabal
Synposis 10... abhijit Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/

Re: proposal: binding with a function

2005-06-20 Thread Abhijit Mahabal
bytes, kilobyte; replace the last line with: &kilobytes := &kilobyte; and the scoping is not an issue. And with synonyms, binding as soon as declaring seems prudent. --abhijit Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/

Re: Ignoring parameters

2005-06-17 Thread Abhijit Mahabal
x27;t topicalize the invocant nowadays? I had thought that they do and one needs the ./ to still talk about the invocant if some inner loop stole the $_, and until such stealing occurs .foo() and ./foo() are the same... --abhijit Damian Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/

Re: ./method

2005-05-15 Thread Abhijit Mahabal
ays $_.method ./method is always $?SELF.method ) Yes, I like it a lot! --abhijit Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/

Re: ./method

2005-05-15 Thread Abhijit Mahabal
ke a topic. This is not better than $o/$O, except that $__ looks more like $_ (but maybe it looks too much like $_, and that alone could invalidate this proposal). Comments? --abhijit Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/

Re: Junctions of classes, roles, etc.

2005-05-02 Thread Abhijit Mahabal
On Mon, 2 May 2005, [ISO-8859-1] Thomas Sandlaß wrote: David Storrs wrote: Tell me what this does: class Tree { method bark() { die "Cannot instantiate a Tree--it is abstract!" } } class Birch { method bark() { return "White, papery" } } class Oak { method bark() { return "Da

Re: Junctions of classes, roles, etc.

2005-04-30 Thread Abhijit Mahabal
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

Re: Junctions of classes, roles, etc.

2005-04-30 Thread Abhijit Mahabal
On Fri, 29 Apr 2005, Brent 'Dax' Royal-Gordon wrote: David Storrs <[EMAIL PROTECTED]> wrote: On Thu, Apr 28, 2005 at 03:28:41PM +0200, Ingo Blechschmidt wrote: so we had junctions of Code references some days ago, what's with junctions of Class and Role objects? :) Could we see some code that shows

Re: Deletion of members by mixin

2005-04-26 Thread Abhijit Mahabal
On Tue, 26 Apr 2005, Aaron Sherman wrote: On Tue, 2005-04-26 at 09:58, Abhijit Mahabal wrote: On Tue, 26 Apr 2005, Aaron Sherman wrote: It also might be useful for roles to be able to delete members and methods from a class like so: role foo { has $.x; has

Re: Roles as anonymous and/or closures

2005-04-26 Thread Abhijit Mahabal
, it seems that the role would need to be the boss on "deleting decisions". Could get pretty confusing! --abhijit Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/

Re: Documentary annotations: $what doc

2005-03-31 Thread Abhijit Mahabal
On Thu, 31 Mar 2005, Luke Palmer wrote: Chip Salzenberg writes: I'd like to annotate Perl 6 parameters and other entities using traits, since that's the best way (I know of) to have them appear immediately in the text of the program where they are. Supposing I had a "doc" trait, could I say: su

Re: compile time signature checking

2005-03-03 Thread Abhijit Mahabal
Another edge case: is it legal to have an optional Pair in the signature? That is: sub foo($x, Pair ?$y, +$z){...} If yes, what does this parse as: foo(10, z => 5); If z => 5 is bound to $y, then $y is almost mandatory. ('almost' because we can still say foo(10); ). (and then can we als

compile time signature checking

2005-03-02 Thread Abhijit Mahabal
I was thinking about how binding of arguments to parameters in a sub/method call would happen. Seems to be a darn tricky thing with all sorts of potential pitfalls! I have a few questions. Consider the following piece of code. Are my expectations correct? sub foo($x, $y, *%slurp) { $x + $y } s

Re: something wrong with argument binding in function calls

2005-03-02 Thread Abhijit Mahabal
A simpler buggy version: sub g($x, $y){ say "$x $y"; h($y, $x); } sub h($x, $y){ say "$x $y"; } g(10, 15); = This prints: 10 15 15 15 --abhijit Abhijit Mahabal wrote: the file examples/hanoi.p6 should work correctly, but does not.

something wrong with argument binding in function calls

2005-03-02 Thread Abhijit Mahabal
the file examples/hanoi.p6 should work correctly, but does not. Something is going wrong in the recursion. = [EMAIL PROTECTED] trunk]$ ./pugs examples/hanoi.p6 ndisks = 3 AS AS SS AB SS SB SB = A modified version that also prints out what arguments

"foo".say and "foo" .say

2005-03-01 Thread Abhijit Mahabal
I had not realized that "foo".say is valid p6 :) Is "foo" .say also valid p6? No reason for it not to be valid Pugs currently works with the non-space version, but barfs at the space version... In general, is this the right place to send pugs bug reports? --abhijit

Re: parsing ok((2+3)==5)

2005-03-01 Thread Abhijit Mahabal
Autrijus Tang wrote: On Sun, Feb 27, 2005 at 04:14:34PM -0500, Abhijit Mahabal wrote: I hunted down the cause of the non-parsing of ok((2 + 3) == $five, "== (sum on lhs)"); in 03operator.t, but am not yet up to speed in Haskell to fix it. Below is the location of the problem. The e

parsing ok((2+3)==5)

2005-02-27 Thread Abhijit Mahabal
I hunted down the cause of the non-parsing of ok((2 + 3) == $five, "== (sum on lhs)"); in 03operator.t, but am not yet up to speed in Haskell to fix it. Below is the location of the problem. The error is in Parser.hs, in the blocks for parseApply and parseParamList. parseApply eats parens using

Re: Classes with several, mostly unused, attributes

2004-12-16 Thread Abhijit Mahabal
Larry Wall wrote: On Fri, Dec 10, 2004 at 11:05:32AM -0500, Abhijit Mahabal wrote: : Consider a class (e.g., the hypothetical Geometry::Triangle) that can : have several attributes (side1, side2, side3, angle1, ang_bisector1, : side_bisector, altitude1 and so forth), most of which will not be

Re: Classes with several, mostly unused, attributes

2004-12-15 Thread Abhijit Mahabal
David Storrs wrote: On Dec 15, 2004, at 5:36 PM, Abhijit Mahabal wrote: I think that "slackness-on-demand" is a better policy than "strictness-on-demand", but that, again, is just my opinion Until now, the policy in Perl has always been that it is as slack and forgiving

Re: Classes with several, mostly unused, attributes

2004-12-15 Thread Abhijit Mahabal
David Storrs wrote: Incidentally, I just want to go on record as saying that the verbosity of class declarations in P6 is really starting to skeeve me. I keep reminding myself that these are the edge cases that are being discussed, that you don't need all this stuff for the common case (right?)

Re: Undeclared attributes

2004-12-10 Thread Abhijit Mahabal
Dave Whipp wrote: Attributes are declared with C, but also have a unique signil C<$.>. So is it strictly necessary to declare them? Or rather, is it Cly necessary -- i.e. is the following legal? no strict; class Foo { method bar { say $.a++ } } For the standard layout, I'd think it'd be g

Classes with several, mostly unused, attributes

2004-12-10 Thread Abhijit Mahabal
Consider a class (e.g., the hypothetical Geometry::Triangle) that can have several attributes (side1, side2, side3, angle1, ang_bisector1, side_bisector, altitude1 and so forth), most of which will not be needed for most instances of Geometry::Triangle. I know how this can be done in P5. Using

Is object representation "per class" or "per object"?

2004-12-07 Thread Abhijit Mahabal
cause we'd be saying $current_obj.cast($otherclass), and $otherclass would know it's own layout. Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/

Re: specifying the key Type for a Hash

2004-12-06 Thread Abhijit Mahabal
;t know if it is doable or even desirable, but it sure is cool! Larry --abhijit Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/

Re: specifying the key Type for a Hash

2004-12-03 Thread Abhijit Mahabal
On Fri, 3 Dec 2004, Larry Wall wrote: : None of the synopses have anything like this. S6 talks about the : types of values, but not keys. Oversight, or is this syntax dead? S9 talk about it. Oops. Sorry. So it was oversight after all :) --abhijit Abhijit Mahabal http://www.cs.indiana.edu

specifying the key Type for a Hash

2004-12-03 Thread Abhijit Mahabal
A6 included examples of syntax for specifying the type of the key for a hash: my %pet is Hash(keytype => Str, returns => Cat) None of the synopses have anything like this. S6 talks about the types of values, but not keys. Oversight, or is this syntax dead? --abhijit Abhijit Mahabal

Re: But is it intuitive?

2004-09-14 Thread Abhijit Mahabal
On Tue, 14 Sep 2004, Austin Hastings wrote: > I was thinking about removing files this morning, and realized that I > wish rm supported inclusion/exclusion. > > In particular, I wanted to remove "* but not Makefile" (since my > Makefile uses lwp-download to re-fetch the source code, etc.) > > It

Roles trying to be nice

2004-08-29 Thread Abhijit Mahabal
e role itself, and if the class has a $.foo, it takes precedence" does not work because $.foo may have been added by another role. Abhijit Mahabal http://www.cs.indiana.edu/~amahabal/

Re: Progressively Overhauling Documentation

2004-08-23 Thread Abhijit Mahabal
On Mon, 23 Aug 2004 [EMAIL PROTECTED] wrote: >>OK, there's one non-incremental idea: documentation that you can write >>in one place and display in some completely different order. (Shades of >>literate programming!) And although there are good reasons for keeping >>the docs in the same file as