[perl #128758] Reduce with numeric ops does not numify things if only one arg is passed ([*] set(1,2,3))

2018-03-26 Thread Jan-Olof Hendig via RT
On Sun, 25 Mar 2018 08:43:30 -0700, jan-olof.hen...@bredband.net wrote: > On Thu, 29 Jun 2017 12:50:43 -0700, sml...@gmail.com wrote: > > It looks like this bug hasn't been *completely* fixed: > > > > dd &infix:<+>( "2" ); # 2 > > dd &infix:<*>( "2" ); # 2 > > > > dd [*] "2";

[perl #128758] Reduce with numeric ops does not numify things if only one arg is passed ([*] set(1,2,3))

2018-03-25 Thread Jan-Olof Hendig via RT
On Thu, 29 Jun 2017 12:50:43 -0700, sml...@gmail.com wrote: > It looks like this bug hasn't been *completely* fixed: > > dd &infix:<+>( "2" ); # 2 > dd &infix:<*>( "2" ); # 2 > > dd [*] "2"; # 2 > dd [+] "2"; # 2 > > dd reduce &infix:<*>, "2"; # 2 > d

[perl #128758] Reduce with numeric ops does not numify things if only one arg is passed ([*] set(1,2,3))

2017-06-29 Thread Sam S. via RT
It looks like this bug hasn't been *completely* fixed: dd &infix:<+>( "2" ); # 2 dd &infix:<*>( "2" ); # 2 dd [*] "2"; # 2 dd [+] "2"; # 2 dd reduce &infix:<*>, "2"; # 2 dd reduce &infix:<+>, "2"; # "2" i.e. it doesn't work w

[perl #130439] [REGRESSION] splice no longer attempts to numify things (@a.splice: ^3)

2017-01-20 Thread Zoffix Znet via RT
The original fix was reverted in https://github.com/rakudo/rakudo/commit/121e5e32e9 per discussion https://irclog.perlgeek.de/perl6-dev/2017-01-21#i_13962511

[perl #130439] [REGRESSION] splice no longer attempts to numify things (@a.splice: ^3)

2016-12-29 Thread Zoffix Znet via RT
FWIW, my math[^1] suggests with current system we'd need 22 more candidates to handle Cool, bringing the total to 52 candidates. IMO Cool candidates are important to have, perhaps we can de-optimize something that won't have a huge performance hit, while reducing the candidates to saner levels?

[perl #130439] [REGRESSION] splice no longer attempts to numify things (@a.splice: ^3)

2016-12-29 Thread via RT
# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev # Please include the string: [perl #130439] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=130439 > Code: my @a = ; say @a.splice: ^3 Result (2015.12,2016.07.1): [d e f

[perl #130288] [LTA] [REGRESSION] xx no longer produces a nice message if unable to numify a string (42 xx ‘123abc’)

2016-12-07 Thread Zoffix Znet via RT
On Tue, 06 Dec 2016 19:00:22 -0800, alex.jakime...@gmail.com wrote: > Code: > say 42 xx ‘123abc’ > > Result (2016.06): > Cannot convert string to number: trailing characters after number in > '123abc' (indicated by ) > in block at /tmp/vENGo0kTCa line 1 > > Actually thrown at: > in block at

[perl #130288] [LTA] [REGRESSION] xx no longer produces a nice message if unable to numify a string (42 xx ‘123abc’)

2016-12-06 Thread via RT
# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev # Please include the string: [perl #130288] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=130288 > Code: say 42 xx ‘123abc’ Result (2016.06): Cannot convert string to

Re: [perl #128758] Reduce with numeric ops does not numify things if only one arg is passed ([*] set(1,2,3))

2016-07-27 Thread Elizabeth Mattijsen
Hmmm…. in RT #128757 you expect a single value to return identity, and here you expect it not to return it? By the same reasoning that [/] “hello” returns “hello”, I think [*] set(1,2,3) should return set(1,2,3). Or am I missing something? > On 27 Jul 2016, at 23:29, Aleks-Daniel Jakimenko-Al

[perl #128758] Reduce with numeric ops does not numify things if only one arg is passed ([*] set(1,2,3))

2016-07-27 Thread via RT
# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev # Please include the string: [perl #128758] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=128758 > Code: say [*] set(1,2,3), set(4,5,6) Result: 9 OK, that ↑ makes sen

[perl #76294] [BUG] Can't implicitly numify Failure in Rakudo

2015-07-09 Thread Will Coleda via RT
On Mon Mar 16 13:13:35 2015, elizabeth wrote: > > On 16 Mar 2015, at 18:50, Christian Bartolomaeus via RT > comm...@bugs6.perl.org> wrote: > > $ perl6 -e 'say "abcd".index("xyz") == 0' > > Invocant requires an instance, but a type object was passed > > in method Bridge at src/gen/m-CORE.setting:5

Re: [perl #76294] [BUG] Can't implicitly numify Failure in Rakudo

2015-03-16 Thread Elizabeth Mattijsen
> On 16 Mar 2015, at 18:50, Christian Bartolomaeus via RT > wrote: > $ perl6 -e 'say "abcd".index("xyz") == 0' > Invocant requires an instance, but a type object was passed > in method Bridge at src/gen/m-CORE.setting:5603 > in sub infix:<==> at src/gen/m-CORE.setting:5521 > in block at -e:1

[perl #76294] [BUG] Can't implicitly numify Failure in Rakudo

2015-03-16 Thread Christian Bartolomaeus via RT
Now all three commands complain about a type object being passed when an instance is required: $ perl6 -e 'say +Failure' Invocant requires an instance, but a type object was passed in method Numeric at src/gen/m-CORE.setting:15733 in block at -e:1 $ perl6 -e 'say "abcd".index("xyz") == 0' I

[perl #76294] [BUG] Can't implicitly numify Failure in Rakudo

2012-10-20 Thread Will Coleda via RT
On Mon Sep 19 21:43:52 2011, coke wrote: > On Wed Jun 30 07:48:56 2010, masak wrote: > > rakudo: say "abcd".index("xyz") == 0 > > rakudo aa015a: OUTPUT�Method 'Bridge' not found for invocant > > of class 'Failure' [...] > > arnsholt: possible issue :) > > * masak submits rakudobug > > rakudo: F

[perl #105116] Can't numify a string containing a radix-form number with fraction.

2011-12-01 Thread via RT
# New Ticket Created by Will Coleda # Please include the string: [perl #105116] # in the subject line of all future correspondence about this issue. # https://rt.perl.org:443/rt3/Ticket/Display.html?id=105116 > 09:35 < [Coke]> nom: say +":16" 09:35 <+p6eval> nom 17a235: OUTPUT«3735928559␤» 09

[perl #76294] [BUG] Can't implicitly numify Failure in Rakudo

2011-09-19 Thread Will Coleda via RT
On Wed Jun 30 07:48:56 2010, masak wrote: > rakudo: say "abcd".index("xyz") == 0 > rakudo aa015a: OUTPUT�Method 'Bridge' not found for invocant > of class 'Failure' [...] > arnsholt: possible issue :) > * masak submits rakudobug > rakudo: Failure == 0 > rakudo aa015a: OUTPUT�Method 'Bridge' no

[perl #85514] [BUG] Infinite recursion when trying to numify a sub in Rakudo

2011-03-06 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #85514] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=85514 > rakudo: +sub {} rakudo bd134e: OUTPUT«maximum recursion depth exceeded␤ in 'Cool::Num

[perl #76294] [BUG] Can't numify Failure in Rakudo

2010-07-01 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #76294] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=76294 > rakudo: say "abcd".index("xyz") == 0 rakudo aa015a: OUTPUT«Method 'Bridge' not found f

[perl #64360] [PATCH] Add get_number method to Object.pir to allow classes to numify

2009-04-02 Thread via RT
# New Ticket Created by Cory Spencer # Please include the string: [perl #64360] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=64360 > The attached patch allows Perl 6 classes to numify via a Num multi method like

[perl #63778] Rakudo doesn't numify operands to min

2009-03-10 Thread Carl Mäsak via RT
anyway, S03 says that "By default C and C use C semantics." I don't think that implies numification of the arguments. oh. but what happens when you cmp a Num and a List? I don't know. Neither does Parrot, which is why we get "No suitable candidate found ... " :-) pasting this addendum to the

[perl #63778] Rakudo doesn't numify operands to min

2009-03-10 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #63778] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=63778 > rakudo: my @a = 1,2,3; say @a min 4 rakudo 531ca2: OUTPUT«Multiple Dispatch: No suitab

[perl #61628] Null PMC access when trying to numify Whatever stars in Rakudo

2008-12-24 Thread Carl Mäsak
[...] * masak cackles evilly * masak submits rakudobug I imagine it's an error to try to numify a Whatever star. But perhaps not that error.

Re: What does a Pair numify to?

2008-12-16 Thread Moritz Lenz
Jon Lang wrote: > That's a good point. Is there an easy way to distinguish between > passing a pair into a positional parameter vs. passing a value into a > named parameter? Off the top of my head, see S06 for the gory details: my $pair = a => 'b'; named(a => 'b'); named(:a); named(|$pair);

Re: What does a Pair numify to?

2008-12-16 Thread Jon Lang
Moritz Lenz wrote: > Off the top of my head, see S06 for the gory details: > > my $pair = a => 'b'; > > named(a => 'b'); > named(:a); > named(|$pair); > > positional((a => 'b')); > positional((:a)); > positional($pair); As you say: the gory details, emphasis on gory. But if that's the way of thin

Re: What does a Pair numify to?

2008-12-16 Thread Jon Lang
TSa wrote: > I see no problem as long as say gets a pair as argument. Then it can > print the key and value separated with a tab. More problematic are > string concatenations of the form > > say "the pair is: " ~ (foo => $bar); > > which need to be written so that say sees the pair > > say "the

Re: What does a Pair numify to?

2008-12-16 Thread TSa
HaloO, Moritz Lenz wrote: The counter example is if you want to print a pair: .say for %hash.pairs.sort: { .value }; In that case it would be nice to have the key appear in the stringification. I see no problem as long as say gets a pair as argument. Then it can print the key and value separ

Re: What does a Pair numify to?

2008-12-16 Thread Jon Lang
On Mon, Dec 15, 2008 at 10:26 PM, Larry Wall wrote: > On Mon, Dec 15, 2008 at 04:43:51PM -0700, David Green wrote: >> I can't really think of a great example where you'd want to numify a >> pair, but I would expect printing one to produce something like "a => >

Re: What does a Pair numify to?

2008-12-16 Thread Larry Wall
On Mon, Dec 15, 2008 at 04:43:51PM -0700, David Green wrote: > I can't really think of a great example where you'd want to numify a > pair, but I would expect printing one to produce something like "a => > 23" (especially since that's what a one-element

Re: What does a Pair numify to?

2008-12-15 Thread Moritz Lenz
mark.a.big...@comcast.net wrote: > -- Original message -- > From: Larry Wall >> On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote: >> > My idea is to let a pair numify to whatever the value numifies to. >> > Same thing with strin

Re: What does a Pair numify to?

2008-12-15 Thread Moritz Lenz
Larry Wall wrote: > On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote: >> HaloO, >> >> Carl Mäsak wrote: >>> Pugs and Elf currently numify a Pair object to 2, and Rakudo currently >>> dies of despair. >>> >>> My guess is that the sema

Re: What does a Pair numify to?

2008-12-15 Thread David Green
ble either, since it's easy to coerce stuff to strings if that's what you want. I guess you could force complaining with: infix:(Any, Any) = { die "Apples and oranges!" } When are you going to be asked to stringify or numify a Pair? Actual use-cases, please. Perso

Re: What does a Pair numify to?

2008-12-15 Thread Jon Lang
nges. When are you going to be asked to stringify or numify a Pair? Actual use-cases, please. Personally, I can't think of any. -- Jonathan "Dataweaver" Lang

Re: What does a Pair numify to?

2008-12-15 Thread Uri Guttman
>>>>> "mab" == mark a biggar writes: mab> -- Original message -- mab> From: Larry Wall >> On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote: >> > My idea is to let a pair numify to whatever the value numif

Re: What does a Pair numify to?

2008-12-15 Thread mark . a . biggar
-- Original message -- From: Larry Wall > On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote: > > My idea is to let a pair numify to whatever the value numifies to. > > Same thing with stringification. In general I think that a pair should > >

Re: What does a Pair numify to?

2008-12-15 Thread Larry Wall
On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote: > HaloO, > > Carl Mäsak wrote: >> Pugs and Elf currently numify a Pair object to 2, and Rakudo currently >> dies of despair. >> >> My guess is that the semantics of Pugs and Elf falls out naturally >> for

Re: What does a Pair numify to?

2008-12-11 Thread TSa
HaloO, Carl Mäsak wrote: Pugs and Elf currently numify a Pair object to 2, and Rakudo currently dies of despair. My guess is that the semantics of Pugs and Elf falls out naturally form a pair being treated as a list of two elements, or something. The question still deserves to be raised

What does a Pair numify to?

2008-12-11 Thread Carl Mäsak
Pugs and Elf currently numify a Pair object to 2, and Rakudo currently dies of despair. My guess is that the semantics of Pugs and Elf falls out naturally form a pair being treated as a list of two elements, or something. The question still deserves to be raised whether always-2 is a good

Re: Numify

2008-11-06 Thread Patrick R. Michaud
On Thu, Nov 06, 2008 at 01:22:24AM -0600, Chris Dolan wrote: > Currently, you can overload number context by creating a __get_number() > method and boolean context via __get_bool(). Should there be an > analogous Num() and Bool() method on Object? Would it Num() return 0 by > default? And a

Re: Numify

2008-11-06 Thread jerry gay
On Wed, Nov 5, 2008 at 23:22, Chris Dolan <[EMAIL PROTECTED]> wrote: > In "[perl #60350] [TODO] default __get_string method", Patrick added a > default Object.Str() that classes can override to get custom > stringification. Formerly, you could do that only by defining a method > named __get_string

Numify

2008-11-05 Thread Chris Dolan
In "[perl #60350] [TODO] default __get_string method", Patrick added a default Object.Str() that classes can override to get custom stringification. Formerly, you could do that only by defining a method named __get_string(). Currently, you can overload number context by creating a __get_nu

Re: Object Numify/Stringify-ing to Unique values

2005-05-14 Thread Larry Wall
On Sat, May 14, 2005 at 02:57:53PM +0200, Leopold Toetsch wrote: : If we want some interoperbility with Python dicts, hashing will not be : done on ids but on the hash function of the type. Which Perl could default to id. Larry

Re: Object Numify/Stringify-ing to Unique values

2005-05-14 Thread Leopold Toetsch
Autrijus Tang <[EMAIL PROTECTED]> wrote: > What does unboxed values return for their "id", though? > 3 =:= 3; # always true? > 3.id ~~ 3.id; # ditto? Maybe true or not, that's highly implementation dependent. I'd not touch these internals: $ python Python 2.4 [...] >>> id(2) ==

Re: Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Larry Wall
On Sat, May 14, 2005 at 10:54:34AM +0800, Autrijus Tang wrote: : On Fri, May 13, 2005 at 07:28:03PM -0700, Larry Wall wrote: : > That's what .id is supposed to do, without the bogus numorstringification : > semantics. It should return something opaque that matches with ~~. : : Okay, implemented a

Re: Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Autrijus Tang
On Fri, May 13, 2005 at 07:28:03PM -0700, Larry Wall wrote: > That's what .id is supposed to do, without the bogus numorstringification > semantics. It should return something opaque that matches with ~~. Okay, implemented as such. What does unboxed values return for their "id", though? 3 =

Re: Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Larry Wall
On Fri, May 13, 2005 at 09:47:52PM -0400, Stevan Little wrote: : Hello all. : : In the processing of working with mugwump's shiny new perl6 OO Set.pm. : I realized that we do not currently have a way to uniquely identify : objects in Pugs like the way we have in perl5 (object stringification).

Re: Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Yuval Kogman
On Fri, May 13, 2005 at 21:47:52 -0400, Stevan Little wrote: > Hello all. > > In the processing of working with mugwump's shiny new perl6 OO Set.pm. I > realized that we > do not currently have a way to uniquely identify objects in Pugs like the way > we have in > perl5 (object stringification

Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Stevan Little
Hello all. In the processing of working with mugwump's shiny new perl6 OO Set.pm. I realized that we do not currently have a way to uniquely identify objects in Pugs like the way we have in perl5 (object stringification). So I asked Autrijus, and he promptly implemented a rudimentary object num