perl6-language@perl.org

2006-01-20 Thread Rob Kinyon
On 1/20/06, Larry Wall <[EMAIL PROTECTED]> wrote: [snip really cool blathering] I don't have much to say on the deeper question, but I have a few ideas on the P5 -> P6 translation question, especially as it relates to OO: 1) Don't translate at all. Ponie, delegating to Parrot, is supposed to

Parrot and PGE will save the day (was Re: "as if" [Was: Selective reuse of storage in &bless.] )

2006-01-20 Thread Rob Kinyon
On 1/20/06, Nicholas Clark <[EMAIL PROTECTED]> wrote: > On Fri, Jan 20, 2006 at 04:20:54PM -0500, Rob Kinyon wrote: > > Pros: Larry doesn't have to do anything more on the WMoT. > > Cons: The community, for some reason, really wants this > > auto-translat

Re: ff and fff [Was: till (the flipflop operator, formerly ..)]

2006-01-25 Thread Rob Kinyon
On 1/25/06, Juerd <[EMAIL PROTECTED]> wrote: > Patrick R. Michaud skribis 2006-01-25 13:47 (-0600): > > On Wed, Jan 25, 2006 at 11:37:42AM -0800, Larry Wall wrote: > > > I've changed the flipflop operator/macro to "ff", short for "flipflop". > > > This has several benefits. ... > > ...another of w

perl6-language@perl.org

2006-01-26 Thread Rob Kinyon
On 1/26/06, Stevan Little <[EMAIL PROTECTED]> wrote: > Actually this might not be a bad approach in this case. Take this for > instance: > > method foo (Foo $self, $key) { > ((Hash) $self){$key} > } > > The syntax is ugly, but it makes what you are doing more explicit. I > would also think tha

perl6-language@perl.org

2006-01-26 Thread Rob Kinyon
On 1/26/06, Stevan Little <[EMAIL PROTECTED]> wrote: > > If there is need to treat something as a Hash, then provide it with a > > postcircumfix<{}> and leave it at that. It's highly unlikely that you > > will want to add Hash-like behavior to something that already has a > > postcircumfix<{}> beca

Re: Instance attributes collision

2006-02-15 Thread Rob Kinyon
On 2/14/06, Stevan Little <[EMAIL PROTECTED]> wrote: > I think that the metaclass (stored in the pseudo-lexical $::CLASS) > should create a number of anonymous roles on the fly: > >role { > multi method a (::CLASS $self) { ... } > multi method a (::CLASS $self, Scalar $value) {

ACID transactions for in-memory data structures

2006-05-15 Thread Rob Kinyon
I've been working on DBM::Deep, a way to have P5's data structures stored on disk instead of RAM. One of the major features I've been adding has been ACID transactions. I'm pretty sure it wouldn't be very feasible to do this natively in P5. But, would it be possible to do it natively in P6? As in

Re: ACID transactions for in-memory data structures

2006-05-16 Thread Rob Kinyon
On 5/15/06, Audrey Tang <[EMAIL PROTECTED]> wrote: Rob Kinyon wrote: > I'm pretty sure it wouldn't be very feasible to do this natively in > P5. But, would it be possible to do it natively in P6? As in, > supported within the interpreter vs. through some sort of overloa

Re: reduce metaoperator

2005-05-04 Thread Rob Kinyon
This may be a naive question, but what's wrong with just having a keyword called reduce()? Why do we need an operator for everything? I'm worried that the list of P6 operators is going to be as long as the list of P5 keywords, with a lot of them looking something like: I propose that if you're t

Re: reduce metaoperator

2005-05-04 Thread Rob Kinyon
eans, because it's documented somewhere. But, don't put it in the core. I thought the core was supposed to be sparse with modules to add the richness. Rob On 5/4/05, Larry Wall <[EMAIL PROTECTED]> wrote: > On Wed, May 04, 2005 at 08:59:04AM -0400, Rob Kinyon wrote: > : Thi

Re: Cmmposition binop

2005-05-04 Thread Rob Kinyon
What about the function compose() that would live in the module "keyword", imported by the incantation "use keyword qw( compose );"? (NB: My P6-fu sucks right now) multimethod compose (@*List) { return { $_() for @List; }; } On 5/4/05, Michele Dondi <[EMAIL PROTECTED]> wrote: > I

Plethora of operators

2005-05-04 Thread Rob Kinyon
I just started following the list again after a few months (though I have been skimming the bi-weekly summaries) and I'm a little alarmed at what seems to be a trend towards operaterizing everything in sight and putting those operators in the core. My understanding of P6 after the reading the AES

Re: Open and pipe

2005-05-04 Thread Rob Kinyon
Would that mean that a filehandle opened readonly would throw an exception if you attempted to either print or warn on it? On 5/4/05, Juerd <[EMAIL PROTECTED]> wrote: > Gaal Yahas skribis 2005-05-04 17:24 (+0300): > > Ah yes, that's another thing I was wondering about: what does opening a > > pipe

Re: Open and pipe

2005-05-04 Thread Rob Kinyon
> Rob Kinyon skribis 2005-05-04 11:02 (-0400): > > Would that mean that a filehandle opened readonly would throw an > > exception if you attempted to either print or warn on it? > > I don't know what warning on a filehandle should be or do, but ignoring > that bit, y

Re: Plethora of operators

2005-05-04 Thread Rob Kinyon
> Are there any particular other operators you're worried about? > I think the current design does a pretty good job of factoring out the > metaoperators so that the actual set of underlying basic operators *is* > relatively small. Yes, you can now say something like > > $x = [»+^=«] @foo; >

Semi-related question: reduce metaoperator

2005-05-05 Thread Rob Kinyon
Can I put an operator in a variable and then use it in the [] reduce meta-operator? Something like: $op = '+'; $x = [$op] @x; Rob

Re: receivers of pipes (the sharp end again)

2005-05-06 Thread Rob Kinyon
> : Does this mean that @{foo()} can be written as @ foo()? > > I would prefer not. Use foo()[] instead. Does this mean that some constructs in Perl are parsed immediately (such as foo() ...) and some are deferred (such as the [ in [>>+^<<] ...)? I would think this potentially makes a difference

Re: available operator characters

2005-05-06 Thread Rob Kinyon
> I'm sticking to non-words here, as I mentally parse not and true as > single-arg subs, single-arg subs as unary operators, etcetera. I can't > help it, but I have absolutely no idea how to determine the difference. > Is it &prefix: or just ¬? I have no idea. I do know that it's > &infix:, not &x.

Re: receivers of pipes (the sharp end again)

2005-05-06 Thread Rob Kinyon
On 5/6/05, Larry Wall <[EMAIL PROTECTED]> wrote: > On Fri, May 06, 2005 at 01:26:10PM -0400, Rob Kinyon wrote: > : > : Does this mean that @{foo()} can be written as @ foo()? > : > > : > I would prefer not. Use foo()[] instead. > : > : Does this mean that s

Re: receivers of pipes (the sharp end again)

2005-05-06 Thread Rob Kinyon
> Or perhaps we should by default restrict short ones to simple > operators, since it's pretty obvious that [+] is doing *some* kind > of addition, while [EMAIL PROTECTED]&$*#«=] is not quite so obvious. In other > words, we apply some kind of Huffman amplification to the metaoperator, > where the

Re: Fwd: Re: Pugs 6.2.0 released.

2005-05-09 Thread Rob Kinyon
What's really odd is that document links to http://en.wikipedia.org/wiki/Exclusive_disjunction which ends up stating that chained xors are associative and commutative, meaning that instead of acting as one(), it counts parity. Rob On 5/9/05, David Landgren <[EMAIL PROTECTED]> wrote: > Jonathan Wo

Re: Nested captures

2005-05-11 Thread Rob Kinyon
> > But it does raise an important point: the discrepancy between $42 and $/[41] > > *is* a great opportunity for off-by-on errors. Previously, however, @Larry > > have tossed back and forth the possibility of using $0 as the first capture > > variable so that the indices of $/[0], $/[1], $/[2] mat

Re: single element lists

2005-05-11 Thread Rob Kinyon
On 5/11/05, Juerd <[EMAIL PROTECTED]> wrote: > Jonathan Scott Duff skribis 2005-05-11 11:45 (-0500): > > 1. specialise ()[] to parse as (,)[] > > 2. scalars are singleton lists, so ()[] naturally > > 3. make (1)[0] die horribly. > > #2 implies that (1)[0][0][0][0] == 1 > > #1 means that (1)[0] == 1

Re: Numification of captured match

2005-05-12 Thread Rob Kinyon
On 5/12/05, Jonathan Scott Duff <[EMAIL PROTECTED]> wrote: > On Thu, May 12, 2005 at 02:55:36PM -0500, Patrick R. Michaud wrote: > > On Fri, May 13, 2005 at 03:23:20AM +0800, Autrijus Tang wrote: > > > Is it really intended that we get into habit of writing this? > > > > > > if 'localhost:80' ~

Re: Plethora of operators

2005-05-14 Thread Rob Kinyon
On 5/14/05, Larry Wall <[EMAIL PROTECTED]> wrote: > On Sat, May 14, 2005 at 01:36:22PM -0500, Rod Adams wrote: > : Larry Wall wrote: > : > : >On Sat, May 14, 2005 at 12:51:32PM -0500, Rod Adams wrote: > : > > : >: Unless, of course, there is some subtle difference between a 3-d hash > : >: and a ha

Re: ^method ?

2005-05-14 Thread Rob Kinyon
On 5/14/05, Rod Adams <[EMAIL PROTECTED]> wrote: > Jonathan Worthington wrote: > > > "Brent 'Dax' Royal-Gordon" <[EMAIL PROTECTED]> wrote: > > > >> Like the decision about which side of the road cars should drive on, > >> it really doesn't matter *which* choice is taken, as long as > >> *something

Re: ^method ?

2005-05-15 Thread Rob Kinyon
On 5/15/05, Juerd <[EMAIL PROTECTED]> wrote: > Autrijus Tang skribis 2005-05-15 19:28 (+0800): > > On Sun, May 15, 2005 at 01:19:53PM +0200, Juerd wrote: > > > Or was your choice of words poor, and did you not mean to discuss the > > > dot's *default*, but instead a standard way to write the curren

Re: ./method

2005-05-15 Thread Rob Kinyon
On 5/15/05, Juerd <[EMAIL PROTECTED]> wrote: > Brad Bowman skribis 2005-05-16 9:56 (+1000): > > Would it conflict with range + pattern? Or has that changed anyway? > > No, "./" and "../" are prefix only, so they cannot clash with an infix > operator like "..". How would print "Foo" while $

Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread Rob Kinyon
> Maybe s/Num/NumLike/ or something? Anyway, that's how I think of it > at least: not that a Str is converted into a Num, but rather that > certain Strs are Nums. If that's the case, then if I change a variable that isa Str (that isa Num), does it change what it inherits from? Rob

Re: reduce metaoperator on an empty list

2005-05-18 Thread Rob Kinyon
On 5/18/05, Stuart Cook <[EMAIL PROTECTED]> wrote: > To summarise what I think everyone is saying, []-reducing an empty > list yields either: > > 1) undef (which may or may not contain an exception), or > 2) some unit/identity value that is a trait of the operator, > > depending on whether or not p

Re: Perl development server

2005-05-23 Thread Rob Kinyon
> If you want access, please let me know. I will send you a temporary > password by e-mail, that I expect you to change the first time you get > the chance. I'd like one. > The box won't have an SVN mirror unless someone puts it there. There > won't be a smoke test unless someone writes the scrip

Re: Perl development server

2005-05-23 Thread Rob Kinyon
On 5/23/05, Juerd <[EMAIL PROTECTED]> wrote: > Rob Kinyon skribis 2005-05-23 11:22 (-0400): > > I'd like one. > > Sure - just think of a nice catchy username! :) robkinyon please - it's catchy enough. > > Maybe we should divvy these tasks out. It would

Re: (OT) Re: Perl development server

2005-05-24 Thread Rob Kinyon
On 5/24/05, Michele Dondi <[EMAIL PROTECTED]> wrote: > On Tue, 24 May 2005, Herbert Snorrason wrote: > > > Icelandic: laukur (Incidentally, none of you will ever guess how to > > correctly pronounce that.) > > Incidentally, would 'laukurdottir' be a proper Icelandic offence? :-) "daughter of an

Reductions, junctions, hashslices, and cribbage scoring

2005-05-25 Thread Rob Kinyon
(This post references the discussion at http://www.perlmonks.org/?node_id=458728, particularly dragonchild's response at the bottom.) For those who don't know, cribbage is a game where each player has access to 4 cards, plus a community card. Various card combinations score points. The one in ques

Re: (1,(2,3),4)[2]

2005-05-26 Thread Rob Kinyon
> Is giving "=" a higher precedence than "," still considered A Good Thing? > > I'm not familiar with the reasoning behind the current situation, but > I'm struggling to come up with any good reasons for keeping it. > > Consider the alternative: > > my $a, $b = 1, 2; # $b should contain 2, not 1

Re: Reductions, junctions, hashslices, and cribbage scoring

2005-05-26 Thread Rob Kinyon
> Assuming you write the subset coroutine above, how about > > $score += > ( subsets(0..4) ==> map { 2 * (15 == [+] @[EMAIL PROTECTED]) } ==> [+] ) Working on it last night and this morning, I ended up with the following, very similar rewrite. sub gen_idx_powerset (Int $size is copy) returns

$*OS and OS::* mixins

2005-05-26 Thread Rob Kinyon
I was thinking on the drive home how to write some of the File::Spec functions in P6. I realized that it would be really neat if $*OS did one of a bunch of mixins (maybe OS::unix, OS::win32, OS::vms, etc). That way, you could multimethod the various functions, using junctions and Any to provide a d

Unicode Operators cheatsheet, please!

2005-05-27 Thread Rob Kinyon
I would love to see a document (one per editor) that describes the Unicode characters in use and how to make them. The Set implementation in Pugs uses (at last count) 20 different Unicode characters as operators. While I'm sure these documents exist on the web somewhere, since P6 is the first time

Syntax of "use"/"require"

2005-05-28 Thread Rob Kinyon
(This thread is referencing http://www.perlmonks.org/?node_id=461105) I'd like to start writing the Module::Build/ExtUtils::MakeMaker for Pugs. One of the first things that was mentioned was that the syntax for use needs to support specifying the exact version or range of versions you want to have

Re: Syntax of "use"/"require"

2005-05-28 Thread Rob Kinyon
On 5/28/05, Rob Kinyon <[EMAIL PROTECTED]> wrote: > (This thread is referencing http://www.perlmonks.org/?node_id=461105) > > I'd like to start writing the Module::Build/ExtUtils::MakeMaker for > Pugs. One of the first things that was mentioned was that the syntax >

Re: date and time formatting

2005-05-31 Thread Rob Kinyon
On 5/31/05, Nathan Gray <[EMAIL PROTECTED]> wrote: > As I am interested in human-readable dates and times, and having found > no conclusive discussion on time formatting, I make my recommendation > for a syntax (to start discussion, and allow for date formatting to be > implemented in pugs): What'

Re: date and time formatting

2005-05-31 Thread Rob Kinyon
> > What's wrong with porting DateTime? > > It's back to the old question of "what's in core?" Are dates and > times something that are used in such a large proportion of programs > that they deserve to be shipped in the basic grammar? Or perhaps in > the basic set of packages? > > Perl 5 has a

Re: date and time formatting

2005-05-31 Thread Rob Kinyon
> - I didn't say we shouldn't port DateTime. My point was simply that, > based on the amount of date-related code on CPAN, this is an issue > that many people care about quite a bit. We would probably be well > served to consider it carefully and decide on what semantics we > really want. Maybe

Re: Unicode Operators cheatsheet, please!

2005-06-01 Thread Rob Kinyon
xOn 5/31/05, Sam Vilain <[EMAIL PROTECTED]> wrote: > Rob Kinyon wrote: > > I would love to see a document (one per editor) that describes the > > Unicode characters in use and how to make them. The Set implementation > > in Pugs uses (at last count) 20 different Unicode

Re: reduce metaoperator on an empty list

2005-06-01 Thread Rob Kinyon
> > $ordered = [<] @array; This is asking "Is @array ordered?" In the case of a 0-element or 1-element array, the answer is "It is not disordered", which means $ordered is true. $ordered = ! [!<] @array; Rob

Re: date and time formatting

2005-06-03 Thread Rob Kinyon
> localtime() and gmtime() seem fairly core to me. The array contexts are > simple, and the scalar context is an RFC valid string. Nothing too heavy > there. The time() function is "typically" only moderately useful without > localtime(). This is true if the time() function returns a simple sca

Re: reduce metaoperator on an empty list

2005-06-06 Thread Rob Kinyon
On 6/6/05, Sam Vilain <[EMAIL PROTECTED]> wrote: > Roger Hale wrote: > > This is why I would rather the o -> [o] circumfixion left [o] an infix, > > not prefix operator. I would rather be explicit about my identity: > > $product = 1 [*] @array; > > Hmm. Not all operators *have* an identity.

Re: How much do we close over?

2005-06-12 Thread Rob Kinyon
> Piers Cawley said: > in other words, some way of declaring that a subroutine wants to hang onto > every lexical it can see in its lexical stack, not matter what static analysis > may say. I'm not arguing with the idea, in general. I just want to point out that this implies that you're going to h

<    1   2