Skip to content

Commit

Permalink
minor fixes in examples
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Lenz <moritz@faui2k3.org>
  • Loading branch information
Prakash Kailasa authored and moritz committed May 15, 2010
1 parent 71cb8c0 commit 60c5804
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/multi-dispatch.pod
Expand Up @@ -18,7 +18,7 @@ U<http://github.com/moritz/json/>.

=begin programlisting

multi to-json(Real $d) { ~$d }
multi to-json(Real $d) { ~$d }
multi to-json(Bool $d) { $d ?? 'true' !! 'false'; }
multi to-json(Str $d) {
'"'
Expand Down Expand Up @@ -115,7 +115,7 @@ case the type of the parameter defaults to C<Any>, the root of the "normal"
branch of the type hierarchy. More interestingly, the C<where {!defined $d}>
clause is
a I<constraint>, which defines a so-called I<subset type>. In this case, this
candidate will matches only I<some> values of the type C<Any> -- those where
candidate will match only I<some> values of the type C<Any> -- those where
the value is undefined.

X<nominal type>
Expand Down Expand Up @@ -240,7 +240,7 @@ more specific match in the nominal type.
multi a(Any $x where { $x > 0 }) { 'Constraint' }
multi a(Int $x) { 'Nominal type' }

say a(3), ' wins'; # says B<Nominal type>
say a(3), ' wins'; # says B<Nominal type wins>

=end programlisting

Expand Down

0 comments on commit 60c5804

Please sign in to comment.