%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

Binding slices

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

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

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 =

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

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 interested in

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: 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.

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

?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

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} =

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 parameter's type

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

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 not about

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 hacking

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 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: ?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

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: server:input id=name

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, BRTHZI Andrs 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

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

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: 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: 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

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 think that's what I

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: 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 run that

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 that

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 a b c ~ 1 2 3; # prints a1b2c3 my $string=a b c ~ 1 2 3; say $string; # prints a1 b2 c3 I suppose this is caused by some context things. Csay imposes list context (as print in

Re: Hyper-concat

2005-06-14 Thread Ingo Blechschmidt
Hi, Thomas Klausner wrote: my $string=a b c ~ 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 = a b c d; say [EMAIL PROTECTED];# a b c d You can use say

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 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 think a bare

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

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 basis that

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
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 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