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

Mu should smartmatch #3460

Closed
p6rt opened this issue Jul 25, 2014 · 8 comments
Closed

Mu should smartmatch #3460

p6rt opened this issue Jul 25, 2014 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Jul 25, 2014

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

Searchable as RT122395$

@p6rt
Copy link
Author

p6rt commented Jul 25, 2014

From @coke

We have tests in S03-smartmatch/any-num.t that expect to be able to
smartmatch a Mu​:

  ok (Mu ~~ 0), 'Mu ~~ 0';
  ok !(Mu ~~ 2.3), 'Mu ~~ $other_number';

but

21​:05 < [Coke]> m​: Mu ~~ 0
21​:05 <+camelia> rakudo-moar 6cc807​: OUTPUT«Type check failed in binding
  <anon>; expected 'Any' but got 'Mu'␤ in method ACCEPTS at
  src/gen/m-CORE.setting​:1480␤ in block at /tmp/G1dWK8MLkP​:1␤␤»

and

21​:05 < [Coke]> ^^ tests expect this to work.
21​:06 < TimToady> offhand, don't see a good reason why it shoudn't
21​:07 < TimToady> m​: Mu ~~ 'foo'
21​:07 < TimToady> that too

that has a test in S03-smartmatch/any-str.t

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jul 25, 2014

From @moritz

On 07/25/2014 03​:12 AM, Will Coleda (via RT) wrote​:

# New Ticket Created by Will Coleda
# Please include the string​: [perl #​122395]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=122395 >

We have tests in S03-smartmatch/any-num.t that expect to be able to
smartmatch a Mu​:

 ok  \(Mu ~~ 0\),              'Mu ~~ 0';
 ok \!\(Mu ~~ 2\.3\),            'Mu ~~ $other\_number';

but

21​:05 < [Coke]> m​: Mu ~~ 0
21​:05 <+camelia> rakudo-moar 6cc807​: OUTPUT«Type check failed in binding
<anon>; expected 'Any' but got 'Mu'␤ in method ACCEPTS at
src/gen/m-CORE.setting​:1480␤ in block at /tmp/G1dWK8MLkP​:1␤␤»

and

21​:05 < [Coke]> ^^ tests expect this to work.
21​:06 < TimToady> offhand, don't see a good reason why it shoudn't
21​:07 < TimToady> m​: Mu ~~ 'foo'
21​:07 < TimToady> that too

that has a test in S03-smartmatch/any-str.t

If we made this work, then

1|2|3 ~~ 2

wouldn't autothread anymore.

I'm in favor of leaving things as they are, and change the test to use
Any ~~ 0 instead.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Jul 25, 2014

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 25, 2014

From @FROGGS

Is the LHS supposed to autothread?

@p6rt
Copy link
Author

p6rt commented Sep 23, 2015

From @TimToady

5a534d65ffa6277ee0ddb408f3216852e9c88edb changes things so Mu ~~ 0 and such is always false by default. In general having defined things accept undefined things is problematic.

@p6rt
Copy link
Author

p6rt commented Sep 23, 2015

From @TimToady

Mu ~~ 0 now works but will always return False, since we don't want people to start using Mu as a numeric semipredicate.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Sep 23, 2015

From @TimToady

Mu ~~ 0 now works but will always return False, since we don't want people to start using Mu as a numeric semipredicate.

@p6rt p6rt closed this as completed Sep 23, 2015
@p6rt
Copy link
Author

p6rt commented Sep 23, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant