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
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.
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
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
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
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
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
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 =
(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
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)
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);
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
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) =
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
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
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
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
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
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)
+++
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:
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
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
22 matches
Mail list logo