# New Ticket Created by  Vasily Chekalkin 
# Please include the string:  [perl #60444]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60444 >


Hello.

There is attached patch which uniquefy stored eigenstates in 
'all'/'any'/'none' junctions.

-- 
Bacek
diff --git a/languages/perl6/src/classes/Junction.pir b/languages/perl6/src/classes/Junction.pir
index 5008892..9ae14e9 100644
--- a/languages/perl6/src/classes/Junction.pir
+++ b/languages/perl6/src/classes/Junction.pir
@@ -217,6 +217,12 @@ Return the components of the Junction.
     setattribute junc, '@!eigenstates', eigenstates
     .return (junc)
 .end
+
+.sub '!UNIQUEFY'
+    .param pmc eigenstates :slurpy
+    $P0 = get_hll_global 'infix:==='
+    .return eigenstates.'uniq'($P0)
+.end
     
 .sub '!DISPATCH_JUNCTION'
     .param pmc the_sub
@@ -292,11 +298,13 @@ Return the components of the Junction.
 .sub 'any'
     .param pmc args            :slurpy
     args.'!flatten'()
+    args = '!UNIQUEFY'(args)
     .tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_ANY, args)
 .end
 
 .sub 'infix:|'
     .param pmc args            :slurpy
+    args = '!UNIQUEFY'(args)
     .tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_ANY, args)
 .end
 
@@ -325,11 +333,13 @@ Return the components of the Junction.
 .sub 'all'
     .param pmc args            :slurpy
     args.'!flatten'()
+    args = '!UNIQUEFY'(args)
     .tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_ALL, args)
 .end
 
 .sub 'infix:&'
     .param pmc args            :slurpy
+    args = '!UNIQUEFY'(args)
     .tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_ALL, args)
 .end
 
@@ -342,6 +352,7 @@ Return the components of the Junction.
 .sub 'none'
     .param pmc args            :slurpy
     args.'!flatten'()
+    args = '!UNIQUEFY'(args)
     .tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_NONE, args)
 .end
 

Reply via email to