Skip to content

Commit

Permalink
Merge pull request #518 from Coleoid/master
Browse files Browse the repository at this point in the history
Typos, grammar, etc.
  • Loading branch information
AlexDaniel committed May 16, 2016
2 parents 0d9dc28 + 9c6a4a7 commit d4d0a0b
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 99 deletions.
21 changes: 9 additions & 12 deletions doc/Language/classtut.pod
Expand Up @@ -271,14 +271,13 @@ example) will not repeat the task.
=head2 Private Methods
Analogous to attributes methods can be private. Private methods are declared
Analogous to attributes, methods can be private. Private methods are declared
with a prefixed exclamation mark. They are called with C<self!> followed by the
methods name. To call a private method of another class the calling class has
method's name. To call a private method of another class the calling class has
to be trusted by the called class. A trust relationship is declared with
C<trusts> and the to be trusted class has to be declared already. Calling a
private methods of another class requires an instance of that class and the
fully qualified name of the method. Trust also applies to accessor methods of
private attributes.
C<trusts> and the class to be trusted must already be declared. Calling a
private method of another class requires an instance of that class and the
fully qualified name of the method. Trust also allows access to private attributes.
class B {...}
Expand Down Expand Up @@ -312,7 +311,7 @@ X<|constructors>
Perl 6 is rather more liberal than many languages in the area of
constructors. A constructor is anything that returns an instance of the
class. Furthermore, constructors are ordinary methods. You inherit a
default constructor named C<new> from the base class C<Object>, but you are
default constructor named C<new> from the base class C<Mu>, but you are
free to override C<new>, as this example does:
method new(&callback, *@dependencies) {
Expand Down Expand Up @@ -512,10 +511,8 @@ As mentioned before, a class can inherit from multiple classes. When a
class inherits from multiple classes the dispatcher knows to look at both
classes when looking up a method to search for. Perl 6 uses the C3
algorithm to linearize multiple inheritance hierarchies, which is a
significant improvement over Perl 5's approach to handling multiple
inheritance.
=comment isn't Perl 5 also C3 now?
significant improvement over Perl 5's default approach
(depth-first search) to handling multiple inheritance.
=begin code
class GeekCook is Programmer is Cook {
Expand Down Expand Up @@ -592,7 +589,7 @@ called on C<$o>. The C<:local> named argument limits the returned methods to
those defined in the C<Employee> class and excludes the inherited methods.
The syntax of calling a method with C<.^> instead of a single dot means that
it is actually a method call on the I<meta class>, which is a class managing
it is actually a method call on its I<meta class>, which is a class managing
the properties of the C<Employee> class -- or any other class you are
interested in. This meta class enables other ways of introspection too:
Expand Down
25 changes: 12 additions & 13 deletions doc/Language/containers.pod
Expand Up @@ -28,8 +28,8 @@ container>.
=head1 Scalar containers
Although objects of type C<Scalar> are everywhere in Perl 6, you usually
never see them directly as objects, because most operations
Although objects of type C<Scalar> are everywhere in Perl 6, you rarely
see them directly as objects, because most operations
I<decontainerize>, which means they act on the C<Scalar> container's
contents instead of the container itself.
Expand Down Expand Up @@ -274,19 +274,19 @@ To provide custom containers Perl 6 provides the class C<Proxy>. It takes two
methods that are called when values are stored or fetched from the container.
Type checks are not done by the container itself and other restrictions like
readonlyness can be broken. The returned value must therefore be of the same
type then the type of the variable it is bound to. We can use type captures to
type as the type of the variable it is bound to. We can use type captures to
work with types in Perl 6.
sub lucky(::T $type) {
my T $c-value; # closure variable
return Proxy.new(
FETCH => method (){ $c-value},
STORE => method (T $new-value){
X::OutOfRange.new(what => 'number', got => '13', range => '-Inf .. 12, 14..Inf').throw
if $new-value == 13;
$c-value = $new-value;
}
);
my T $c-value; # closure variable
return Proxy.new(
FETCH => method () { $c-value },
STORE => method (T $new-value) {
X::OutOfRange.new(what => 'number', got => '13', range => '-Inf..12, 14..Inf').throw
if $new-value == 13;
$c-value = $new-value;
}
);
}
my Int $a := lucky(Int);
Expand All @@ -295,4 +295,3 @@ work with types in Perl 6.
say $a = 13; # X::OutOfRange
=end pod

16 changes: 8 additions & 8 deletions doc/Language/faq.pod
Expand Up @@ -541,13 +541,13 @@ them offer all.
=item react / whenever / supply keywords allows easy construction of interactive, event driven applications.
=item Lazy evaluation when possible, eager evaluation when wanted or necessary. This means, for example, lazy lists, and even infinite lazy lists, like the Fibonacci sequence, or all prime numbers.
=item Lazy evaluation when possible, eager evaluation when wanted or necessary. This means, for example, lazy lists, and even infinite lazy lists, like the Fibonacci sequence, or all prime numbers.
=item Native data types for faster, closer to the metal, processing.
=item Interfacing to external libraries in C / C++ are trivially simple with NativeCall.
=item Interfacing with Perl 5 (CPAN) / Python modules trivially simple with Inline::Perl5 resp. Inline::Python.
=item Interfacing with Perl 5 (CPAN) / Python modules trivially simple with Inline::Perl5 and Inline::Python.
=item Can have multiple versions of a module installed and loaded simultaneously.
Expand Down Expand Up @@ -575,7 +575,7 @@ them offer all.
=item Runs on small (e.g. Raspberry Pi) and large multi-processor hardware.
=item Garbage collect based: no timely destruction, so no ref-counting necessary. Use phasers for timely actions.
=item Garbage collection based: no timely destruction, so no ref-counting necessary. Use phasers for timely actions.
=item Methods can be mixed into any instantiated object at runtime, e.g. to allow adding out-of-band data.
Expand All @@ -595,8 +595,8 @@ features.
That depends on what you are doing. Rakudo has been developed with the
philosophy of "make it work right then make it work fast". It's fast for some
things already but needs work on others. After the Christmas 2015 release stabilizes
the definition of the language, we'll be spending much of our effort on optimizing in 2016.
things already but needs work on others. Since the Christmas 2015 release stabilized
the definition of the language, we're spending much of our effort on optimizing in 2016.
Since Perl 6 provides lots of clues to the JIT that other dynamic languages don't, we think
we'll have a lot of headroom for performance improvements. Some things already
run faster than Perl 5.
Expand All @@ -617,7 +617,7 @@ Examples:
# Perl 6 version
use v6;
class Foo { has $.i is rw};
class Foo { has $.i is rw };
for (1..1_000_000) -> $i {
my $obj = Foo.new;
Expand All @@ -628,7 +628,7 @@ Examples:
package Foo;
use Moose;
has i => ( is=> 'rw');
has i => (is => 'rw');
__PACKAGE__->meta->make_immutable;
Expand Down Expand Up @@ -659,7 +659,7 @@ Examples:
my ($prev, $current) = (1,0);
for ( 0..100_000) {
for (0..100_000) {
($prev, $current) = ($current, $prev + $current);
}
print $current;
Expand Down
4 changes: 2 additions & 2 deletions doc/Language/io.pod
Expand Up @@ -5,7 +5,7 @@
=SUBTITLE File-related operations
Here we present a quick overview of the file-related input/output
operations, detailed documentation can be found in the documentation for the
operations. Details can be found in the documentation for the
L<IO|/type/IO> role, as well as the L<IO::Handle|/type/IO::Handle> and
L<IO::Path|/type/IO::Path> types.
Expand Down Expand Up @@ -35,7 +35,7 @@ the file for you.
=head2 Line by line
Of course, we also have the option to read a file line-by-line. The new line
separator (e.g. $*IN.nl-in) will be excluded.
separator (i.e., C<$*IN.nl-in>) will be excluded.
for 'huge-csv'.IO.lines -> $line {
# Do something with $line
Expand Down
14 changes: 7 additions & 7 deletions doc/Language/modules-extra.pod
Expand Up @@ -5,23 +5,24 @@
=SUBTITLE What can help you write/test/improve your module(s)
Here is a list of modules that you can find in the Perl 6 ecosystem
which aims to make the experiences of developing Perl 6 modules
which aim to make the experience of developing Perl 6 modules
more fun.
=head1 Modules builder and Authoring tools
Here some modules/tools that can help you with generating files that are part
of a module.
=head1 Module builder and Authoring tools
Some modules and tools to help you with generating files that are part
of a module distribution.
=item L<App::Mi6|http://modules.perl6.org/dist/App::Mi6> Minimal authoring tool for Perl6
=item L<META6|http://modules.perl6.org/dist/META6> Do things with Perl 6 META files
=item L<Module::Skeleton|https://bitbucket.org/rightfold/module-skeleton> Generate a skeleton module
=item L<p6doc|http://modules.perl6.org/dist/p6doc> Generate documentation end-products
=head1 Tests
Some tests related modules
=head1 Tests
Some tests of module quality.
=item L<Test::META|http://modules.perl6.org/dist/Test::META> Test your META6.json file
=item L<Test::Output|http://modules.perl6.org/dist/Test::Output> Test the output to STDOUT and STDERR your program generates
Expand All @@ -32,7 +33,6 @@ Some tests related modules
Here some modules to help you work with NativeCall.
=item L<NativeHelpers::Array|http://modules.perl6.org/dist/NativeHelpers::Array> Provides routines to deal with CArray
=item L<App::GPTrixie|http://modules.perl6.org/dist/App::GPTrixie> Generate NativeCall code from C headers file
=item L<NativeCall::TypeDiag|http://modules.perl6.org/dist/NativeCall::TypeDiag> Provides routines to test your CStruct
Expand Down
40 changes: 21 additions & 19 deletions doc/Language/modules.pod
Expand Up @@ -136,7 +136,7 @@ any argument list.
=end code
You can pass named parameters to C<is export> to group symbols for exporting
then the importer can pick and choose. There are three predefined
so that the importer can pick and choose. There are three predefined
tags: C<ALL>, C<DEFAULT> and C<MANDATORY>.
=begin code
Expand All @@ -161,7 +161,7 @@ tags: C<ALL>, C<DEFAULT> and C<MANDATORY>.
=head3 UNIT::EXPORT::*
Beneath the surface C<is export> is adding the symbols to a C<UNIT>
Beneath the surface, C<is export> is adding the symbols to a C<UNIT>
scoped package in the C<EXPORT> namespace. For example, C<is
export(:FOO)> will add the target to the C<UNIT::EXPORT::FOO>
package. This is what Perl 6 is really using to decide what to import.
Expand Down Expand Up @@ -247,7 +247,7 @@ the values are the desired values. The names should include the sigil
=end code
Note, C<EXPORT> can't be declared inside a package because
presently rakudo (2015.09) seems to treat C<EXPORT> as part of the
presently Rakudo (2015.09) seems to treat C<EXPORT> as part of the
compunit rather than the package.
Whereas C<UNIT::EXPORT> packages deal with the named parameters passed
Expand Down Expand Up @@ -299,7 +299,7 @@ L<Cool>s.
=begin code
use MakeQuestionable Cool;
say 0?,1?,{}?,{ a => "b"}?; # False True False True
say 0?, 1?, {}?, { a => "b" }?; # False True False True
=end code
=head2 Finding Modules
Expand Down Expand Up @@ -363,10 +363,12 @@ To share your module, do the following:
`-- Gargravarr.pm
=end item
=item If you have any additional files (such as templates or a dynamic library ) that you wish to have installed so you can access them at runtime they should be placed in a C<resources> sub-directory of your project.
=item If you have any additional files (such as templates or a dynamic
library) that you wish to have installed so you can access them at
runtime, they should be placed in a C<resources> sub-directory of your project.
=item The C<README.md> file is a L<markdown-formatted|https://help.github.com/articles/markdown-basics/> text file, which
will later be automatically rendered as HTML by GitHub.
=item The C<README.md> file is a L<markdown-formatted|https://help.github.com/articles/markdown-basics/>
text file, which will later be automatically rendered as HTML by GitHub.
=item Regarding the C<LICENSE> file, if you have no other preference,
you might just use the same one that Rakudo Perl 6 uses. Just
Expand Down Expand Up @@ -418,14 +420,14 @@ To share your module, do the following:
details). If the version number doesn't matter to you or your users
right now, you can just put in an asterisk (*) for the version.
The C<authors> section includes a list of all the module authors. In
the case there is only one author, a single element list must be
supplied.
The C<authors> section includes a list of all the module authors. In
the case there is only one author, a single element list must be
supplied.
In the C<provides> section, include all the namespaces provided by
your distribution and that you wish to be installed, only module
files that are explicitly included here will be installed and
available with C<use> or C<require> in other programs
available with C<use> or C<require> in other programs.
Set C<perl> version to the minimum perl version your module works with.
Expand All @@ -435,8 +437,8 @@ To share your module, do the following:
library files and their installed location can be determined through the
C<%?RESOURCES> Hash indexed on the name provided.
The L<Test::META module | https://github.com/jonathanstowe/Test-META/>
can help you check the correctness of the META6.json file.
The L<Test::META module | https://github.com/jonathanstowe/Test-META/>
can help you check the correctness of the META6.json file.
=end item
Expand All @@ -451,10 +453,10 @@ To share your module, do the following:
=item Push your project to GitHub.
=item Consider to setup automated testing (see L<https://docs.travis-ci.com/user/languages/perl6>).
=item Consider setting up automated testing (see L<https://docs.travis-ci.com/user/languages/perl6>).
=item Create a PR on L<ecosystem|https://github.com/perl6/ecosystem> adding
your module to META.list, or Ping someone on IRC (#perl6 at freenode) to
your module to META.list, or ping someone on IRC (#perl6 at freenode) to
get help having it added.
=item After the pull request has been accepted, wait for an hour. If
Expand Down Expand Up @@ -489,10 +491,10 @@ infrastructure. B<Volunteers needed!>
The rough plan is:
1. fix EVAL precomp bug (nine)
2. get Repository API straight
3. get zef up to speed
4. continue with the metacpan fork for perl6 (jdv79)
1. fix EVAL precomp bug (nine)
2. get Repository API straight
3. get zef up to speed
4. continue with the metacpan fork for perl6 (jdv79)
The repository with jdv's fork can be found at L<https://github.com/jdv/metacpan-web>
Expand Down
4 changes: 2 additions & 2 deletions doc/Language/mop.pod
Expand Up @@ -47,7 +47,7 @@ uses such calls to meta objects.
These are introspective macros that resemble method calls.
Metamethods are generally named with ALLCAPS, and it is considered good
style to avoid using your own methods with ALLCAPS names. This will avoid
style to avoid creating your own methods with ALLCAPS names. This will avoid
conflicts with any metamethods that may appear in future versions of the
language. Note that if you really must use a method which has an ALLCAPS
name, use quotes around the method name to safely call it indirectly:
Expand Down Expand Up @@ -146,7 +146,7 @@ primitives that the virtual machine under NQP provides.
Since the object model is bootstrapped in terms of lower-level types,
introspection can sometimes return low-level types instead of the ones you
expect, like a NQP-level routine instead of normal L<Routine|/type/Routine>
expect, like an NQP-level routine instead of a normal L<Routine|/type/Routine>
object, or a bootstrap-attribute instead of L<Attribute|/type/Attribute>.
=head2 Composition time and static reasoning
Expand Down

0 comments on commit d4d0a0b

Please sign in to comment.