diff --git a/doc/Type/Junction.pod6 b/doc/Type/Junction.pod6 index 1866e624f..11e236dce 100644 --- a/doc/Type/Junction.pod6 +++ b/doc/Type/Junction.pod6 @@ -34,7 +34,7 @@ L|/routine/all>, L|/routine/none> or L|/routine/one> on the object. say so 3 == (1..30).one; # OUTPUT: «True␤» - say so ("a" ^ "b" ^ "c") eq "a"; # OUTPUT: «True␤» + say so ("a" ^ "b" ^ "c") eq "a"; # OUTPUT: «True␤» Autothreading happens when a junction is bound to a parameter of a code object that doesn't accept values of type C. Instead of producing an error, @@ -196,6 +196,22 @@ this case on a Junction) and the result will be a C. =head1 Methods +=head2 method new + +Defined as: + + + multi method new(Junction: \values, Str :$type!) + multi method new(Junction: Str:D \type, \values) + +Constructor to define a new Junction from the type that defines de Junction and +a set of values. + + my $j = Junction.new(<Þor Oðinn Loki>, type => "all"); + my $n = Junction.new( "one", 1..6 ) + + + =head2 method Str Defined as: @@ -237,9 +253,9 @@ Defined as: multi sub infix:<~>(Junction:D $a, Str:D $b) multi sub infix:<~>(Junction:D \a, Junction:D \b) -The infix C<~> concatenation can be used to merge junctions into a single one or merge Junctions with strings. -The resulting junction will have all elements merged as if they were -joined into a nested loop: +The infix C<~> concatenation can be used to merge junctions into a single one or +merge Junctions with strings. The resulting junction will have all elements +merged as if they were joined into a nested loop: =begin code my $odd = 1|3|5; @@ -256,7 +272,9 @@ my $postfixed = $odd ~ "1"; say "Found 11" if 11 == $postfixed; #OUTPUT: «Found 11!␤» =end code -On the other hand, the versions of C<~> that use a string as one argument will just concatenate the string to every member of the Junction, creating another Junction with the same number of elements. +On the other hand, the versions of C<~> that use a string as one argument will +just concatenate the string to every member of the Junction, creating another +Junction with the same number of elements. =head1 See Also