Skip to content

Commit

Permalink
Merges code and deindents
Browse files Browse the repository at this point in the history
Since there's no difference now after 6.d. Refs #2632. Also eliminates a reference to 6.d.PREVIEW refs #2687
  • Loading branch information
JJ committed Dec 23, 2019
1 parent 402e897 commit f788c9d
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions doc/Language/terms.pod6
Expand Up @@ -256,7 +256,7 @@ our constant @foo = 1, 2, 3;
I<NOTE: if you're using the Rakudo compiler, you need version 2018.08 or
newer for type constraints and auto-coercion on constants to be
available. Auto-coercion on %-sigiled constants requires 6.d>
available. Auto-coercion on %-sigiled constants requires 6.d>.
An optional type constraint can be used, in which case the use
of scope declarator is required:
Expand Down Expand Up @@ -294,26 +294,23 @@ auto-coercion of the value if it does not pass the implied typecheck.
The C<@>-sigiled constants will coerce using method L<cache|/routine/cache> and
C<%>-sigiled constants coerce using method L<Map|/type/Map>.
=begin code
constant @foo = 42;
@foo.perl.say; # OUTPUT: «(42,)»
=begin code
constant @foo = 42;
@foo.perl.say; # OUTPUT: «(42,)»
constant @bar = [<a b c>];
@bar.perl.say; # OUTPUT: «["a", "b", "c"]»
=end code
constant @bar = [<a b c>];
@bar.perl.say; # OUTPUT: «["a", "b", "c"]»
=begin code :solo
use v6.d.PREVIEW;
constant %foo = <foo bar>;
%foo.perl.say; # OUTPUT: «Map.new((:foo("bar")))»
constant %foo = <foo bar>;
%foo.perl.say; # OUTPUT: «Map.new((:foo("bar")))»
constant %bar = {:10foo, :72bar};
%bar.perl.say; # OUTPUT: «{:bar(72), :foo(10)}»
constant %bar = {:10foo, :72bar};
%bar.perl.say; # OUTPUT: «{:bar(72), :foo(10)}»
# Pair is already Associative, so it remains a Pair
constant %baz = :72baz;
%baz.perl.say; # OUTPUT: «:baz(72)»
=end code
# Pair is already Associative, so it remains a Pair
constant %baz = :72baz;
%baz.perl.say; # OUTPUT: «:baz(72)»
=end code
For convenience and consistency reasons, you can use the
L«binding operator (C<:=>)|/routine/:=» instead of the assignment operator,
Expand Down

0 comments on commit f788c9d

Please sign in to comment.