[perl6/specs] 13a275: sets and bags don't flatten in list context

2013-02-09 Thread GitHub
-setting-library/Containers.pod Log Message: --- sets and bags don't flatten in list context

Re: "&&" in list context

2009-09-30 Thread Larry Wall
On Tue, Sep 29, 2009 at 03:49:31PM +0200, Christoph Bussenius wrote: : Hi, : : I read is S03, : : The && and || operators are smarter about list context and return () : on failure in list context rather than Bool::False. The operators : still short-circuit, but if either

"&&" in list context

2009-09-29 Thread Christoph Bussenius
Hi, I read is S03, The && and || operators are smarter about list context and return () on failure in list context rather than Bool::False. The operators still short-circuit, but if either operator would return a false value, it is converted to the null list in list co

Re: User-defined behaviour of hashes in list context

2005-07-20 Thread TSa (Thomas Sandlaß)
HaloO Ingo, you wrote: according to Damian [1]...: my %hash = (a => 1, b => 2); my @array = %hash; say @array[0].isa(Pair); # true How can I override this behaviour? class MyHash is Hash { # Please fill in here # my idea is to overload &*infix:<=>

User-defined behaviour of hashes in list context

2005-07-20 Thread Ingo Blechschmidt
Hi, according to Damian [1]...: my %hash = (a => 1, b => 2); my @array = %hash; say @array[0].isa(Pair); # true How can I override this behaviour? class MyHash is Hash { # Please fill in here } my %hash is MyHash = (a => 1, b => 2); my @array = %h

Re: Revisiting .chars (and friends) in list context

2005-06-03 Thread Stuart Cook
On 6/3/05, Joshua Gatcomb <[EMAIL PROTECTED]> wrote: > What I would like to be able to do is: > > my $str = 'hello'; > my @chars = $str.chars; # I can't see this being a problem at all. For starters, the whole "what is a character" issue is just as relevant to +($foo.chars) as it is to list($foo

Revisiting .chars (and friends) in list context

2005-06-02 Thread Joshua Gatcomb
All: I would like to revisit the following question as there was no decision reached AFAICT. http://groups.google.ca/group/perl.perl6.language/browse_thread/thread/766c1b32c57a56f6/3296f0d6cad75548?q=list+context+.chars&rnum=1&hl=en#3296f0d6cad75548 What I would like to be able to do is: my $str

Re: s/// in list context

2002-09-23 Thread John Williams
r as the perl5 s/// return value. (Actually s/// returns "" on no matches now, whereas $0 would evaluate to false or 0 depending on context, but I doubt that would be a serious compatibility issue.) And getting the matching values before substition was done is a bonus in list context. ~ John Williams

s/// in list context

2002-09-08 Thread Nicholas Clark
I realise that it's almost 2 years since the RFC deadline, plus we're several apocolypses past the appropriate Camel chapters. IIRC there are 5 different variants of m// normal /g scalar context: match from startcontinue progressive match

Re: RFC 82 (listops in list context)

2000-08-17 Thread Nathan Torkington
Chaim Frenkel writes: > The other magic variables would simply end up as some funny 8-bit > characters floating around. With one's handy (several thousand page) > translation table one can then interpret the meaning. That's insane. We're trying to get rid of special variables named after obscure

Re: RFC 82 (listops in list context)

2000-08-16 Thread Chaim Frenkel
> "NT" == Nathan Torkington <[EMAIL PROTECTED]> writes: NT> Chaim Frenkel writes: >> [use wacky Unicode characters for new operators] >> I can see that this would give problems for current editors and displays, >> but by the time perl6 comes out, perhaps the situation would be better. NT> No

Re: RFC 82 (listops in list context)

2000-08-16 Thread Nathan Torkington
Peter Scott writes: > >You're right. If RFC 45 is implemented they would however be inconsistent. > > No, || is half-consistent at the moment: the left hand side is forced into > scalar context but the result context propagates down the right hand > side. I challenge anyone to come up with a r

Re: RFC 82 (listops in list context)

2000-08-16 Thread Nathan Torkington
Chaim Frenkel writes: > [use wacky Unicode characters for new operators] > I can see that this would give problems for current editors and displays, > but by the time perl6 comes out, perhaps the situation would be better. No. Never ever gamble on the future being better than the present. Don't

Re: RFC 82 (listops in list context)

2000-08-16 Thread Glenn Linderman
Chaim Frenkel wrote: > Would Unicode reduce the problem? Take some operators from the math symbols > and make them the matrix op versions? > > (Now, if we add all that APL symbols ...) Chaim, I think you are on to something here. But before jumping to Unicode or APL to get more line noise, let'

Re: RFC 82 (listops in list context)

2000-08-16 Thread Chaim Frenkel
(Not feasible yet, but...) Would Unicode reduce the problem? Take some operators from the math symbols and make them the matrix op versions? Then the 'ascii' versions would remain the scalar ops. I can see that this would give problems for current editors and displays, but by the time perl6 com

Re: RFC 82 (listops in list context)

2000-08-15 Thread Damien Neil
On Tue, Aug 15, 2000 at 11:15:03PM -0700, Peter Scott wrote: > No, || is half-consistent at the moment: the left hand side is forced into > scalar context but the result context propagates down the right hand > side. I challenge anyone to come up with a rationalization for this that > does not

Re: RFC 82 (listops in list context)

2000-08-15 Thread Peter Scott
At 04:02 PM 8/16/00 +1000, Jeremy Howard wrote: >Nathan Torkington wrote: > > Your [Jeremy's] RFC says: > > > Currently, operators applied to lists in a list context behave > > > counter-intuitively: > > > > Counter-intuitively is different from consistently. Your title is > > misleading. Perl's

Re: RFC 82 (listops in list context)

2000-08-15 Thread Jeremy Howard
Nathan Torkington wrote: > Your [Jeremy's] RFC says: > > Currently, operators applied to lists in a list context behave > > counter-intuitively: > > Counter-intuitively is different from consistently. Your title is > misleading. Perl's ops *are* applied consistently: they consistently > give the

RFC 82 (listops in list context)

2000-08-15 Thread Nathan Torkington
lem. This code would result in func1 and func2 being called in list context. You've got an addition in list context (thanks to the assignment), and that would put func1() and func2() into list context. + wouldn't look to its arguments to decide what to do. + would look at its contex

Re: RFC 82 (scalar ops consistent in list context)

2000-08-15 Thread Nathan Torkington
same language? Both are useful, but in different situations. How about: use matrix_ops; to enable this 'consistent' behaviour of the binary ops in list context? Nat