Skip to content

Commit 3400415

Browse files
committed
Apply feedback by JJ++
1 parent ed15204 commit 3400415

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

20th/articles/rfc64.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Let's talk about a fun RFC that mostly did *not* make its way into current day Raku, nor is it planned for later implementation.
44

5-
This is about [RFC 64](https://raku.org/archive/rfc/64.html). Let me quote the abstract:
5+
This is about [RFC 64](https://raku.org/archive/rfc/64.html) by Nathan Wiger. Let me quote the abstract:
66

77
> Historically, Perl has had the default "everything's global" scope. This means that you must explicitly define every variable with my, our, or its absolute package to get better scoping. You can 'use strict' to force this behavior, but this makes easy things harder, and doesn't fix the actual problem.
88
>
@@ -14,12 +14,12 @@ Raku enables it by default, even for one-liners with the `-e` option, Perl 5 ena
1414

1515
I'd say the industry as a whole has moved in the direction of accepting the tiny inconvenience of having to declare variables over the massive benefit in safety and protection against typos and other errors. Hey, even javascript got a `"use strict"` and TypeScript enables it by default in modules. [PHP 7 also got something comparable](https://stackoverflow.com/questions/3193072/strict-mode-in-php). The only holdout in the "no strict" realm seems to be python.
1616

17-
But, there's always a "but", isn't there?
17+
But there's always a "but", isn't there?
1818

1919
One of the primary motivations for not wanting to declare variables was laziness, and Raku did introduce several features that allow to you avoid some declarations:
2020

2121
* Parameters in signatures are an implicit declaration, The RFC's example `sub squre` could be written in Raku simply as `sub square($x) { $x * $x }`. No explicit declaration necessary.
2222
* Self-declaring formal parameters with the `^` twigil also imply a declaration, for example `sub square { $^x * $^x }`.
23-
* There are many functional features in Raku that you can use to avoid explicit variables altogether, like meta operators, Whatever star currying etc.
23+
* There are many functional features in Raku that you can use to avoid explicit variables altogether, like [meta operators](https://docs.raku.org/language/operators#Metaoperators), [Whatever star currying](https://docs.raku.org/type/Whatever) etc.
2424

25-
I am glad Raku requires variable declarations by default, and haven't seen any code in the wild that explicitly states `no strict;. And without declarations, where would you even put the type constraint?
25+
I am glad Raku requires variable declarations by default, and haven't seen any code in the wild that explicitly states `no strict`;. And without declarations, where would you even put the type constraint?

0 commit comments

Comments
 (0)