Skip to content

Commit

Permalink
Prescription for a particular form of declaring hashes eliminated
Browse files Browse the repository at this point in the history
The tally was 6 votes for this option, 3 for not touching it, 4 for
changing to {} (from %()). So, eliminated and closes #2117.
  • Loading branch information
JJ committed Jun 26, 2018
1 parent 4f18e4e commit e232c38
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions writing-docs/STYLEGUIDE.md
Expand Up @@ -135,18 +135,6 @@ All operators have a ASCII equivalent, but they are more verbose and
do not correspond exactly to the mathematical operator or constant
they often represent. Please use that syntax whenever possible.

### Prefer the %() form of declaring hashes

my %hash := { this => "is", a => "hash" }; # Correct, but BAD
my %hash := %( this => "is", a => "hash" ); # GOOD

Using the second form is more idiomatic and avoids confusion with
blocks. In fact, you don't need to use `:=` in the second sentence,
precisely for this reason. This does not apply to empty hashes, which
should be declared using `{}`:

my %hash = {};

### Try to express intent, rather than simply reflex syntax

my @l = lazy 0..5; # Correct, but BAD
Expand Down

0 comments on commit e232c38

Please sign in to comment.