Skip to content

Commit

Permalink
Merge branch 'master' of github.com:perl6/specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Cochrane committed Feb 14, 2015
2 parents ad449e5 + 081e2aa commit 55b6345
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 31 deletions.
12 changes: 6 additions & 6 deletions S01-overview.pod
Expand Up @@ -9,8 +9,8 @@ Synopsis 1: Overview

Created: 10 Aug 2004

Last Modified: 2 Mar 2012
Version: 9
Last Modified: 11 Feb 2015
Version: 10

This document originally summarized Apocalypse 1, which covers the
initial design concept. That original summary may be found below
Expand Down Expand Up @@ -105,7 +105,6 @@ code in some other way, such as by:

#!/usr/bin/perl6
use v6.0;
v6;

Also, a file with a C<.p6> extension may be taken as indicative,
as may any other extension containing the digit C<6>, such as C<p6l>
Expand Down Expand Up @@ -141,13 +140,14 @@ also choose to implement bug-for-bug compatibility.

Scaling is one of those areas where Perl needs to be multiparadigmatic
and context sensitive. Perl 5 code is not strict by default, while
Perl 6 code is. But it should be easy to relax with C<-e> or
a bare version number:
Perl 6 code is. But it should be easy to relax with C<-e> or the
'no strict' pragma:

perl -e '$x = 1'

#!/usr/bin/perl
v6; $x = 1;
no strict;
$x = 1;

=item *

Expand Down
16 changes: 5 additions & 11 deletions S11-modules.pod
Expand Up @@ -8,8 +8,8 @@ Synopsis 11: Compilation Units

Created: 27 Oct 2004

Last Modified: 15 Mar 2014
Version: 42
Last Modified: 11 Feb 2015
Version: 43

=head1 Overview

Expand Down Expand Up @@ -598,17 +598,11 @@ To lock the semantics to 6.0.0, say one of:
use v6.0.0;

In any of those cases, strictures and warnings are the default
in your main program. But if you start your program with a bare
version number or other literal:
in your main program. To start it in I<lax> mode, start it with

v6.0.0;
v6;
6;
"Coolness, dude!";
no strict;

it runs Perl 6 in I<lax> mode, without strictures or warnings, since obviously
a bare literal in a sink (void) context I<ought> to have produced a "Useless use of..." warning.
(Invoking perl with C<-e '6;'> has the same effect.)
(Invoking perl with C<-e> has the same effect.)

In the other direction, to inline Perl 5 code inside a Perl 6 program, put
C<use v5> at the beginning of a lexical block. Such blocks can nest arbitrarily
Expand Down
2 changes: 1 addition & 1 deletion S17-concurrency.pod
Expand Up @@ -346,7 +346,7 @@ The simplest Supply is a C<Supply> class, which is punned from the role. It crea
$s.emit(2); # 2\n

my $t2 = $s.tap({ say 2 * $_ },
{ say "End" });
:done({ say "End" }));
$s.emit(3); # 3\n6\n

The object returned by C<tap> represents the subscription. To stop subscribing, call C<close> on it.
Expand Down
9 changes: 4 additions & 5 deletions S19-commandline.pod
Expand Up @@ -420,12 +420,11 @@ Note: The debugger needs further specification.

=item --execute, -e *line*

Execute a single-line program.
Execute a single-line program in lax mode.

If you wish to run in lax mode, without strictures and warnings enabled,
pass a value of '6;' at the start of the -e on the command line,
like C<-e '6; $x = 42'>.
See L<Synopsis 11|S11-modules/"Forcing Perl 6"> for details.
If you don't wish to run in lax mode, but with strictures and warnings enabled,
pass 'use strict;' at the -e on the command line,
like C<-e 'use strict; my $x = 42'>.

=item --autoloop-delim, -F *expression*

Expand Down
35 changes: 27 additions & 8 deletions S32-setting-library/Numeric.pod
Expand Up @@ -8,14 +8,10 @@ DRAFT: Synopsis 32: Setting Library - Numeric

Created: 19 Mar 2009 extracted from S29-functions.pod

Last Modified: 28 Dec 2013
Version: 18
Last Modified: 13 Feb 2015
Version: 19

The document is a draft.

This documents Bit, Int, Numeric, Rat, Complex, and Bool.

XXX So where are Bit, Int, and Rat
This documents Int, Numeric, Rat, Complex, and Bool.

=head1 Function Packages

Expand Down Expand Up @@ -237,14 +233,22 @@ number, so for example, the C<Rat> C<5/4> is returned as C<"1.2">.

=item base

multi method base(Cool $base as Int)
multi method base($base, $digits?)

Returns a C<Str> representing the invocant in base C<$base>. Fails if C<$base>
is smaller than C<2> or larger than C<36>.

For bases above ten, the digit repertoire is enhanced with uppercase latin
characters starting from C<A>.

The optional C<$digits> argument asks for that many digits of fraction
(which may not be negative). If omitted, a reasonable default is chosen
based on type. For Int this default is 0. For Num, the default is 8.
For Rat, the number of places is scaled to the size of the denominator,
with a minimum of 6.

The final digit produced is always rounded.

=item floor

multi method floor ( Real $x: --> Int ) is export
Expand Down Expand Up @@ -623,6 +627,21 @@ the form "C<< <3/5> >>", without internal spaces, and including the
angles that keep the C</> from being treated as a normal division
operator.

=item base-repeating

multi method base-repeating($base)

Returns two strings representing the invocant in base C<$base>. Fails if C<$base>
is smaller than C<2> or larger than C<36>.

For bases above ten, the digit repertoire is enhanced with uppercase latin
characters starting from C<A>.

The first returned string is the non-repeating part of the representation.
The second is the repeating part. The precision is arbitrarily limited to 100000.
Above that, the repeating group will return '???'. If there is no repeating group,
the second returned string is C<''>.

=back

=head1 AUTHORS
Expand Down

0 comments on commit 55b6345

Please sign in to comment.