Re: Should a closure-in-a-string get the placeholder parameters from its surroundings?

2008-11-21 Thread TSa
HaloO, Carl Mäsak wrote: I expected this to DWIM today: $ perl6 -e 'my $cl = { $^name upcased becomes {$^name.uc} }; say $cl(larry)' ...but it doesn't in Rakudo r32938: too few arguments passed (0) - 1 params expected ...and for understandable (if not good) reasons: the closure inside the

[perl #60718] [PATCH] better error message for .new on undefined class

2008-11-21 Thread via RT
# New Ticket Created by Chris Dolan # Please include the string: [perl #60718] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60718 If you accidentally try to instantiate a class that has not been defined, but the

Re: [perl #60678] Configure.pl manifest problem on Win32

2008-11-21 Thread Ron Blaschke
Will Coleda wrote: On Thu, Nov 20, 2008 at 4:12 PM, Will Coleda [EMAIL PROTECTED] wrote: On Thu, Nov 20, 2008 at 3:45 PM, Peter Schwenn [EMAIL PROTECTED] wrote: Will Coleda You can drop this thread if you like. This is a waste of your time. What I need to do is to find someone who is

Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-21 Thread Mark J. Reed
On Thu, Nov 20, 2008 at 4:25 PM, Wolfgang Laun [EMAIL PROTECTED] wrote: So, calling sqrt with a real 0, should not come back with a complex number. Again, I think this should depend on context. In Perl5, simply use'ing Math::Complex changes the behavior of sqrt such that sqrt(-1) returns i.

S16: chown, chmod

2008-11-21 Thread dpuu
Reading S16, I was struck by the lack of abstraction over the underlying Unix API for chown and chmod. Nothing wrong with having the existing functions lying about in a module that people can use Unix for; but I do feel that the variants in the global namespace should be more user-friendly.

Re: S16: chown, chmod

2008-11-21 Thread Larry Wall
On Fri, Nov 21, 2008 at 08:44:51AM -0800, dpuu wrote: : Reading S16, I was struck by the lack of abstraction over the : underlying Unix API for chown and chmod. Nothing wrong with having the : existing functions lying about in a module that people can use Unix : for; but I do feel that the

Re: S16: chown, chmod

2008-11-21 Thread dpuu
On Nov 21, 9:16 am, [EMAIL PROTECTED] (Larry Wall) wrote: Please feel free to whack on the spec OK, working on it. Question: is it appropriate to P6 lookfeel to have methods on functions? The definition of Cchown includes the statement that it's not available on most system unless you're

Re: S16: chown, chmod

2008-11-21 Thread Larry Wall
On Fri, Nov 21, 2008 at 09:57:30AM -0800, dpuu wrote: : On Nov 21, 9:16 am, [EMAIL PROTECTED] (Larry Wall) wrote: : Please feel free to whack on the spec : : OK, working on it. : : Question: is it appropriate to P6 lookfeel to have methods on : functions? : : The definition of Cchown includes

Re: S16: chown, chmod

2008-11-21 Thread Moritz Lenz
dpuu wrote: Question: is it appropriate to P6 lookfeel to have methods on functions? I don't think that's such a good idea in this case. If a file is chown'able is not a property of the chown function, but of the file. The definition of Cchown includes the statement that it's not available

Re: S16: chown, chmod

2008-11-21 Thread Larry Wall
On Fri, Nov 21, 2008 at 07:30:08PM +0100, Moritz Lenz wrote: : For chmod() I could imagine an interface like this: : : $file.chmod(:8540); : $file.chmod( :set, :user = :r :x, :group = :r) :# both same as 'chmod 540 $file' : : $file.chmod( :modifiy, :other = :!x) :# same as

Re: S16: chown, chmod

2008-11-21 Thread Moritz Lenz
Larry Wall wrote: On Fri, Nov 21, 2008 at 07:30:08PM +0100, Moritz Lenz wrote: : For chmod() I could imagine an interface like this: : : $file.chmod(:8540); : $file.chmod( :set, :user = :r :x, :group = :r) :# both same as 'chmod 540 $file' : : $file.chmod( :modifiy, :other =

multi return values

2008-11-21 Thread Andy Colson
(Sorry if this dbl-posts, sent it from the wrong account the first time) Hi all, what's wrong with this code: use v6; sub multireturn($x, $y) { my $a = $x * 2; my $b = $y * 2; return($a, $b); } my($a, $b) = multireturn(2, 3); using: This is Rakudo Perl 6, revision

Re: multi return values

2008-11-21 Thread Jonathan Worthington
Andy Colson wrote: Hi all, what's wrong with this code: use v6; sub multireturn($x, $y) { my $a = $x * 2; my $b = $y * 2; return($a, $b); } my($a, $b) = multireturn(2, 3); Nothing that I can see. using: This is Rakudo Perl 6, revision 32970 built on parrot 0.8.1-devel for

Re: multi return values

2008-11-21 Thread Moritz Lenz
Andy Colson wrote: (Sorry if this dbl-posts, sent it from the wrong account the first time) Hi all, what's wrong with this code: use v6; sub multireturn($x, $y) { my $a = $x * 2; my $b = $y * 2; return($a, $b); } my($a, $b) = multireturn(2, 3); There's (nearly)

Re: multi return values

2008-11-21 Thread Andy Colson
Moritz Lenz wrote: Andy Colson wrote: (Sorry if this dbl-posts, sent it from the wrong account the first time) Hi all, what's wrong with this code: use v6; sub multireturn($x, $y) { my $a = $x * 2; my $b = $y * 2; return($a, $b); } my($a, $b) = multireturn(2, 3);

Re: S16: chown, chmod

2008-11-21 Thread dpuu
before I attempt to change the POD, would this wording be appropriate? =item chown our multi chown (Int $uid, Int $gid, Str|IO [EMAIL PROTECTED]) our multi chown (Str $user, Str $group, Str|IO [EMAIL PROTECTED]) Changes the owner (and/or group) of a list of files. The new ownership can

Re: multi return values

2008-11-21 Thread Moritz Lenz
Andy Colson wrote: Moritz Lenz wrote: Andy Colson wrote: (Sorry if this dbl-posts, sent it from the wrong account the first time) Hi all, what's wrong with this code: use v6; sub multireturn($x, $y) { my $a = $x * 2; my $b = $y * 2; return($a, $b); } my($a, $b) =

Re: Should a closure-in-a-string get the placeholder parameters from its surroundings?

2008-11-21 Thread Carl Mäsak
TSa (): I just want to make sure that I got the problem right. Would my $cl = { $^name upcased becomes {$^OUTER::name.uc} }; say $cl(larry) work? The idea is that the embedded closure refers to the strings $^name. And now the dwimmyness shall make that implicit, right? I guess that

Re: multi return values

2008-11-21 Thread Ryan Richter
On Fri, Nov 21, 2008 at 08:16:21PM +0100, Moritz Lenz wrote: Andy Colson wrote: (The thing that's still wrong with your code is that you need a whitespace after the 'my', otherwise my(...) should be parsed as a function call). Also this, I think: return($a, $b); -ryan

Re: Should a closure-in-a-string get the placeholder parameters from its surroundings?

2008-11-21 Thread Larry Wall
On Fri, Nov 21, 2008 at 09:42:41AM +0100, TSa wrote: HaloO, Carl Mäsak wrote: I expected this to DWIM today: $ perl6 -e 'my $cl = { $^name upcased becomes {$^name.uc} }; say $cl(larry)' ...but it doesn't in Rakudo r32938: too few arguments passed (0) - 1 params expected ...and for

Re: multi return values

2008-11-21 Thread Carl Mäsak
Ryan (), Moritz (), Andy (): (The thing that's still wrong with your code is that you need a whitespace after the 'my', otherwise my(...) should be parsed as a function call). Also this, I think: return($a, $b); ...except that that _is_ a function call. // Carl

Re: S16: chown, chmod

2008-11-21 Thread Larry Wall
On Fri, Nov 21, 2008 at 11:46:48AM -0800, dpuu wrote: : before I attempt to change the POD, would this wording be appropriate? It's a good first whack, though we might want to think about making it a little less P5ish/Unixish in changing a list of files, and rely instead of one of P6's

[svn:perl6-synopsis] r14607 - doc/trunk/design/syn

2008-11-21 Thread larry
Author: larry Date: Fri Nov 21 15:16:01 2008 New Revision: 14607 Modified: doc/trunk/design/syn/S02.pod doc/trunk/design/syn/S06.pod Log: various clarifications Modified: doc/trunk/design/syn/S02.pod == ---

[svn:perl6-synopsis] r14608 - doc/trunk/design/syn

2008-11-21 Thread larry
Author: larry Date: Fri Nov 21 15:40:52 2008 New Revision: 14608 Modified: doc/trunk/design/syn/S06.pod Log: typo Modified: doc/trunk/design/syn/S06.pod == --- doc/trunk/design/syn/S06.pod(original) +++

multi return values

2008-11-21 Thread Andy Colson
Hi all, what's wrong with this code: use v6; sub multireturn($x, $y) { my $a = $x * 2; my $b = $y * 2; return($a, $b); } my($a, $b) = multireturn(2, 3); using: This is Rakudo Perl 6, revision 32970 built on parrot 0.8.1-devel for i486-linux-thread-multi. I get:

Re: S16: chown, chmod

2008-11-21 Thread Dave Whipp
The restriction of chown to the superuser is a property of the OS, not the files. The example from the pod is: use POSIX qw(sysconf _PC_CHOWN_RESTRICTED); my $can_chown_giveaway = not sysconf(_PC_CHOWN_RESTRICTED); Thinking about it, perhaps that means that it's a method on $*OS. The use of

Re: S16: chown, chmod

2008-11-21 Thread Dave Whipp
Larry Wall wrote: On Fri, Nov 21, 2008 at 11:46:48AM -0800, dpuu wrote: : before I attempt to change the POD, would this wording be appropriate? It's a good first whack, though we might want to think about making it a little less P5ish/Unixish in changing a list of files, and rely instead of

bytes, lazy strings and zlib

2008-11-21 Thread Chris Dolan
In my ongoing quest to create a PDF parser in Perl6, I have some Rakudo/PGE/parrot questions. These are low-urgency and some of these may not be implemented yet... 1) byte orientation PDF's syntax is inherently an 8-bit ASCII superset. Some subsections may be interpreted as some

[perl #60732] Hash indexes shouldn't work on array refs

2008-11-21 Thread via RT
# New Ticket Created by Moritz Lenz # Please include the string: [perl #60732] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60732 From #perl6 today: 19:33 moritz_ rakudo: my $x = [ 42 ]; say $x0 19:33 p6eval

[perl #60734] [TODO] $^foo variable should also declare corresponding $foo variable

2008-11-21 Thread Carl Mäsak
# New Ticket Created by Carl Mäsak # Please include the string: [perl #60734] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60734 This should output dito twice: $ ./perl6 -e '{ say $^same; say $same }.(dito)' Scope

Re: [perl #60732] Hash indexes shouldn't work on array refs

2008-11-21 Thread jerry gay
On Fri, Nov 21, 2008 at 10:43, via RT Moritz Lenz [EMAIL PROTECTED] wrote: # New Ticket Created by Moritz Lenz # Please include the string: [perl #60732] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60732 From