Skip to content

Commit 43c8bc0

Browse files
committed
Merge pull request #9 from svatsan/svatsan
thank you very much
2 parents 6b69705 + 5c61f5d commit 43c8bc0

File tree

2 files changed

+53
-30
lines changed

2 files changed

+53
-30
lines changed

docs/tablet-1-language-design.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ oriented, functional, design by contract, declarative and logic
142142
programming paradigms.
143143

144144

145+
<!-- I'm not sure this should be seen here as part of language design docs.
146+
Our major goal here is to put perl6 in the best possible light. This seems to
147+
be talking managerese -->
145148

146149
Buzzword compliant
147150
------------------

docs/tablet-2-basic-syntax.txt

Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> "1st law of language redesign: Everyone wants the colon for their particular syntax.
44
> 2nd law of language redesign: Larry gets the colon for whatever he wants."
55

6-
Basics doesn't mean here not always easy but rather fundamental.
6+
Basics don't always mean easy, but fundamental.
77

88
Defaults
99
========
@@ -19,45 +19,64 @@ or [**class**](appendix-a-index.html#class). That marks your code as Perl 6
1919
(in case the interpreter defaults to Perl 5) and makes it possible to mix
2020
Perl 5 and 6 in one source file.
2121

22-
To even that little obstacle, you can leave out the usual `use strict;` and
23-
`use warnings;` in front of every script, because that is now the default.
24-
Also `use utf8;` is obsolete since any Perl 6 source code is always treated
25-
as UTF-8 and any [*unicode*](appendix-g-glossary.html#unicode) character can
26-
be used anywhere in the code. Even the features of the pragmas `constant` and
27-
`vars` are now part of the core language.
22+
Where you had to include `use strict;` and `use warnings;` at the top
23+
of every perl5 script, it's now default in perl6. Also `use utf8;` is
24+
obsolete since any Perl 6 source code is always treated as UTF-8 and
25+
any [*unicode*](appendix-g-glossary.html#unicode) character can be used
26+
anywhere in the code. Even pragmas such as `constants` and `vars` are
27+
now part of the core language.
2828

2929
Also the functionality of many useful and famous modules like Moose
3030
(object system), Parse::RecDescent++, exception handling,
31-
List::\[More\]Utils, Export, English an advanced pretty printer and
32-
much more is already built in. So you get a lot extra for a little **v6;**.
33-
31+
List::\[More\]Utils, Export, English, an advanced pretty printer and
32+
much more is already built in. So you get a lot extra for a little
33+
**v6;**.
3434

3535

3636
Statements
3737
==========
3838

39-
Unless you use [*blocks*](appendix-g-glossary.html#block), a Perl program
40-
executes one statement after another in linear progression (from left to right,
41-
from up to down). They have to be separated by a
42-
semicolon ([**;**](appendix-a-index.html#semicolon-terminator)),
43-
except before and after a closing curly brace, where it is optional, always.
39+
Unless you use [*blocks*](appendix-g-glossary.html#block), a Perl
40+
program executes one statement after another in linear progression
41+
(from left to right, top down). They have to be separated by
42+
a semicolon (**;**), except before and after a closing curly brace,
43+
where it is optional.
4444

4545
$coderef = sub { fetch_data(); compute() }
4646

4747

4848
Spaces and Indentation
4949
======================
5050

51-
Perl doesn't care about indentation. Otherwise, in several place Perl 6 cares
52-
about existence of whitespace as a disambiguator.
51+
Perl doesn't care about indentation, but it does care about whitespace
52+
as a disambiguator. For example, `$foo$bar` is a syntax error since that
53+
has two terms in a row without any whitespace to tell them apart. There's
54+
a new addition in perl6, the so called "unspace" operator. It is basically
55+
an instruction to the compiler's lexer that it should ignore whitespace there.
56+
In other words, the lexer doesn't consider those whitespaces at all.
57+
58+
my %hash = "foo" => 42, "bar" => 84;
59+
say %hash \{"foo"}; # Same as saying %hash{"foo"}
60+
61+
my $clazz = new Camel;
62+
$clazz\#some random comment
63+
.drink(); # same as saying $clazz.drink();
64+
65+
#or even
66+
$clazz\#`{some random multiline
67+
comment`}.drink(); # which brings us to the next section...
68+
69+
70+
71+
72+
...$var []
5373

5474
...$var []
5575

5676
Comments
5777
========
5878

5979

60-
6180
Single Line
6281
-----------
6382

@@ -140,7 +159,7 @@ An extended delimiter mechanism is delivered by [heredocs](#heredocs).
140159
Interpolation
141160
-------------
142161

143-
Inside of these delimiters, every character will be taken
162+
Within these delimiters, every character will be taken
144163
literally. Any additional meaning has to be added by [quoting
145164
adverbs](appendix-b-grouped.html#quoting-adverbs) that have to
146165
follow the Q. Most of them have a short and a long name and some of
@@ -154,12 +173,12 @@ altogether with the Q operator (like single or double quotes).
154173
:c aka :closure # anonymous blocks: {...}
155174
:f aka :function # callable routines: &name(...)
156175

157-
For more info on those, see [scalar
158-
variable](ap-b-lookup.html#scalar), [array
159-
variable](ap-b-lookup.html#array), [hash
160-
variable](ap-b-lookup.html#hash), [anonymous
161-
blocks](tablet-6-blocks.html), and [callable
162-
routines](tablet-3-variables.html#callable).
176+
For more info on those, see
177+
* [scalar variable](ap-b-lookup.html#scalar),
178+
* [array variable](ap-b-lookup.html#array),
179+
* [hash variable](ap-b-lookup.html#hash),
180+
* [anonymous blocks](tablet-6-blocks.html), and
181+
* [callable routines](tablet-3-variables.html#callable).
163182

164183
Q :b /\t\n/; # tab and new line character
165184
Q :s /$poem/; # content of $poem
@@ -200,10 +219,11 @@ following are synonyms:
200219
'...'
201220

202221

203-
The backslash (\\) here is only required to delimite itself and
204-
the single quote from its special meaning. Or to put it simply \\\\
205-
translates (or interpolates) to \\ and \\' to '. For anything more
206-
you need additional adverbs.
222+
We sometimes use the backslash (\\) to escape other special characters
223+
or the backslash itself. These are all part of the family of characters
224+
known as /escape sequences/. For example, `\\\\` translates to `\\`, while
225+
`\\'` translates to a `'`. You can avoid all that extra typing by using
226+
adverbs.
207227

208228
'Welcome in Larry\'s madhouse'
209229
'\'\\'; # string contains: '\
@@ -248,7 +268,7 @@ The second group of aliases mark a modified version, where single and
248268
double quoted strings (inside the quote) are treated as one
249269
word. This is called *quote* protection.
250270

251-
my @steps = <one "two three">; # 3 steps to success: ["one", "\"two", "three\""]
271+
my @steps = <one "two three">; # 3 steps to success: ["one", "\"two", "three\""]
252272
my @steps = <<one "two three">>; # now only 2 steps: ["one", "two three"]
253273

254274

0 commit comments

Comments
 (0)