At 12:06 PM +0800 5/25/05, Autrijus Tang wrote:
So, this now works in Pugs with (with a env PUGS_EMBED=perl5 build):
use Digest--perl5;
my $cxt = Digest.SHA1;
$cxt.add('Pugs!');
# This prints: 66db83c4c3953949a30563141f08a848c4202f7f
say $cxt.hexdigest;
This includes the
Juerd wrote:
An array in scalar context evaluates to a reference to itself.
A hash in scalar context evaluates to a reference to itself.
An array in list context evaluates to a list of its elements.
A hash in list context evaluates to a list of its elements (as pairs).
Array context is a
TSa (Thomas Sandlaß) skribis 2005-05-25 10:47 (+0200):
I have understand what you mean and how you---and other p6l'er---
derive [EMAIL PROTECTED] == 1 from @a = [1,2,3]. But allow me to regard this
as slightly inconsistent, asymmetric or some such.
If you STILL don't understand that it has
Luke Palmer [EMAIL PROTECTED] writes:
On 5/6/05, J Matisse Enzer [EMAIL PROTECTED] wrote:
I've become scared that if Perl is to continue to be viable for large,
complex, multi-developer projects that the tools need to serious
catch-up with what is available for Java, for example. Things like:
Piers Cawley wrote:
One of the 'mental apps' that's been pushing some of the things I've been
asking for in Perl 6's introspection system is a combined
refactoring/debugging/editing environment for the language. One of the
annoyances of the 'only perl can parse Perl' thing is not so much the
Juerd wrote:
If you STILL don't understand that it has nothing to do with
inconsistency or asymmetry, then please allow me to at this point give
up and stop trying to explain.
I would bewail that, because your explainations are very clear.
And it might appear different but I'm just trying to
TSa (Thomas Sandlaß) skribis 2005-05-25 13:53 (+0200):
%a = ( a = 1, b = 2, c = 3 ) # @a = (1,2,3)
HASH = THREE PAIRS
I look at it as infix:{'='}:( Hash, List of Pair : -- Ref of Hash )
and then try to understand how it behaves. BTW, I'm neither sure
of the type of the second invocant
Aaron Sherman [EMAIL PROTECTED] writes:
On Wed, 2005-05-18 at 10:51, Luke Palmer wrote:
Except that mixins like this always treat things as virtual.
Whenever you mixin a role at runtime, Perl creates an empty, anonymous
subclass of the current class and mixes the role in that class. Since
Juerd wrote:
If assigning a ref to a hash uses the hashref's elements, then the same
is to be expected for an array.
Same feeling here. But I would let the array concede.
Because this behaviour is unwanted for
arrays (because you then can't assign a single arrayref anymore without
doubling
Jonathan Scott Duff wrote:
On Tue, May 24, 2005 at 11:24:50PM -0400, Jeff 'japhy' Pinyan wrote:
I wish !prop X was allowed. I don't see why !... has to be confined
to zero-width assertions.
I don't either actually. One thing that occurred to me while responding
to your original email was
Autrijus Tang [EMAIL PROTECTED] writes:
So, this now works in Pugs with (with a env PUGS_EMBED=perl5 build):
use Digest--perl5;
my $cxt = Digest.SHA1;
$cxt.add('Pugs!');
# This prints: 66db83c4c3953949a30563141f08a848c4202f7f
say $cxt.hexdigest;
This includes the
[1,2,3] is not an array or a list. It is a reference to an anonymous array.
It is not 3 values; it¹s 1 value, which happens to point to a list of size
3. If you assign that to an array via something like @a = [1,2,3], I would
expect at least a warning and possibly a compile-time error.
If it
On May 25, Jonathan Scott Duff said:
On Tue, May 24, 2005 at 11:24:50PM -0400, Jeff 'japhy' Pinyan wrote:
I wish !prop X was allowed. I don't see why !... has to be confined
to zero-width assertions.
I don't either actually. One thing that occurred to me while responding
to your original
On May 25, 2005, at 5:39 AM, Piers Cawley wrote:
One of the 'mental apps' that's been pushing some of the things I've
been
asking for in Perl 6's introspection system is a combined
refactoring/debugging/editing environment for the language.
Maybe I have been reading too much about Smalltalk
On May 25, Mark A. Biggar said:
Jonathan Scott Duff wrote:
On Tue, May 24, 2005 at 11:24:50PM -0400, Jeff 'japhy' Pinyan wrote:
I wish !prop X was allowed. I don't see why !... has to be confined to
zero-width assertions.
I don't either actually. One thing that occurred to me while
Jeff 'japhy' Pinyan wrote:
On May 25, Mark A. Biggar said:
Jonathan Scott Duff wrote:
On Tue, May 24, 2005 at 11:24:50PM -0400, Jeff 'japhy' Pinyan wrote:
I wish !prop X was allowed. I don't see why !... has to be
confined to zero-width assertions.
I don't either actually. One thing
Is [EMAIL PROTECTED] the correct way to get a hash slice using elements of an
array?
(it's giving me a compilation error with pugs)
Cheers,
Carl
On Wed, May 25, 2005 at 05:00:39PM +0100, Carl Franks wrote:
Is [EMAIL PROTECTED] the correct way to get a hash slice using elements of
an array?
Yep.
(it's giving me a compilation error with pugs)
Works just fine for me. What version of pugs are you using? Perhaps
you need to upgrade.
Autrijus Tang wrote:
So, this now works in Pugs with (with a env PUGS_EMBED=perl5 build):
use Digest--perl5;
my $cxt = Digest.SHA1;
$cxt.add('Pugs!');
# This prints: 66db83c4c3953949a30563141f08a848c4202f7f
say $cxt.hexdigest;
This includes the Digest.pm from Perl 5.
On 5/25/05, Jonathan Scott Duff [EMAIL PROTECTED] wrote:
Works just fine for me. What version of pugs are you using? Perhaps
you need to upgrade.
Ok, I've just realised I had missed a '-' to '.' in my perl5 to perl6
conversion,
I was trying to do
[EMAIL PROTECTED] = $obj-list;
I wasn't sure
On 5/25/05, Deborah Pickett [EMAIL PROTECTED] wrote:
I'm afraid that because of the dynamic parse/execute nature of Perl, it
may be a theoretically intractable problem to parse Perl safely.
Yep. It's not really possible for the parser to distinguish between:
BEGIN {
Autrijus Tang wrote:
So, this now works in Pugs with (with a env PUGS_EMBED=perl5 build):
use Digest--perl5;
my $cxt = Digest.SHA1;
$cxt.add('Pugs!');
# This prints: 66db83c4c3953949a30563141f08a848c4202f7f
say $cxt.hexdigest;
This includes the Digest.pm from Perl 5. DBI.pm,
TSa (Thomas Sandlaß) wrote:
You mean @a = [[1,2,3]]? Which is quite what you need for multi
dimensional arrays anyway @m = [[1,2],[3,4]] and here you use
of course @m[0][1] to pull out the 2. I'm not sure if this automatically
makes the array multi-dimensional to the type system though. That
--- Rod Adams [EMAIL PROTECTED] wrote:
TSa (Thomas Sandlaß) wrote:
You mean @a = [[1,2,3]]? Which is quite what you need for multi
dimensional arrays anyway @m = [[1,2],[3,4]] and here you use
of course @m[0][1] to pull out the 2. I'm not sure if this
automatically
makes the array
Austin Hastings wrote:
--- Rod Adams [EMAIL PROTECTED] wrote:
TSa (Thomas Sandlaß) wrote:
You mean @a = [[1,2,3]]? Which is quite what you need for multi
dimensional arrays anyway @m = [[1,2],[3,4]] and here you use
of course @m[0][1] to pull out the 2. I'm not sure if this
The Perl 6 Summary for the week ending 2005-05-24
Note to self: It's generally not a good idea to go installing Tiger on
the day you return from holiday. It's especially not a good idea to fail
to check that it didn't completely and utterly radish your Postfix
configuration. And
(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
Mark Reed skribis 2005-05-25 10:49 (-0400):
[1,2,3] is not an array or a list. It is a reference to an anonymous array.
It is not 3 values; it¹s 1 value, which happens to point to a list of size
Just for accuracy: it points to an array, which is still not a list in
our jargon.
3. If you
On 2005-05-25 13:54, Juerd [EMAIL PROTECTED] wrote:
3. If you assign that to an array via something like @a = [1,2,3], I would
expect at least a warning and possibly a compile-time error.
If it does work, it probably gets translated into @a = ([1,2,3]), which
That's not a
Mark Reed skribis 2005-05-25 14:09 (-0400):
That's not a translation. Parens, when not postfix, serve only one
purpose: group to defeat precedence. $foo and ($foo) are always the same
thing, regardless of the $foo.
So, you could then do this to make an array of size 3 in Perl6?
@a =
Juerd wrote:
Mark Reed skribis 2005-05-25 14:09 (-0400):
That's not a translation. Parens, when not postfix, serve only one
purpose: group to defeat precedence. $foo and ($foo) are always the same
thing, regardless of the $foo.
So, you could then do this to make an array of size 3
On Wed, May 25, 2005 at 01:38:27PM -0500, Rod Adams wrote:
Or use
@a == 1,2,3;
I would just like to say that I like this idiom immensely.
my @foo == 1, 2, 3;
reads extremely well to me, especially since I've always disliked the
usage of '=' as an operator with side effects. (I'm
w == wolverian [EMAIL PROTECTED] writes:
w On Wed, May 25, 2005 at 01:38:27PM -0500, Rod Adams wrote:
Or use
@a == 1,2,3;
w I would just like to say that I like this idiom immensely.
w my @foo == 1, 2, 3;
w reads extremely well to me, especially since I've always
On Wed, May 25, 2005 at 07:07:02PM -0400, Uri Guttman wrote:
please don't use == for simple assignments as it will confuse too many
newbies and auch. it (and its sister ==) are for pipelining ops like
map/grep and for forcing assignment to the slurpy array arg of funcs
(hey, i think i said
w == wolverian [EMAIL PROTECTED] writes:
w On Wed, May 25, 2005 at 07:07:02PM -0400, Uri Guttman wrote:
please don't use == for simple assignments as it will confuse too many
newbies and auch. it (and its sister ==) are for pipelining ops like
map/grep and for forcing assignment to
On 5/26/05, Juerd [EMAIL PROTECTED] wrote:
You could, if you changed the precedence of , to be tighter than =.
However, by default, = has higher precedence than ,, so that you need
parens to override this decision: @a = (1,2,3);
Is giving = a higher precedence than , still considered A Good
On 5/26/05, Stuart Cook [EMAIL PROTECTED] wrote:
my $a, $b = 1, 2; # $b should contain 2, not 1
my @foo = 3, 4, 5; # @foo should contain (3, 4, 5), not (list 3)
What justification for the status quo could be so compelling that we
feel the need to prevent both of these from doing the
37 matches
Mail list logo