Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operands to min aren't numified, so what are they? #764

Closed
p6rt opened this issue Mar 10, 2009 · 7 comments
Closed

Operands to min aren't numified, so what are they? #764

p6rt opened this issue Mar 10, 2009 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 10, 2009

Migrated from rt.perl.org#63778 (status was 'resolved')

Searchable as RT63778$

@p6rt
Copy link
Author

p6rt commented Mar 10, 2009

From @masak

<masak> rakudo​: my @​a = 1,2,3; say @​a min 4
<p6eval> rakudo 531ca2​: OUTPUT«Multiple Dispatch​: No suitable
candidate found for 'cmp', with signature 'PP->I' [...]
<masak> question is, is this a new one, or the same as the undef one?
<masak> I should probably file it under the same ticket.
<pmichaud> it's not the same as the undef one
<pmichaud> I'm curious about the correct behavior there, though.
<masak> pmichaud​: I'd think that min numifies, so 3.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Mar 10, 2009

From @masak

<pmichaud> anyway, S03 says that "By default C<min> and C<max> use
C<cmp> semantics." I don't think that implies numification of the arguments.
<masak> oh.
<masak> but what happens when you cmp a Num and a List?
<pmichaud> I don't know.
<pmichaud> Neither does Parrot, which is why we get "No suitable
candidate found ... " :-)
<masak> pasting this addendum to the ticket.

@p6rt
Copy link
Author

p6rt commented Mar 10, 2009

From [Unknown Contact. See original ticket]

<pmichaud> anyway, S03 says that "By default C<min> and C<max> use
C<cmp> semantics." I don't think that implies numification of the arguments.
<masak> oh.
<masak> but what happens when you cmp a Num and a List?
<pmichaud> I don't know.
<pmichaud> Neither does Parrot, which is why we get "No suitable
candidate found ... " :-)
<masak> pasting this addendum to the ticket.

@p6rt
Copy link
Author

p6rt commented Mar 10, 2009

@masak - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 27, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S03-operators/misc.t

commit 824834991801e0e2dd07f36b661c24fac8a241ab
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Mon Jul 27 15​:00​:43 2009 +0000

  [t/spec] Test for RT #​63778
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;27752 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S03-operators/misc.t b/t/spec/S03-operators/misc.t
index 9ff23d5..623dbdb 100644
--- a/t/spec/S03-operators/misc.t
+++ b/t/spec/S03-operators/misc.t
@@ -7,7 +7,7 @@ use Test;
 Tests for Synopsis 3
 =end kwid
 
-plan 60;
+plan 62;
 
 my $str1 = "foo";
 my $str2 = "bar";
@@ -158,3 +158,12 @@ ok(?(42 > 12 & 20 & 32), "test the all infix operator");
     is((@a minmax @b), (1,8), 'minmax works when both are on left array');
     is((@b minmax @a), (1,8), 'minmax works when both are on right array');
 }
+
+# RT #63778
+{
+    my @a = 1, 2, 3;
+    #?rakudo todo 'RT #63778'
+    lives_ok { @a min 4 }, 'lives: @array min 4';
+    #?rakudo skip 'RT #63778'
+    is @a min 4, 1, 'works: @array min 4';
+}

@p6rt
Copy link
Author

p6rt commented Dec 30, 2012

From @moritz

I've opened a spec issues for this at
Raku/old-design-docs#28 and now close the rakudobug.

@p6rt
Copy link
Author

p6rt commented Dec 30, 2012

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Dec 30, 2012
@p6rt p6rt added the spec label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant