Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
language cleanups and spurious wordings.
* I'm not sure we need buzzword lingo when talking about perl6
* WIP - with tablet 2.
  • Loading branch information
s-h-r-i committed May 7, 2012
1 parent 66fc254 commit de4db14
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
3 changes: 3 additions & 0 deletions docs/tablet-1-language-design.txt
Expand Up @@ -142,6 +142,9 @@ oriented, functional, design by contract, declarative and logic
programming paradigms.


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

Buzzword compliant
------------------
Expand Down
42 changes: 29 additions & 13 deletions docs/tablet-2-basic-syntax.txt
Expand Up @@ -5,7 +5,7 @@
> 2nd law of language redesign: Larry gets the
> colon for whatever he wants."

Basics doesn't mean here not always easy but fundamental.
Basics don't always mean easy, but fundamental.

Defaults
========
Expand All @@ -20,16 +20,15 @@ or just start with a keyword like **module** or **class**. That marks
your code as Perl 6 (in case the interpreter defaults to Perl 5) and
makes it possible to mix Perl 5 and 6 in one source file.

To even that little obstacle, you can leave out the usual `use
strict;` and `use warnings;` in front of every script, because thats
now default. Also `use utf8;` is obsolete since any Perl 6 source code
is always treated as UTF-8 and any Unicode character can be used
anywhere in the code. Even the features of the pragmas `constant` and
`vars` are now part of the core language.
Where you had to include `use strict;` and `use warnings;` at the top
of every perl5 script, it's now default in perl6. Also `use utf8;` is
obsolete since any Perl 6 source code is always treated as UTF-8 and
any Unicode character can be used anywhere in the code. Even pragmas
such as `constants` and `vars` are now part of the core language.

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

Expand All @@ -40,7 +39,7 @@ Statements

Unless you use [blocks](blocks.html), a Perl program executes one
statement after another in linear progression (from left to right,
from up to down). They have to be separated by a semicolon (**;**),
top down). They have to be separated by a semicolon (**;**),
except before and after a closing curly brace, where it is optional.

$coderef = sub { fetch_data(); compute() }
Expand All @@ -50,14 +49,31 @@ except before and after a closing curly brace, where it is optional.
Spaces and Indentation
======================

Perl doesn't care about indentation. Otherwise, in several place Perl 6 cares
about existence of whitespace as a disambiguator.
Perl doesn't care about indentation, but it does care about whitespace
as a disambiguator. For example, `$foo$bar` is a syntax error since that
has two terms in a row without any whitespace to tell them apart. There's
a new addition in perl6, the so called "unspace" operator. It is basically
an instruction to the compiler's lexer that it should ignore whitespace there.
In other words, the lexer doesn't consider those whitespaces at all.

my %hash = "foo" => 42, "bar" => 84;
say %hash \{"foo"}; # Same as saying %hash{"foo"}

my $clazz = new Camel;
$clazz\#some random comment
.drink(); # same as saying $clazz.drink();

#or even
$clazz\#`{some random multiline
comment`}.drink(); # which brings us to the next section...




Comments
========



Single Line
-----------

Expand Down Expand Up @@ -140,7 +156,7 @@ An extended delimiter mechanism is delivered by [heredocs](#heredocs).
Interpolation
-------------

Inside of these delimiters, every character will be taken
Within these delimiters, every character will be taken
literally. Any additional meaning has to be added by [quoting
adverbs](ap-b-lookup.html#quoting-adverbs) that have to
follow the Q. Most of them have a short and a long name and some of
Expand Down

0 comments on commit de4db14

Please sign in to comment.