Re: Closed Classes Polemic (was Re: What the heck is a submethod (good for))

2005-10-12 Thread Rob Kinyon
On 10/12/05, chromatic <[EMAIL PROTECTED]> wrote: > On Wed, 2005-10-12 at 21:50 +0200, Yuval Kogman wrote: > > > This has even more implications with closed classes to which you > > don't have source level access, and if this can happen it will > > happen - i'm pretty sure that some commercial data

Re: Proposal to make class method non-inheritable

2005-10-12 Thread Rob Kinyon
All - I'm partly to blame for this thread because I put the idea into Steve's head that class methods being inheritable may be dogma and not a useful thing. Mea culpa. That said, I want to put forward a possible reason why you would want class methods to be inheritable - to provide pure f

Re: Closed Classes Polemic (was Re: What the heck is a submethod (good for))

2005-10-13 Thread Rob Kinyon
> I think this is an opportune time for me to express that I think the > ability to close-source a module is important. I love open source, > and I couldn't imagine writing anything by myself that I wouldn't > share. But in order for Perl to be taken seriously as a commercial > client-side langua

Re: Closed Classes Polemic (was Re: What the heck is a submethod (good for))

2005-10-13 Thread Rob Kinyon
On 10/13/05, John Macdonald <[EMAIL PROTECTED]> wrote: > Just because you can't make locking perfect does not mean it > has no value. Acme::Bleach it is!

Re: Custom Metaclass and Inheritance of Class Methods

2005-10-14 Thread Rob Kinyon
> == CONCLUSION / WRAP-UP > > So, now that I have sufficiently bored you all to tears, I will do a > quick re-cap of the main question, and the possible solutions. > > Should metaclasses be "inherited" along normal class lines? > > Meaning that if Foo uses a custom metaclass, and Bar isa Foo, then

Should roles and classes be merged?

2005-10-14 Thread Rob Kinyon
In the discussions I've had with Steve, one thing that always nagged me - what's the difference between a "class" and a "role"? I couldn't fix it in my head why there were two separate concepts. Steve, yesterday, mentioned to me that in the metamodel that he's got so far, Class does Role. This

Re: Should roles and classes be merged?

2005-10-14 Thread Rob Kinyon
On 10/14/05, Larry Wall <[EMAIL PROTECTED]> wrote: > : I need to stress that I'm not suggesting that the keyword "role" > : be removed. It won't be the first time we have keywords that mean the > : same thing, just with a little sugar added. It definitely improves > : maintainability to have se

Re: top 5 list needed

2005-10-18 Thread Rob Kinyon
Some other features: 1) You can write your program in any combination of programming styles and languages, as you see fit. Thus, you can use your OO library written in Ruby, that really fast C routine, and your Perl code, all in one place. 2) There are a large number of operators that support list

Re: Making Wrong Code Type Wrong

2005-10-18 Thread Rob Kinyon
[snip] Let me rephrase to see if I understand you - you like the fact that boxed types + roles applied to those types + compile-time type checking/inference allows you to tag a piece of information (int, char, string, obj, whatever) with arbitrary metadata. Add that to the fact that you can lexica

Re: syntax for accessing multiple versions of a module

2005-10-18 Thread Rob Kinyon
On 10/18/05, Juerd <[EMAIL PROTECTED]> wrote: > Nicholas Clark skribis 2005-10-18 22:41 (+0100): > > my $foo = DBI(1.38)->new(); > > my $bar = DBI(1.40)->new(); > > I like this syntax, and have a somewhat relevant question: can a module > be aliased entirely, including all its subclasses/-roles

Re: top 5 list needed

2005-10-18 Thread Rob Kinyon
On 10/18/05, Uri Guttman <[EMAIL PROTECTED]> wrote: > >>>>> "SL" == Stevan Little <[EMAIL PROTECTED]> writes: > > SL> On Oct 18, 2005, at 1:45 PM, Luke Palmer wrote: > > >> On 10/18/05, Rob Kinyon <[EMAIL PROTECTED]> wrote: &

Re: syntax for accessing multiple versions of a module

2005-10-18 Thread Rob Kinyon
> Another school of thought would be that "Dog" alone would be > considered ambiguious and so we would just alias far enough to be > clear, like this: > >Dog => Ambiguity Error! >Dog-1.2.1 => Dog-1.2.1-cpan:JRANDOM >Dog-0.0.2 => Dog-0.0.2-cpan:LWALL > > Of course, this means that

Fwd: top 5 list needed

2005-10-19 Thread Rob Kinyon
> > Text-substitution macros would have to be handled in an earlier pass, > > I still don't see evidence for this. Or maybe I do, but I don't see > any reason that the preprocessing pass must finish before the parsing > begins. Mixing C and Perl ... my $foo; BEGIN { $foo = '}'; } #define OPEN {

Re: subclassing associated classes elegantly

2005-10-19 Thread Rob Kinyon
On 10/19/05, Darren Duncan <[EMAIL PROTECTED]> wrote: [snip] > An example of when this situation can arise is if person X implements > a simplified XML DOM implementation using 2 classes, Document and > Node, that work together, where one of those classes (Document) can > create objects of the othe

Re: syntax for accessing multiple versions of a module

2005-10-19 Thread Rob Kinyon
On 10/19/05, Nate Wiger <[EMAIL PROTECTED]> wrote: > My concern is that we're solving problems that don't really exist in > real-world Perl usage. Are there really two competing authors of DBI? > Or, for any product, do two people really try to market "SuperWidget"? > No, one person just changes to

Re: syntax for accessing multiple versions of a module

2005-10-20 Thread Rob Kinyon
On 10/20/05, Nate Wiger <[EMAIL PROTECTED]> wrote: > Larry Wall wrote: > > I think there can be some kind of community metainformation that sets > > defaults appropriately. And if not, the site/project can certainly > > establish defaults. On the other hand, a lot of projects do simply > > want t

Re: syntax for accessing multiple versions of a module

2005-10-20 Thread Rob Kinyon
On 10/20/05, Nate Wiger <[EMAIL PROTECTED]> wrote: > And, it shares alot with other languages people know and use. That's more because languages are incestuous (like Perl) instead of languages independently arriving at the same conclusions. Yes, the "while" loop is going to look the same everywher

Re: syntax for accessing multiple versions of a module

2005-10-20 Thread Rob Kinyon
> Unfortunately many people WILL have to deal with such changes, and > the question should be: Does a given change offer a clear improvement? > As you said, if we're helping %1 of people %1 of the time, are the > other 99% really going to change all their scripts? No chance. You again misread what

Re: new sigil

2005-10-20 Thread Rob Kinyon
On 10/20/05, Steve Peters <[EMAIL PROTECTED]> wrote: > I have some serious concerns about using Latin-1 sigils within Perl 6 and > the ASCII multi-character aliases. Am I not understanding something that > I should see this as an advantage? I had the same concern a few months back. I've come to s

Re: new sigil

2005-10-20 Thread Rob Kinyon
> Surely you aren't suggesting that these non-English speakers do not have > access to the ASCII (or EBCDIC) character sets for their editors, are you? Surely you aren't suggesting that your editor doesn't have access to the Latin-1 charset, are you? Let's take a look at popular editors: vi - chec

Re: new sigil

2005-10-21 Thread Rob Kinyon
On 10/21/05, Steve Peters <[EMAIL PROTECTED]> wrote: > On Fri, Oct 21, 2005 at 02:37:09PM +0200, Juerd wrote: > > Steve Peters skribis 2005-10-21 6:07 (-0500): > > > Older versions of Eclipse are not able to enter these characters. That's > > > where the copy and paste comes in. > > > > That's wh

YAMM (Yet Another MetaModel)

2005-10-21 Thread Rob Kinyon
I'd like to propose a new metamodel that (I hope) will meet all the specs @Larry has stated thus far. This metamodel is in two parts. Part the first: There is a single object given to P6 called Factory. (No, Steve, there are no turtles.) Factory has two behaviors, no state, and no classes. The beh

Re: new sigil

2005-10-21 Thread Rob Kinyon
> > So, you are proposing that the Perl of the Unicode era be limited to > > ASCII because a 15 year old editor cannot handle the charset? That's > > like suggesting that operating systems should all be bootable from a > > single floppy because not everyone has access to a CD drive. > > I saying th

Fwd: $1 change issues [was Re: syntax for accessing multiple versions of a module]

2005-10-21 Thread Rob Kinyon
Feh - I really need to get on gmail's case for providing a keystroke for "Reply to All". Rob -- Forwarded message -- From: Nate Wiger <[EMAIL PROTECTED]> Date: Oct 21, 2005 2:38 PM Subject: Re: $1 change issues [was Re: syntax for accessing multiple versions

Re: Slightly OT: zip() for Perl5?

2005-10-21 Thread Rob Kinyon
Does TYE's Algorithm::Loops's mapcar() provide the basic functionality of what you're looking for? Rob On 10/21/05, Mark Reed <[EMAIL PROTECTED]> wrote: > Is there a CPAN module which provides the functionality of ¥/zip() for > Perl5? I don't see anything obvious in the Bundle::Perl6 stuff. Not

Re: Avoid the Yen Sign [Was: Re: new sigil]

2005-10-23 Thread Rob Kinyon
On 10/23/05, Autrijus Tang <[EMAIL PROTECTED]> wrote: > Dan Kogai wrote: > > To make the matter worse, there are not just one "yen sign" in Unicode. > > Take a look at this. > > > > ¥ U+00A5 YEN SIGN > > ¥ U+FFE5 FULLWIDTH YEN SIGN > > > > Tough they look and groks the same to human, computers han

Re: Perl 6 fears

2005-10-24 Thread Rob Kinyon
On 10/24/05, John Macdonald <[EMAIL PROTECTED]> wrote: > On Mon, Oct 24, 2005 at 02:47:58PM +0100, Alberto Manuel Brandão Simões wrote: > > Another is because it will take too long to port all CPAN modules to > > Perl 6 (for this I suggest a Porters force-task to interact with current > > CPAN modu

Re: Perl 6 fears

2005-10-24 Thread Rob Kinyon
On 10/24/05, Nate Wiger <[EMAIL PROTECTED]> wrote: > Joshua Gatcomb wrote: > > On 10/24/05, Juerd <[EMAIL PROTECTED]> wrote: > > > Feel free to add your own, or fears you heard about! > > > > FEAR: The Perl6 process is driving away too many good developers > > > > FEAR: Perl6 will not be as por

Re: $_ defaulting for mutating ops

2005-10-25 Thread Rob Kinyon
On 10/25/05, Juerd <[EMAIL PROTECTED]> wrote: > I think it'd be great if +=, ~=, +&=, ++, etc, could all assume $_ on > their LHS when there is no obvious operand. > > This clashes with &prefix:<=>, but that's nothing a space cannot fix. > Same for lvalue subs called x or xx (or X or XX). > > m

Re: new sigil

2005-10-25 Thread Rob Kinyon
> Basically, ¢T is a close analog of &t, which is the variableish form > for "sub t". When used in a declaration, both of them introduce a > bare name as an alias into whatever scope the declaration is inserting > symbols, albeit with different syntactic slots. So just as > > my &t := { ... }

Re: Perl 6 fears

2005-10-25 Thread Rob Kinyon
On 10/25/05, Luke Palmer <[EMAIL PROTECTED]> wrote: > On 10/24/05, H.Merijn Brand <[EMAIL PROTECTED]> wrote: > > On Mon, 24 Oct 2005 11:49:51 -0400, Joshua Gatcomb <[EMAIL PROTECTED]> > > wrote: > > > FEAR: Perl6 internals will be just as inaccessable as p5 > > > > paradox. Many people don't find p

Re: new sigil

2005-10-26 Thread Rob Kinyon
> And in fact, its very existence defies another implicit principle of > mine, that is, the "principle of partial definition": Defining a new > type or instance can only break a previously typechecking program by > making it ambiguous. The idea behind that is that at some time you > may realize t

Re: Ways to add behavior

2005-10-26 Thread Rob Kinyon
> That's just self.meta.add_method($label, $method) by my lights. > A .meta already implies/ignores the .class coercion. If we are to > support prototype-based programming $x.meta *must not care* whether > it has been given a class or an instance or something in between. > What I am calling a "cla

Re: Ways to add behavior

2005-10-26 Thread Rob Kinyon
On 10/26/05, Stevan Little <[EMAIL PROTECTED]> wrote: > > On Oct 26, 2005, at 12:05 PM, Larry Wall wrote: > > Of course, there are other words that are somewhat synonymous with > > "class", Unfortunately "sort" is already hosed. Maybe "kind". > > Actually "kind" is used in the "Core Calculus for M

Re: Ways to add behavior

2005-10-26 Thread Rob Kinyon
> So maybe we can define our terms like this: > > type: a completely generic metaterm for any of the following, > and then some. > > class: a mutable interface object that manages instances in the > "classical" way, with covariant derivational properties. > > role: an immutable

Roles vs. Classes (was Re: Ways to add behavior)

2005-10-26 Thread Rob Kinyon
> : 3) Aren't classes mutable and roles immutable by default only? Or has > : this changed? > > Of course. To change the default for a role, call it a class, and > to change the default for a class, call it a role. :-) Does this mean that roles are the recommended way to create immutable classes

Re: Roles vs. Classes (was Re: Ways to add behavior)

2005-10-26 Thread Rob Kinyon
On 10/26/05, chromatic <[EMAIL PROTECTED]> wrote: > On Wed, 2005-10-26 at 20:29 -0400, Rob Kinyon wrote: > > > I would prefer to use roles as they're closed by default, leaving > > "class" to be my powertool, if I need the power. > > I don't unde

Re: Roles vs. Classes (was Re: Ways to add behavior)

2005-10-26 Thread Rob Kinyon
On 10/26/05, Luke Palmer <[EMAIL PROTECTED]> wrote: [snip] > Okay, an open class means you can add methods to it, right? So, let's > say you have this class: > > class Foo { > method foo() {...} > method bar() {...} > } > > And this code: > > my Foo $x = Foo.new; >

Re: Roles vs. Classes (was Re: Ways to add behavior)

2005-10-27 Thread Rob Kinyon
On 10/26/05, Larry Wall <[EMAIL PROTECTED]> wrote: > On Wed, Oct 26, 2005 at 07:35:05PM -0700, chromatic wrote: > : On Wed, 2005-10-26 at 21:58 -0400, Rob Kinyon wrote: > : > : > Plus, the argument is a straw man. Instead of: > : > > : > class Some::Class is a

Re: +$arg changed to :$arg

2005-10-27 Thread Rob Kinyon
On 10/27/05, TSa <[EMAIL PROTECTED]> wrote: > HaloO, > > Larry Wall wrote: > > > : Yes, and dispatch as a runtime keyed access into a code multitude. > > : The covariant part of the method's sig! The code equivalent to keyed > > : data access into hashes. > > > > Um, yeah. Won't play in Peoria, th

Re: Roles vs. Classes (was Re: Ways to add behavior)

2005-10-27 Thread Rob Kinyon
On 10/27/05, Larry Wall <[EMAIL PROTECTED]> wrote: > On Thu, Oct 27, 2005 at 05:37:13AM -0400, Rob Kinyon wrote: > : Will I be able to do something like: > : > : package Foo; > > Hmm, you just started in Perl 5 mode. > > : $*VERSION = 1.3.2; > > Perl 5 would

Re: $_ defaulting for mutating ops

2005-10-28 Thread Rob Kinyon
> But IMHO the reduction in typing for this relatively minor issue is not > really worth the surprise to newbies at seeing operandless operators. AMEN! Rob

Re: Role Method Conflicts and Disambiguation

2005-10-28 Thread Rob Kinyon
On 10/28/05, Jonathan Scott Duff <[EMAIL PROTECTED]> wrote: > Roles can hold instance data that will be composed into a class. What > I'm saying is that if you have two roles: > > role X { has $:foo; } > role Y { has $:foo; } > > And a class that's composed of them: > > class Xy does X does Y { ..

Re: Role Method Conflicts and Disambiguation (Theory-theoretic take)

2005-10-28 Thread Rob Kinyon
On 10/28/05, Luke Palmer <[EMAIL PROTECTED]> wrote: [snip] > It was the fact that at each stage of the game, we summarized the > defaults and requirements for each role, ignoring the internal makeup > (i.e., what roles were composed into it, etc.). So, in theory, one should be able to ask any give

Re: Role Method Conflicts and Disambiguation

2005-11-01 Thread Rob Kinyon
> 1. choose one of a set of available methods to call its own. > 2. create a version of its own. > 3. pass the buck. #1 and #2 are identical. Stevan and I have always viewed #1 as a special case of #2. If you want to choose a method to call, then create a method of your own and have it wrap the on

Re: Role Method Conflicts and Disambiguation

2005-11-02 Thread Rob Kinyon
On 11/1/05, Jonathan Lang <[EMAIL PROTECTED]> wrote: > Rob Kinyon wrote: > > > 1. choose one of a set of available methods to call its own. > > > 2. create a version of its own. > > > 3. pass the buck. > > > > #1 and #2 are identical. Stevan and I h

Re: $_ defaulting for mutating ops

2005-11-02 Thread Rob Kinyon
On 11/2/05, Michele Dondi <[EMAIL PROTECTED]> wrote: > On Fri, 28 Oct 2005, John Williams wrote: > > > But IMHO the reduction in typing for this relatively minor issue is not > > really worth the surprise to newbies at seeing operandless operators. > > I don't buy that argument as newbies are alrea

Re: syntax-variants, RPN (was: Re: $_ defaulting for mutating ops)

2005-11-03 Thread Rob Kinyon
On 11/3/05, Michele Dondi <[EMAIL PROTECTED]> wrote: > On Wed, 2 Nov 2005, Ruud H.G. van Tol wrote: > > >> http://www.nntp.perl.org/group/perl.perl6.language/17556 > > > > I understand that Perl6 allows blocks with changed/enhanced syntax, so > > it is or will become possible (to add it) as if it w

Re: Role Method Conflicts and Disambiguation

2005-11-03 Thread Rob Kinyon
> On Nov 2, 2005, at 9:02 PM, Jonathan Lang wrote: > > Let's say you have this: > > > > role A {method foo() { code1; } } > > role B {method foo() { code2; } } > > role C does A does B { > > method foo() { A::foo(); } > > method bar() { B::foo(); } > > } > > > > Should the following

Re: $_ defaulting for mutating ops

2005-11-04 Thread Rob Kinyon
> $ perl -le '$u=1; ($y=$u*=5)++; print $y' > 6 It's interesting to note that this parse (due to precedence) as ($y=($u*=5))++, not (($y=$u)*=5)++ This is important for overloaded operators (which are going to become much easier to do in Perl6). The importance arises if Perl6 allows assignment to

Re: Perl6 perlplexities [was: "Re: $1 change issues..."]

2005-11-04 Thread Rob Kinyon
On 11/4/05, Michele Dondi <[EMAIL PROTECTED]> wrote: > I'm still convinced my remark _partly_ applies in the sense that the > overall impression is that a vast majority of most common needs is > addressed by a *subset* of the current features and trying to stuff all > them in has brought in quite a

Re: implicitly doing a role

2005-11-04 Thread Rob Kinyon
On 11/4/05, Austin Frank <[EMAIL PROTECTED]> wrote: > Hello! > > If roles are interfaces, do we want any class that provides an interface > consistent with a role to implicitly do the role? That is, if a class > fulfills all of the interface requirements of a role without actually > saying it does

Re: Perl6 perlplexities

2005-11-04 Thread Rob Kinyon
> And when your user does want to, essentially say "Nah, you screwed up > designing > that object protocol, children shouldn't've been protected." it's the work of > a > moment to write: > >thing.send(:children, *args) I told you I'm still learning. I hadn't gotten to that part of the Pickax

Re: Perl6 perlplexities [was: "Re: $1 change issues..."]

2005-11-07 Thread Rob Kinyon
On 11/7/05, Michele Dondi <[EMAIL PROTECTED]> wrote: > On Fri, 4 Nov 2005, Rob Kinyon wrote: > > > So, for a bit of extra complexity, I get peace of mind for myself and my > > users. > > The point being, and I'm stressing it once again but no more than once, &g

Re: Perl6 perlplexities [was: "Re: $1 change issues..."]

2005-11-07 Thread Rob Kinyon
> Okay, I won't shout (not even on PerlMonks :-), but named parameters > default to optional, so you'd have to write that as > > sub convert (:$from!, :$to!, :$thing!) { ... } > > in the current scheme of things. Either way, the point is still that the benefits FAR outweigh any additional comp

Re: Implicit Role Declarations (was Re: implicitly doing a role)

2005-11-08 Thread Rob Kinyon
On 11/8/05, chromatic <[EMAIL PROTECTED]> wrote: > On Fri, 2005-11-04 at 13:15 -0500, Austin Frank wrote: > > > If roles are interfaces, do we want any class that provides an interface > > consistent with a role to implicitly do the role? That is, if a class > > fulfills all of the interface requi

Re: given too little

2005-11-10 Thread Rob Kinyon
> But if we have a mandatory type inferencer underneath that is merely > ignored when it's inconvenient, then we could probably automatically > delay evaluation of the code. . . . I'm not so certain that ignoring the mandatory type inferencer is a good idea, even when it's inconvenient. I don'

Re: What's the latest on Iterators?

2005-11-11 Thread Rob Kinyon
On 11/11/05, Joe Gottman <[EMAIL PROTECTED]> wrote: >The various synopses contain many mentions of Iterators. These are used, > for instance, to implement lazy lists so the expression 1..1_000_000 does > not have to allocate a million element array. But as far as I can tell the > term is neve

Re: Thoughs on Theory.pm

2005-11-11 Thread Rob Kinyon
On 10/13/05, Dave Whipp <[EMAIL PROTECTED]> wrote: > (ref: http://svn.openfoundry.org/pugs/docs/notes/theory.pod) > > >theory Ring{::R} { > >multi infix:<+> (R, R --> R) {...} > >multi prefix:<-> (R --> R){...} > >multi infix:<-> (R $x, R $y --> R) { $x + (-

Re: lvalue reverse and array views

2005-11-20 Thread Rob Kinyon
On 11/20/05, Daniel Brockman <[EMAIL PROTECTED]> wrote: > Reversing an array, changing it, and then rereversing it --- > I think that kind of pattern is common. I would think that reversing a string, modifying it, then reversing it back is more common. Does modifying the reversal of a string modif

statement_control() (was Re: lvalue reverse and array views)

2005-11-20 Thread Rob Kinyon
On 11/20/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: [snip] > Yep. Also note that "for" is not a special magical construct in Perl 6, > it's a simple subroutine (&statement_control:, with the signature > ([EMAIL PROTECTED], Code *&code)). (Of course, it'll usually be optimized.) > > Example: >

Re: statement_control() (was Re: lvalue reverse and array views)

2005-11-21 Thread Rob Kinyon
On 11/21/05, TSa <[EMAIL PROTECTED]> wrote: > HaloO, > > Luke Palmer wrote: > > On 11/21/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: > > > >>Of course, the compiler is free to optimize these things if it can prove > >>that runtime's &statement_control: is the same as the internal > >>optimized

Re: type sigils redux, and new unary ^ operator

2005-11-22 Thread Rob Kinyon
On 11/22/05, Larry Wall <[EMAIL PROTECTED]> wrote: > What tipped me over the edge, however, is that I want ^$x back for a > unary operator that is short for 0..^$x, that is, the range from 0 > to $x - 1. I kept wanting such an operator in revising S09. It also > makes it easy to write > > for

Re: type sigils redux, and new unary ^ operator

2005-11-23 Thread Rob Kinyon
On 11/23/05, Luke Palmer <[EMAIL PROTECTED]> wrote: > On 11/23/05, Rob Kinyon <[EMAIL PROTECTED]> wrote: > > On 11/22/05, Larry Wall <[EMAIL PROTECTED]> wrote: > > > > > > for ^5 { say } # 0, 1, 2, 3, 4 > > > > I read this and I

Re: Lazy lists in Str context

2005-11-23 Thread Rob Kinyon
On 11/23/05, Flavio S. Glock <[EMAIL PROTECTED]> wrote: > Can we have: > > say 1..Inf; > > to output an infinite stream, instead of just looping forever? > > OTOH, it would be nice if > > say substr( ~(1..Inf), 0, 10 ) > > printed "1 2 3 4 5". > > Flattened lists would still loop forever (or fa

Re: Lazy lists in Str context

2005-11-23 Thread Rob Kinyon
On 11/23/05, Flavio S. Glock <[EMAIL PROTECTED]> wrote: > How about allowing reduce() to return a scalar with the same laziness > as the list: > > [EMAIL PROTECTED] - a lazy string if @list is lazy > [EMAIL PROTECTED] - a lazy number if @list is lazy > > It would look like: > > $foo = s

Re: type sigils redux, and new unary ^ operator

2005-11-23 Thread Rob Kinyon
On 11/23/05, Larry Wall <[EMAIL PROTECTED]> wrote: > : I'm also puzzled that you feel the need to write 0..$n-1 so often; there > : are so many alternatives to fenceposting in P5 that I almost never write > : an expression like that, so why is it cropping up that much in P6? > > Couple reasons occu

Capabilities in Perl6?

2005-12-01 Thread Rob Kinyon
I just read the slides about CAPerl (http://caperl.links.org/) and it's an interesting idea. Leaving aside the question of whether this would work in Perl5 or not, I think it would be very interesting to look at building this concept into Perl6. Here's how I'd envision doing so: * Any subrouti

Re: Perl grammar for Perl5 -> Perl6

2005-12-08 Thread Rob Kinyon
> As for the original question, I think that the Perl 6 grammar will > be a much better example for how to parse other languages than a > Perl 5 grammar would be, since one of the underlying design currents > from the beginning has been that Perl 6 had to be a language that > was amenable to parsin

Re: Modular versions and APIs

2005-12-08 Thread Rob Kinyon
On 12/8/05, Larry Wall <[EMAIL PROTECTED]> wrote: > [snip] Certainly, as you speculate, if different authors want > to share an API, they can give it an "API" author that knows how to > delegate to one of the authors. Would you mind elaborating on this some more? Thanks, Rob

Re: relational data models and Perl 6

2005-12-15 Thread Rob Kinyon
[snip entire conversation so far] (Please bear with me - I'm going to go in random directions.) Someone please correct me if I'm wrong, but it seems that there's only a few things missing in P6: 1) An elegant way of creating a tuple-type (the "table", so to speak) 2) A way of providing co

Re: relational data models and Perl 6

2005-12-16 Thread Rob Kinyon
On 12/16/05, Ovid <[EMAIL PROTECTED]> wrote: > --- Rob Kinyon <[EMAIL PROTECTED]> wrote: > > > As for the syntactic sugar, I'm not quite sure what should be > > done here. And, with macros, it's not clear that there needs > > to be an authoritative ans

Re: relational data models and Perl 6

2005-12-16 Thread Rob Kinyon
On 12/16/05, Ovid <[EMAIL PROTECTED]> wrote: > Minor nit: we're discussing to the relational algebra and not the > relational Calculus (unless the topic changed and I wasn't paying > attention. I wouldn't be surprised :) Algebra, in general, is a specific form of calculus. So, we're speaking of

Re: handling undef better

2005-12-16 Thread Rob Kinyon
On 12/16/05, Darren Duncan <[EMAIL PROTECTED]> wrote: > Something else I've been thinking about, as a tangent to the > relational data models discussion, concerns Perl's concept of > "undef", which I see as being fully equivalent to the relational > model's concept of "null". The relational model

Re: handling undef better

2005-12-17 Thread Rob Kinyon
On 12/17/05, Darren Duncan <[EMAIL PROTECTED]> wrote: [snip] > 2. Until a value is put in a container, the container has the > POTENTIAL to store any value from its domain, so with respect to that > container, there are as many undefs as there are values in its > domain; with some container types,

Re: Iterating over complex structures

2005-12-25 Thread Rob Kinyon
On 12/22/05, Michele Dondi <[EMAIL PROTECTED]> wrote: > Suppose I want to navigate a tree and print out info contained in each of > its leaves along with info gathered from the position in the tree of the > list itself? Can I do it in a "universal" manner as hinted above that > would work for other

Re: Array/list transformations.

2005-12-26 Thread Rob Kinyon
On 12/22/05, Jonathan Scott Duff <[EMAIL PROTECTED]> wrote: > On Thu, Dec 22, 2005 at 04:47:21PM +0100, Michele Dondi wrote: > > Also I wonder if one will be able to push(), pop(), etc. array slices as > > well whole arrays. A' la > > > > my @a=qw/aa bb cc dd ee/; > > my $s=pop @a[0..2]; # or [0,2

Re: Array/list transformations.

2005-12-27 Thread Rob Kinyon
On 12/27/05, Larry Wall <[EMAIL PROTECTED]> wrote: > On Tue, Dec 27, 2005 at 12:10:45AM -0500, Rob Kinyon wrote: > : Creating an array whose positions are aliases for positions in another > : array can be useful. How about > : > : my @s := @a[0,2,4] is alias; > : &

Re: relationship between slurpy parameters and named args?

2005-12-30 Thread Rob Kinyon
On 12/30/05, Piers Cawley <[EMAIL PROTECTED]> wrote: > Stuart Cook <[EMAIL PROTECTED]> writes: > > > On 29/12/05, Austin Frank <[EMAIL PROTECTED]> wrote: > >> So, is there a conceptual connection between imposing named argument > >> interpretation on pairs in an arg list and slurping up the end of

Re: Junctions again (was Re: binding arguments)

2006-01-04 Thread Rob Kinyon
On 1/2/06, TSa <[EMAIL PROTECTED]> wrote: > HaloO, > > Luke Palmer wrote: > > The point was that you should know when you're passing a named > > argument, always. Objects that behave specially when passed to a > > function prevent the ability to abstract uniformly using functions.[1] > > ... > > [

Re: Junctions again (was Re: binding arguments)

2006-01-05 Thread Rob Kinyon
On 1/4/06, Luke Palmer <[EMAIL PROTECTED]> wrote: > Of course, this was introduced for a reason: > > sub min($x,$y) { > $x <= $y ?? $x !! $y > } > sub min2($x, $y) { > if $x <= $y { return $x } > if $x > $y { return $y } > } > > In the presence of junctions,

Re: Table of Perl 6 "Types"

2006-01-12 Thread Rob Kinyon
> I wouldn't see a problem with defining a "Real" role that has a fairly > sparse set of operations. Afterall, a type that does support ++ and -- > (e.g. Int, Num) could easily "does Enumerable" if it wants to declare > that it supports them. What about the scripty-doo side of Perl6? One of the ov

Re: Table of Perl 6 "Types"

2006-01-12 Thread Rob Kinyon
On 1/12/06, Ævar Arnfjörð Bjarmason <[EMAIL PROTECTED]> wrote: > The "next/prev" semantics are, and should be more general than ±1, I > just think that ±1 should remain the default for reals & ints. So, Num (and all types that derive from Num) should have a next of { @_[0] + 1 } and a prev of { @_

Re: The old "$x will not stay shared" thing.

2006-01-16 Thread Rob Kinyon
On 1/16/06, Larry Wall <[EMAIL PROTECTED]> wrote: > Yes, at least for any block that really is capturing a closure. > Perhaps we need to distinguish those from "accidentally" nested > top-level functions. But undecorated "sub" is more-or-less defined > to be "our sub" anyway, just as with "package

Re: Indeterminate forms for the Num type.

2006-01-17 Thread Rob Kinyon
On 1/17/06, Audrey Tang <[EMAIL PROTECTED]> wrote: > But putter on #perl6 reports "1" on his amd64. I'd be happy we spec it > has to have to return 1 always for boxed Num types, even though it means > additional cycles for boxed numeric types. Isn't the point of boxing to provide a hardware-indep

Class methods vs. Instance methods

2006-01-18 Thread Rob Kinyon
Today on #perl6, Audrey, Stevan and I were talking about $repr. A tangent arose where Audrey said that the difference between class methods and instance methods was simply whether or not the body contained an attribute access. Is this true? If it is, then I think it violates polymorphism as demons

Re: Class methods vs. Instance methods

2006-01-18 Thread Rob Kinyon
On 1/18/06, Larry Wall <[EMAIL PROTECTED]> wrote: > On Wed, Jan 18, 2006 at 01:56:53PM -0500, Rob Kinyon wrote: > : Today on #perl6, Audrey, Stevan and I were talking about $repr. A > : tangent arose where Audrey said that the difference between class > : methods and instance

perl6-language@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote: > On Wednesday 18 January 2006 14:13, Stevan Little wrote: > > > Do we really still need to retain the old Perl 5 version of &bless? > > What purpose does it serve that p6opaque does not do in a better/ > > faster/cleaner way? > > Interoperability wi

perl6-language@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote: > On Wednesday 18 January 2006 17:57, Rob Kinyon wrote: > > > Well, for one thing, you can't write OO code in P5. > > I'll play your semantic game if you play my what-if game. > > I have a fair bit of Perl 5 c

perl6-language@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote: > On Wednesday 18 January 2006 19:11, Rob Kinyon wrote: > > > As for how that will be handled, I would think that it would be as follows: > > - in Perl6, objects created in another language will be treated as > &g

perl6-language@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote: > 1) by default, your object is opaque > 2) if you don't want this, you can always use bless() > > For interoperability with Perl 5 classes, I don't want to use an opaque > object. Ergo, I want to use bless() (or something, but does that explain why

perl6-language@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote: > On Wednesday 18 January 2006 19:39, Rob Kinyon wrote: > > > No, you want to specify the $repr in CREATE(). But, p6hash will still > > not be the same as a ref to an HV. Frankly, I think you're better off > > let

perl6-language@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, Trey Harris <[EMAIL PROTECTED]> wrote: > Excuse my ignorance of the finer points, but I thought the reason for > bless's continued existence was so that the same sort of brilliant OO > experimentation that Damian and others have done with pure Perl 5 can > continue to be done in pure Pe

perl6-language@perl.org

2006-01-19 Thread Rob Kinyon
On 1/19/06, Juerd <[EMAIL PROTECTED]> wrote: > Rob Kinyon skribis 2006-01-18 20:57 (-0500): > > Well, for one thing, you can't write OO code in P5. > > Nonsense. OO isn't a set of features, and OO isn't syntax. > > Granted, syntax can really help to unde

Re: Class methods vs. Instance methods

2006-01-19 Thread Rob Kinyon
On 1/18/06, Audrey Tang (autrijus) <[EMAIL PROTECTED]> wrote: > http://cakoose.com/wiki/type_system_terminology#13 "Any practical programming language with structural subtyping will probably let you create and use aliases for type names (so you don't have to write the full form everywhere). Howeve

Re: Perl 6's &bless is (seriously) broken

2006-01-19 Thread Rob Kinyon
To further extend Steve's argument (which I wholeheartedly agree with), I wanted to point out one thing: &bless has nothing to do with OO programming as conceived of in Perl6. It does one thing and only one thing: - tag a reference with a package name. This is used in a few places: - to d

Re: Perl 6's &bless is (seriously) broken

2006-01-19 Thread Rob Kinyon
On 1/19/06, Juerd <[EMAIL PROTECTED]> wrote: > Rob Kinyon skribis 2006-01-19 16:10 (-0500): > > There are no references in Perl6. > I have to admit, though, that I've never seen this statement, or > anything implying it. It's entirely new to me. > > Is your Per

perl6-language@perl.org

2006-01-19 Thread Rob Kinyon
On 1/19/06, chromatic <[EMAIL PROTECTED]> wrote: > On Wednesday 18 January 2006 20:02, Rob Kinyon wrote: > > > On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote: > > > > Answer me this then -- under your scheme, can I subclass a Perl 5 class > > > with P

Re: Perl 6's &bless is (seriously) broken

2006-01-20 Thread Rob Kinyon
On 1/20/06, Juerd <[EMAIL PROTECTED]> wrote: > Note, by the way, that JS has "primitive" strings, and Strings, only the > latter being objects. Fortunately for us, though, a string is > automatically promoted to a String when the string is USED AS an object. In other words, according to userland,

perl6-language@perl.org

2006-01-20 Thread Rob Kinyon
On 1/19/06, chromatic <[EMAIL PROTECTED]> wrote: > On Thursday 19 January 2006 19:50, Rob Kinyon wrote: > > > Nothing. Just like it's not a problem if Perl6 uses one of the > > Ruby-specific PMCs for storage. In fact, the alternate $repr idea is > > specifica

  1   2   >