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

deep equality and junctions #536

Closed
p6rt opened this issue Dec 25, 2008 · 10 comments
Closed

deep equality and junctions #536

p6rt opened this issue Dec 25, 2008 · 10 comments

Comments

@p6rt
Copy link

p6rt commented Dec 25, 2008

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

Searchable as RT61692$

@p6rt
Copy link
Author

p6rt commented Dec 25, 2008

From dave.whipp@gmail.com

It's seems that Rakudo's notion of equality under the "===" operator doesn't
handle junctions​:

<dwhipp> pugs​: say "yes" if 1 === 1|2
<p6eval> pugs​: OUTPUT«yes␤»
<dwhipp> rakudo​: say "yes" if 1 === 1|2
<p6eval> rakudo 34350​: RESULT«Bool​::False»

@p6rt
Copy link
Author

p6rt commented Dec 26, 2008

From @pmichaud

On Thu Dec 25 09​:36​:49 2008, dave.whipp@​gmail.com wrote​:

It's seems that Rakudo's notion of equality under the "===" operator
doesn't
handle junctions​:

<dwhipp> pugs​: say "yes" if 1 === 1|2
<p6eval> pugs​: OUTPUT«yes␤»
<dwhipp> rakudo​: say "yes" if 1 === 1|2
<p6eval> rakudo 34350​: RESULT«Bool​::False»

Now fixed in r34390, thanks!

(Note​: Jonathan is working on a new dispatcher for Rakudo that will
handle junction autothreading -- until then we have to make special MMD
entries for any operators or functions that we want to be "junction
aware". See build/gen_junctions_pir.pl.)

Pm

@p6rt
Copy link
Author

p6rt commented Dec 26, 2008

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

@p6rt
Copy link
Author

p6rt commented Dec 26, 2008

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

@p6rt
Copy link
Author

p6rt commented Dec 26, 2008

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

@p6rt
Copy link
Author

p6rt commented Dec 26, 2008

From @pmichaud

Reopening ticket (and assigning to moritz++) -- we probably need a test
for this somewhere before closing the ticket.

Thanks,

Pm

@p6rt
Copy link
Author

p6rt commented Dec 26, 2008

From @pmichaud

I had to revert the change that autothreaded infix​:<===>, as the
existing non-autothreaded version was being used to create Junctions
(and resulted in an infinite loop).

I suppose it's also a legitimate question as to whether infix​:<===>
should autothread at all -- i.e., for something like​:

  my $a = 1;
  my $b = any(1, 2, 3);

  say 'yes' if $a === $b;

there might be an argument that infix​:<===> should return false since $a
and $b have different types (one is an Int, the other a Junction). We
might need to check with p6l on this.
Pm

@p6rt
Copy link
Author

p6rt commented Dec 26, 2008

From @pmichaud

On Fri Dec 26 10​:34​:01 2008, pmichaud wrote​:

I suppose it's also a legitimate question as to whether infix​:<===>
should autothread at all [...]

18​:56 <TimToady> pmichaud​: an exact === can always be emulated by
comparing .WHICH, and I think .WHICH (being a macro) can probably return
the junction's id rather than a
  superposition of ids
18​:56 <TimToady> so === should probably autothread, but junctional logic
shouldn't be written in terms of it, except where recursion is desirable
18​:59 <pmichaud> TimToady​: makes sense, thanks.
18​:59 <pmichaud> the place where infix​:<===> was being used was to
collapse duplicate values in any,all,none junctions.
18​:59 <pmichaud> (that can of course be fixed.)

Pm

@p6rt
Copy link
Author

p6rt commented Sep 30, 2011

From @moritz

Now tested in t/spec/S03-operators/value_equivalence.t.

@p6rt
Copy link
Author

p6rt commented Sep 30, 2011

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

@p6rt p6rt closed this as completed Sep 30, 2011
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