Re: proposal: binding with a function

2005-06-14 Thread BÁRTHÁZI András
Larry, You can always write a macro that does that. [...] That won't work on a method name anyway unless you do it in the dispatch class. [...] You'll have to write your own macro if you want to do that. As I understood, you wrote down, how I can workaround it with macros, and why it wouldn

Re: Hyper-concat

2005-06-14 Thread Rod Adams
Juerd wrote: Still, argumentless split probably defaults to something. And ' ' is a good thing to default to, IMO. I like /\s+/ as a default for split better. -- Rod Adams

Re: Hyper-concat

2005-06-14 Thread Juerd
Darren Duncan skribis 2005-06-14 15:12 (-0700): > And the space character is really a rather arbitrary looking value > for a default and is equally valid with, say, the line break, so how > can one say it is better? Array stringification uses it too, by default. The lesser the number of defaults

Re: Hyper-concat

2005-06-14 Thread Darren Duncan
At 12:01 AM +0200 6/15/05, Juerd wrote: Larry Wall skribis 2005-06-14 14:54 (-0700): : [ 'a' .. 'e' ].join # "a b c d e" : [ 'a' .. 'e' ].cat# "abcde" I had forgotten that. Yes, there is a little something to be said for preserving the (mostly false) symmetry of split and join

Re: Hyper-concat

2005-06-14 Thread Juerd
Larry Wall skribis 2005-06-14 14:54 (-0700): > : [ 'a' .. 'e' ].join # "a b c d e" > : [ 'a' .. 'e' ].cat# "abcde" > I had forgotten that. Yes, there is a little something to be > said for preserving the (mostly false) symmetry of split and join. > I think I argued for .cat on the ba

Re: Hyper-concat

2005-06-14 Thread Larry Wall
On Tue, Jun 14, 2005 at 11:33:21PM +0200, Juerd wrote: : You suggested cat as a join assuming '' in an old thread. I still like : that idea. : : [ 'a' .. 'e' ].join # "a b c d e" : [ 'a' .. 'e' ].cat# "abcde" I had forgotten that. Yes, there is a little something to be said for pre

Re: %hash1 >>...<< %hash2

2005-06-14 Thread Larry Wall
On Tue, Jun 14, 2005 at 12:55:37PM -0700, Brent 'Dax' Royal-Gordon wrote: : David Formosa (aka ? the Platypus) <[EMAIL PROTECTED]> wrote: : > If you consider arrays to be hashes keyed by integers then @a >>..<< : > @b does the equiverlent of an inner join. I would suggest that if we : > are going

Re: Hyper-concat

2005-06-14 Thread Juerd
Larry Wall skribis 2005-06-14 14:15 (-0700): > On Tue, Jun 14, 2005 at 10:31:58PM +0200, Ingo Blechschmidt wrote: > : You can use > : say [~] @array; # "abcd" or > : say @array.join("");# "abcd" or > : say join "", @array;# "abcd" > : if you want to supress the spaces. > I

Re: Hyper-concat

2005-06-14 Thread Larry Wall
On Tue, Jun 14, 2005 at 10:31:58PM +0200, Ingo Blechschmidt wrote: : You can use : say [~] @array; # "abcd" or : say @array.join("");# "abcd" or : say join "", @array;# "abcd" : if you want to supress the spaces. I think a bare @array.join should also work. Larry

Re: Hyper-concat

2005-06-14 Thread Ingo Blechschmidt
Hi, Thomas Klausner wrote: > my $string= >>~<< <1 2 3>; > say $string; > # prints a1 b2 c3 > > But where do the spaces in the second example come from? the spaces come from the stringification of lists/arrays: my @array = ; say [EMAIL PROTECTED];# "a b c d" You can use say [~

Hyper-concat

2005-06-14 Thread Thomas Klausner
Hi! While playing around with some japh-obfus (which turned into my first commit to Pugs, yay!) I spotted this say >>~<< <1 2 3>; # prints a1b2c3 my $string= >>~<< <1 2 3>; say $string; # prints a1 b2 c3 I suppose this is caused by some context things. C imposes list context (as print in Perl

Re: State of Design Documents

2005-06-14 Thread Joshua Gatcomb
On 6/14/05, Larry Wall <[EMAIL PROTECTED]> wrote: > Heh, that classification was a fast guess about RFCs made more than > 4 years ago. I'm amazed it's stood up as well as it has, even where > it hasn't. I agree, and lacking anything I could find more recent, initially thought it was the right way

Re: %hash1 >>...<< %hash2

2005-06-14 Thread Brent 'Dax' Royal-Gordon
David Formosa (aka ? the Platypus) <[EMAIL PROTECTED]> wrote: > If you consider arrays to be hashes keyed by integers then @a >>..<< > @b does the equiverlent of an inner join. I would suggest that if we > are going to have outer join versions then we have something like this It does? I thought

Re: MMD vs. anonymous parameter types referencing earlier parameters

2005-06-14 Thread Larry Wall
On Tue, Jun 14, 2005 at 04:25:17PM +0200, Chip Salzenberg wrote: : On Tue, Jun 14, 2005 at 03:43:42PM +0200, "TSa (Thomas Sandlaß)" wrote: : > The syntax might just be: : > : >&is_equal:(Integer $a, Integer where { $_ == $a } :) : > : : It's a new type object every time, so every time you ru

Re: State of Design Documents

2005-06-14 Thread Larry Wall
On Tue, Jun 14, 2005 at 09:38:43AM -0400, Joshua Gatcomb wrote: : On 6/13/05, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: : : > Since it might not have been clear from my earlier post -- I've : > now committed the S17 framework draft into the repository. Thanks. : : I am now questioning using

Re: Binding slices

2005-06-14 Thread Piers Cawley
Luke Palmer <[EMAIL PROTECTED]> writes: > On 6/14/05, Piers Cawley <[EMAIL PROTECTED]> wrote: >> Following a conversation with Chip on IRC, is this >> >> my @y := @foo[0..][1]; >> >> legal? > > Definitely not. But it sure would be nice if this: > > my @y := @foo[0...][1]; > > were. I t

Re: BEGIN {...} and IO

2005-06-14 Thread Ingo Blechschmidt
Ingo Blechschmidt wrote: > # No problem: > my $data = BEGIN { > my $fh = open "some_file" err...; > =$fh; > }; > > # Problem; > my $fh = BEGIN { open "some_file" err... }; > # Compile-time filehandle leaked into runtime! > say =$fh; [...] > * There's a boolean property may_le

Re: %hash1 >>...<< %hash2

2005-06-14 Thread David Formosa \(aka ? the Platypus\)
On Tue, 14 Jun 2005 07:19:09 -0700, Mark A. Biggar <[EMAIL PROTECTED]> wrote: > Luke Palmer wrote: >> On 14 Jun 2005 06:07:10 -, David Formosa (aka ? the Platypus) >> <[EMAIL PROTECTED]> wrote: >>>multi sub infix_circumfix_meta_operator:{'>>','<<'} (Hash %a,Hash %b,Code >>>$op) { >>>m

Re: Assigning Proxy objects

2005-06-14 Thread Larry Wall
On Tue, Jun 14, 2005 at 12:33:34PM +, Ingo Blechschmidt wrote: : Hi, : : sub proxy () is rw { : return new Proxy: : FETCH => { 42 }, : STORE => -> $new { 23 }; : } : : say proxy();# 42 : say proxy() = 40; # 40, 23, or 42? : : Currently I think the

Re: proposal: binding with a function

2005-06-14 Thread Larry Wall
On Tue, Jun 14, 2005 at 02:06:37PM +0200, BÁRTHÁZI András wrote: : Hi, : : As I know, for binding, you can use the := operator, and just this: : : $a := $b; : : I would like to make a proposal, based on Ruby[1]: : : alias $a, $b; You can always write a macro that does that. : It's a fun:

Re: MMD vs. anonymous parameter types referencing earlier parameters

2005-06-14 Thread TSa (Thomas Sandlaß)
Chip Salzenberg wrote: Link link. http://www.cs.washington.edu/research/projects/cecil/www/Papers/gud.html In case it matters, we're trying to support the Perl 6 semantics of both ($a:$b:) and ($a,$b:). The former looks like something that could be implemented with something called "predicat

Re: Creating a web templating engine

2005-06-14 Thread Ingo Blechschmidt
Hi, BÁRTHÁZI András wrote: >>> $wte = new WTE; >>> $wte.register('input', &my_input_widget); >>> >>> I don't prefer it, to be 20-30 register line in my programs, that >>> does nothing, just register. >> >> maybe something like this? >> >> class MyWTE is WTE { >>method input (...) {...} >>

Re: Creating a web templating engine

2005-06-14 Thread BÁRTHÁZI András
Hi, $wte = new WTE; $wte.register('input', &my_input_widget); I don't prefer it, to be 20-30 register line in my programs, that does nothing, just register. maybe something like this? class MyWTE is WTE { method input (...) {...} method some_other_thing_you_would_have_had_to_register

Re: Creating a web templating engine

2005-06-14 Thread Ingo Blechschmidt
Hi, BÁRTHÁZI András wrote: > $wte = new WTE; > $wte.register('input', &my_input_widget); > > I don't prefer it, to be 20-30 register line in my programs, that does > nothing, just register. maybe something like this? class MyWTE is WTE { method input (...) {...} method some_other_thin

Creating a web templating engine

2005-06-14 Thread BÁRTHÁZI András
Hi, I'm busy with creating a widget based web templating engine, but I have some problems, please help me. The engine would allow you to define widgets, and use those in your templates. I would like it to be an OO module. In the template, you can write this: When the template engine read

Re: &?CALLER::BLOCK vs. any hope of efficient compilation

2005-06-14 Thread Larry Wall
On Tue, Jun 14, 2005 at 04:13:08PM +0200, Chip Salzenberg wrote: : It therefore would a Bad Thing if &?CALLER::BLOCK worked generally. : If the caller _is_ a block that was already marked at compile time as : requiring full sub properties then, of course, it's no problem to use : the syntax &?CALLE

Re: new mailing list: perl6-general?

2005-06-14 Thread BÁRTHÁZI András
Hi, Anyway, I understand why you wrote what you wrote, so as there will be no decision, I'll ask my questions on perl6-compiler. I mean, perl6-language. Bye, Andras

Re: new mailing list: perl6-general?

2005-06-14 Thread BÁRTHÁZI András
Hi, So, that leaves either perl6-language or a new list. Personally I could see it going either way -- even though general Perl6 programming questions aren't directly about language design, it may still be useful to language designers to see the types of questions that people are asking and to

Re: new mailing list: perl6-general?

2005-06-14 Thread Patrick R. Michaud
On Tue, Jun 14, 2005 at 03:54:45PM +0200, BÁRTHÁZI András wrote: > I would have some general Perl6 programming questions. Where should I ask > them? It's not about language design, not about compiling/compilers and > even not related to the internals. > > As more and more people will start hacki

Re: new mailing list: perl6-general?

2005-06-14 Thread BÁRTHÁZI András
Hi, Just wanted to say the same. All my questions starting as "How to..." and "Is this..." are just to trivial to ask here :) - Fagzal I would have some general Perl6 programming questions. Where should I ask them? It's not about language design, not about compiling/compilers and even not rel

Re: new mailing list: perl6-general?

2005-06-14 Thread Jonathan Scott Duff
On Tue, Jun 14, 2005 at 04:27:20PM +0200, Fagyal Csongor wrote: > Just wanted to say the same. All my questions starting as "How to..." > and "Is this..." are just to trivial to ask here :) > > - Fagzal > > >I would have some general Perl6 programming questions. Where should I > >ask them? It's

Re: new mailing list: perl6-general?

2005-06-14 Thread Fagyal Csongor
Hi, Just wanted to say the same. All my questions starting as "How to..." and "Is this..." are just to trivial to ask here :) OTOH as there is no "global" Perl5 list (AFAIK, at least), these things should go to the "regional" mail-lists - later on. However, at this phase of develpment of Per

Re: MMD vs. anonymous parameter types referencing earlier parameters

2005-06-14 Thread Chip Salzenberg
On Tue, Jun 14, 2005 at 03:43:42PM +0200, "TSa (Thomas Sandlaß)" wrote: > Chip Salzenberg wrote: > >This: > >multi sub is_equal(Integer $a, Integer where { $_ == $a } $b: ) { 1 } > >hurts. At least as I've been given to understand it[*], is impossible > >to implement, because the second parame

Re: %hash1 >>...<< %hash2

2005-06-14 Thread Mark A. Biggar
Luke Palmer wrote: On 14 Jun 2005 06:07:10 -, David Formosa (aka ? the Platypus) <[EMAIL PROTECTED]> wrote: multi sub infix_circumfix_meta_operator:{'>>','<<'} (Hash %a,Hash %b,Code $op) { my Hash %return; for intersection(keys %a,keys %b) -> $key { %return{$key} = $o

&?CALLER::BLOCK vs. any hope of efficient compilation

2005-06-14 Thread Chip Salzenberg
I'd like a ruling that &?CALLER::BLOCK is not a general-purpose block promoter, but only works if the calling block already marked itself as callable, perhaps by mentioning &?BLOCK in its body. First, I like the idea that all blocks act as if they were subs WRT being callable and accepting paramet

new mailing list: perl6-general?

2005-06-14 Thread BÁRTHÁZI András
Hi, I would have some general Perl6 programming questions. Where should I ask them? It's not about language design, not about compiling/compilers and even not related to the internals. As more and more people will start hacking Perl6, I think, that it would be useful to having a list for thi

Re: MMD vs. anonymous parameter types referencing earlier parameters

2005-06-14 Thread TSa (Thomas Sandlaß)
Chip Salzenberg wrote: This: multi sub is_equal(Integer $a, Integer where { $_ == $a } $b: ) { 1 } hurts. At least as I've been given to understand it[*], is impossible to implement, because the second parameter's type can't be precalculated in order to prepare for MMD dispatching. Quite

Re: Binding slices

2005-06-14 Thread Luke Palmer
On 6/14/05, Piers Cawley <[EMAIL PROTECTED]> wrote: > Following a conversation with Chip on IRC, is this > > my @y := @foo[0..][1]; > > legal? Definitely not. But it sure would be nice if this: my @y := @foo[0...][1]; were. Luke

Re: %hash1 >>...<< %hash2

2005-06-14 Thread Luke Palmer
On 14 Jun 2005 06:07:10 -, David Formosa (aka ? the Platypus) <[EMAIL PROTECTED]> wrote: > multi sub infix_circumfix_meta_operator:{'>>','<<'} (Hash %a,Hash %b,Code > $op) { > my Hash %return; > for intersection(keys %a,keys %b) -> $key { > %return{$key} = $op($a{$key

Re: State of Design Documents

2005-06-14 Thread Joshua Gatcomb
On 6/13/05, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > Since it might not have been clear from my earlier post -- I've > now committed the S17 framework draft into the repository. Thanks. I am now questioning using "Perl6 Timeline By Apocolypse" as reference material. I am rather intereste

MMD vs. anonymous parameter types referencing earlier parameters

2005-06-14 Thread Chip Salzenberg
This: multi sub is_equal(Integer $a, Integer where { $_ == $a } $b: ) { 1 } hurts. At least as I've been given to understand it[*], is impossible to implement, because the second parameter's type can't be precalculated in order to prepare for MMD dispatching. The type object describing $b c

Assigning Proxy objects

2005-06-14 Thread Ingo Blechschmidt
Hi, sub proxy () is rw { return new Proxy: FETCH => { 42 }, STORE => -> $new { 23 }; } say proxy();# 42 say proxy() = 40; # 40, 23, or 42? Currently I think the last line should output 40, consider: sub innocent_sub ($var is copy) { my $foo

proposal: binding with a function

2005-06-14 Thread BÁRTHÁZI András
Hi, As I know, for binding, you can use the := operator, and just this: $a := $b; I would like to make a proposal, based on Ruby[1]: alias $a, $b; It's a fun: sub newline { "\n" x $_; } alias newlines, newline; So you can write: print 5.enters; Currently, you have to

Binding slices

2005-06-14 Thread Piers Cawley
Following a conversation with Chip on IRC, is this my @y := @foo[0..][1]; legal?

%hash1 >>...<< %hash2

2005-06-14 Thread David Formosa \(aka ? the Platypus\)
This is inspired inpart by discussions I had on #perl6. Basically what is the behavour of the hyperop when applied to two hashes. The concensus was that the hashes would get unrolled into lists, and the pairs would get matched up more or less randomly. I don't feel that this is a