Commit 2d3b1604 authored by Robert Lemmen's avatar Robert Lemmen

New upstream version 2018.10

parent 42cb602d
......@@ -66,19 +66,26 @@ MAIN: {
$options{libdir} = $default;
}
my $prefix = $options{'prefix'};
my @known_backends = qw/moar jvm/;
my @known_backends = qw/moar jvm js/;
my %backend_prefix = (jvm => 'j', moar => 'm', js => 'js');
my %known_backends = map { $_, 1; } @known_backends;
my %letter_to_backend;
my $default_backend;
for (keys %known_backends) {
$letter_to_backend{ substr($_, 0, 1) } = $_;
$letter_to_backend{ $backend_prefix{$_} } = $_;
}
my @backends;
my %backends;
if (my $nqp_bin = $options{'with-nqp'}) {
die "Could not find $nqp_bin" unless -e $nqp_bin;
my $passed_backends = $options{backends};
$options{backends} = qx{$nqp_bin -e 'print(nqp::getcomp("nqp").backend.name)'}
or die "Could not get backend information from $nqp_bin";
if (defined $passed_backends && $passed_backends ne $options{backends}) {
die "Passed value to --backends ($passed_backends) is overwritten by the one infered by --with-nqp ($options{backends})";
}
}
if (defined $options{backends}) {
$options{backends} = join ",", @known_backends
......@@ -173,7 +180,7 @@ MAIN: {
}
}
for my $target (qw/common_bootstrap_sources moar_core_sources moar_core_d_sources jvm_core_sources jvm_core_d_sources/) {
for my $target (qw/common_bootstrap_sources js_core_sources js_core_d_sources moar_core_sources moar_core_d_sources jvm_core_sources jvm_core_d_sources/) {
open my $FILELIST, '<', "tools/build/$target"
or die "Cannot read 'tools/build/$target': $!";
my @lines;
......@@ -209,9 +216,9 @@ MAIN: {
fill_template_file('tools/build/Makefile-common-macros.in', $MAKEFILE, %config);
my @prefixes = map substr($_, 0, 1), @backends;
my @prefixes = map $backend_prefix{$_}, @backends;
my $launcher = substr($default_backend, 0, 1) . '-runner-default';
my $launcher = $backend_prefix{$default_backend} . '-runner-default';
print $MAKEFILE "all: ", join(' ', map("$_-all", @prefixes), $launcher), "\n";
print $MAKEFILE "install: ", join(' ', map("$_-install", @prefixes), $launcher . '-install'), "\n";
......@@ -267,7 +274,7 @@ MAIN: {
$config{'nqp_jars'} = $nqp_config{'jvm::runtime.jars'};
$config{'bld_nqp_jars'} = join( $config{'cpsep'}, map { $config{'sysroot'} . $_ } split( $config{'cpsep'}, $nqp_config{'jvm::runtime.jars'} ) );
$config{'nqp_classpath'} = $nqp_config{'jvm::runtime.classpath'};
$config{'nqp_libdir'} = $nqp_config{'nqp::libdir'};
$config{'nqp::libdir'} = $nqp_config{'nqp::libdir'};
$config{'j_runner'} = $win ? 'perl6-j.bat' : 'perl6-j';
......@@ -312,6 +319,28 @@ MAIN: {
fill_template_file('tools/build/Makefile-Moar.in', $MAKEFILE, %config, %nqp_config);
}
}
if ($backends{js}) {
my %nqp_config;
$config{js_nqp} = $impls{js}{bin};
$config{js_nqp} =~ s{/}{\\}g if $win;
$config{'perl6_runtime'} = File::Spec->rel2abs('src/vm/js/perl6-runtime');
$config{'perl6_lowlevel_libs'} = File::Spec->rel2abs('node_modules') . '/';
$config{'perl6_js_runner'} = File::Spec->rel2abs('perl6-js');
if ( $impls{js}{ok} ) {
%nqp_config = %{ $impls{js}{config} };
}
elsif ( $impls{js}{config} ) {
push @errors, "The nqp-js is too old";
}
else {
push @errors, "Unable to read configuration from NQP on JS";
}
system("$config{js_nqp} tools/build/gen-js-makefile.nqp > gen/js/Makefile-JS.in");
fill_template_file('gen/js/Makefile-JS.in', $MAKEFILE, %config, %nqp_config);
}
if ($errors{jvm}{'no gen-nqp'} || $errors{moar}{'no gen-nqp'}) {
my @options_to_pass;
......@@ -331,9 +360,8 @@ MAIN: {
}
sorry($options{'ignore-errors'}, @errors) if @errors;
my $l = uc substr($default_backend, 0, 1);
print $MAKEFILE qq[\nt/*/*.t t/*.t t/*/*/*.t: all\n\t\$(${l}_HARNESS5_WITH_FUDGE) --verbosity=1 \$\@\n];
my $l = uc $backend_prefix{$default_backend};
print $MAKEFILE qq[\nt/*/*.t t/*.t t/*/*/*.t: all\n\t\$(${l}_HARNESS_WITH_FUDGE) --verbosity=1 \$\@\n];
close $MAKEFILE or die "Cannot write 'Makefile': $!";
......
......@@ -126,6 +126,7 @@ docs/announce/2018.05.md
docs/announce/2018.06.md
docs/announce/2018.08.md
docs/announce/2018.09.md
docs/announce/2018.10.md
docs/architecture.html
docs/architecture.svg
docs/archive/2017-IO-Grant--Action-Plan.md
......@@ -142,6 +143,7 @@ docs/metaobject-api.pod
docs/module_management.md
docs/obtaining-a-commit-bit.pod
docs/ops.markdown
docs/rakudo-nqp-and-pod-notes.md
docs/release_guide.pod
docs/ROADMAP
docs/roast-spectest.data-versioning.md
......@@ -151,6 +153,7 @@ docs/spectest-progress.csv
docs/val.pod6
docs/windows.md
dynext/IGNORE
gen/js/.gitignore
gen/jvm/.gitignore
gen/moar/.gitignore
INSTALL.txt
......@@ -167,6 +170,7 @@ lib/Telemetry.pm6
lib/Test.pm6
LICENSE
MANIFEST
package.json
README.md
src/core/allomorphs.pm6
src/core/Any-iterable-methods.pm6
......@@ -274,6 +278,7 @@ src/core/IO/Spec/Win32.pm6
src/core/Iterable.pm6
src/core/IterationBuffer.pm6
src/core/Iterator.pm6
src/core/JavaScriptScheduler.pm6
src/core/JSON/Pretty.pm6
src/core/Junction.pm6
src/core/Kernel.pm6
......@@ -384,6 +389,7 @@ src/core/Version.pm6
src/core/VM.pm6
src/core/WhateverCode.pm6
src/core/Whatever.pm6
src/core/WrappedJSObject.pm6
src/main.nqp
src/Perl6/Actions.nqp
src/Perl6/Compiler.nqp
......@@ -445,6 +451,12 @@ src/Perl6/PodGrammar.nqp
src/Perl6/Pod.nqp
src/Perl6/World.nqp
src/RESTRICTED.setting
src/vm/js/make-release.js
src/vm/js/ModuleLoaderVMConfig.nqp
src/vm/js/Perl6/Ops.nqp
src/vm/js/perl6-runtime/package.json
src/vm/js/perl6-runtime/runtime.js
src/vm/js/rakudo-library.js
src/vm/jvm/CompUnit/Repository/Java.pm6
src/vm/jvm/CompUnit/Repository/JavaRuntime.pm6
src/vm/jvm/ModuleLoaderVMConfig.nqp
......@@ -579,9 +591,10 @@ t/09-moar/Line_Break__LineBreak.t
t/09-moar/NAME__UnicodeData.t
t/09-moar/UnipropCheck.pm6
t/10-qast/00-misc.t
t/3rdparty/Unicode/10.0.0/extracted/DerivedGeneralCategory.txt
t/3rdparty/Unicode/10.0.0/LineBreak.txt
t/3rdparty/Unicode/10.0.0/UnicodeData.txt
t/11-js/eval-js.t
t/3rdparty/Unicode/11.0.0/extracted/DerivedGeneralCategory.txt
t/3rdparty/Unicode/11.0.0/LineBreak.txt
t/3rdparty/Unicode/11.0.0/UnicodeData.txt
t/3rdparty/Unicode/LICENSE
t/fudgeandrun
t/harness5
......@@ -590,11 +603,15 @@ tools/autounfudge.pl
tools/benchmark.pl
tools/build/check-nqp-version.pl
tools/build/common_bootstrap_sources
tools/build/create-js-runner.pl
tools/build/create-jvm-runner.pl
tools/build/create-moar-runner.p6
tools/build/gen-cat.nqp
tools/build/gen-js-makefile.nqp
tools/build/gen-version.pl
tools/build/install-core-dist.p6
tools/build/js_core_d_sources
tools/build/js_core_sources
tools/build/jvm_core_d_sources
tools/build/jvm_core_sources
tools/build-localtest.pl
......@@ -1920,6 +1937,7 @@ t/spec/t/07-register_function.in
t/spec/t/07-register_function.out_impl-1
t/spectest.data
t/spectest.data.6.c
t/spectest.js.data
t/spec/test_summary
t/spec/t/fudge.t
t/spec/TODO
......
New in 2018.10:
+ SPECIAL NOTES:
+ This is the first Rakudo release that comes with an additional
JS backend. See `6pad` project for running Perl 6 code directly
in your browser.
+ Deprecations:
+ Deprecated `gethostname()` in favor of `$*KERNEL.hostname` [f7fa5185]
+ Fixes:
+ Fixed/improved divide-by-zero errors in
`Rational.floor`/`.ceiling`/`.Str` [a639fa9c][6d70346c]
+ Fixed semantics of `[Nil]` [88e6de22]
+ Fixed issue with custom `bless` method [64137bd2]
+ Made nativecall's `postcircumfix:<[ ]>` return containers [be2d4cb4]
+ Fixed hash descriptor when doing `Hash[Int].new` [9acbf000][ea710414]
+ `Nil` is now allowed in initialization and assignment of hashes
[f61ba41a][605bcb39][7e86d4e3]
+ Fixed ContainerDescriptor for arrays with a dimension of three [a2e78ec8]
+ Fixed indexing of shaped arrays with a dimension higher than 3 [0307c366]
+ `.in-timezone`s value is now coerced to Int [c8438e6a]
+ Stub methods from roles are now verified [fd5d5bdf]
+ Fixed double-closing of handles in `.lines` when `:close` and
`$limit` are used [6edb142f]
+ Fixed closing of handles in `IO::Handle.lines` when `$limit`
is used [c1c75740]
+ Consistified Rat.base to fail instead of throw [a804ab57]
+ Fixed enforcing of return constraints on multi method stubs [abba67b2]
+ Various improvements to produced messages [cc2fcc9a][560e94ef]
[bf10f4c5][243a2f01][7d02b949][9894eda5][0243275d]
+ Additions:
+ [6.d] Constructs `$()`/`@()`/`%()` no longer have any `$/`-related
magic [bb88a032]
+ [6.d] DefiniteHOWs' (type smileys) default default is now the base
type [38b198c9]
+ Zero-Denominator Rationals are now normalized on creation [671c4115]
[75ec2248]
+ Made `my @a is List = 1,2,3,4` work [2bdf2b35]
+ Using `is Type` on `@` and `%` attributes is now allowed [b537ce2e]
+ Added a BOM on `open` for utf16 filehandles [959b89cf][479348f3]
+ Added initial support for Unicode 11.0 [5c272ee4]
+ Pluggable `MAIN` interface refactored, documented and tested
[f234b9af][35f3d83d][7c9b2955][33c24153][8c3a4131][fbfccfa2]][341190e2][24413b5f[2c43d2bf]
+ Usage message now limits itself to partially matching candidates
[0d1be77e]
+ Added additional dashed variants for utf16le and utf16be [4307996a]
+ Added `Parameter.coerce_type` method [0243275d]
+ Added `Code.cando` method to allow for `.cando` on all `Callable`s
[45eeab78][69533b50]
+ Removals:
+ Removed --encoding support [bea08ec6][31b19d09]
+ Efficiency:
+ Made Hash.push/append between 1.2x and 1.4x as fast [12cfde2a]
+ Made `"".ord` orders of magnitude faster [b22edce4]
+ Made `==` with Rationals up to 1.55x as fast [c5a2eb81]
+ Made Rational `===` Rational 2.47x as fast [97e8413b]
+ Made many cases of `for (range-like things)` up to 150x as fast
[2dd02751][645eeb52][dfd6450d][49baea70][89787028][2af789d7]
+ Made `[42]` not allocate anything anymore [8c4546bb]
+ Made `[@a]` and `[1,2,3]` about 1.4x as fast [e430813f]
+ Made `Array.List` coercion 1.5x as fast [3d405e89]
+ Made `.isa` about 2x as fast [4e8740c8]
+ Made `infix:<%%>` 10.42x as fast on natives [3d161a56]
+ Other minor optimizations [464a86b1][ab83b9d8][8cc3d5d7][b107cda5]
+ Internal:
+ Made `make` an only [369068ae]
+ Added skip-one method to appropriate PredictiveIterators [e54885e5]
+ More things are now initialized at setting compile time
[06dfbf02][688cbac1][92735770]
+ Simplified initialization of `CompUnit::RepositoryRegistry`
[0425d927][8e1cd01a]
+ Introduced `IterationBuffer.List` [8c10da6a]
+ Made it not go through `.new` if we can `nqp::create` [84311b77]
+ Made sure `.STORE` only works on instances [9daac683]
+ Added `$*INSIDE-EVAL` to mark that we're inside an `EVAL` [73b7c603]
New in 2018.09:
+ Fixes:
+ Made native arrays throw when storing a lazy Seq [fc8c7f84][bb963a25]
......
# Announce: Rakudo Perl 6 compiler, Release #127 (2018.10)
On behalf of the Rakudo development team, I’m very happy to announce the
October 2018 release of Rakudo Perl 6 #127. Rakudo is an implementation of
Perl 6 on the Moar Virtual Machine[^1].
This release implements the 6.c version of the Perl 6 specifications.
It includes bugfixes and optimizations on top of
the 2015.12 release of Rakudo.
Upcoming releases in 2018 will include new functionality that is not
part of the 6.c specification, available with a lexically scoped
pragma. Our goal is to ensure that anything that is tested as part of the
6.c specification will continue to work unchanged. There may be incremental
spec releases this year as well.
The tarball for this release is available from <https://rakudo.org/files/rakudo>.
Please note: This announcement is not for the Rakudo Star
distribution[^2] — it’s announcing a new release of the compiler
only. For the latest Rakudo Star release, see
<https://rakudo.org/files/star>.
The changes in this release are outlined below:
New in 2018.10:
+ SPECIAL NOTES:
+ This is the first Rakudo release that comes with an additional
JS backend. See `6pad` project for running Perl 6 code directly
in your browser.
+ Deprecations:
+ Deprecated `gethostname()` in favor of `$*KERNEL.hostname` [f7fa5185]
+ Fixes:
+ Fixed/improved divide-by-zero errors in
`Rational.floor`/`.ceiling`/`.Str` [a639fa9c][6d70346c]
+ Fixed semantics of `[Nil]` [88e6de22]
+ Fixed issue with custom `bless` method [64137bd2]
+ Made nativecall's `postcircumfix:<[ ]>` return containers [be2d4cb4]
+ Fixed hash descriptor when doing `Hash[Int].new` [9acbf000][ea710414]
+ `Nil` is now allowed in initialization and assignment of hashes
[f61ba41a][605bcb39][7e86d4e3]
+ Fixed ContainerDescriptor for arrays with a dimension of three [a2e78ec8]
+ Fixed indexing of shaped arrays with a dimension higher than 3 [0307c366]
+ `.in-timezone`s value is now coerced to Int [c8438e6a]
+ Stub methods from roles are now verified [fd5d5bdf]
+ Fixed double-closing of handles in `.lines` when `:close` and
`$limit` are used [6edb142f]
+ Fixed closing of handles in `IO::Handle.lines` when `$limit`
is used [c1c75740]
+ Consistified Rat.base to fail instead of throw [a804ab57]
+ Fixed enforcing of return constraints on multi method stubs [abba67b2]
+ Various improvements to produced messages [cc2fcc9a][560e94ef]
[bf10f4c5][243a2f01][7d02b949][9894eda5][0243275d]
+ Additions:
+ [6.d] Constructs `$()`/`@()`/`%()` no longer have any `$/`-related
magic [bb88a032]
+ [6.d] DefiniteHOWs' (type smileys) default default is now the base
type [38b198c9]
+ Zero-Denominator Rationals are now normalized on creation [671c4115]
[75ec2248]
+ Made `my @a is List = 1,2,3,4` work [2bdf2b35]
+ Using `is Type` on `@` and `%` attributes is now allowed [b537ce2e]
+ Added a BOM on `open` for utf16 filehandles [959b89cf][479348f3]
+ Added initial support for Unicode 11.0 [5c272ee4]
+ Pluggable `MAIN` interface refactored, documented and tested
[f234b9af][35f3d83d][7c9b2955][33c24153][8c3a4131][fbfccfa2]][341190e2][24413b5f[2c43d2bf]
+ Usage message now limits itself to partially matching candidates
[0d1be77e]
+ Added additional dashed variants for utf16le and utf16be [4307996a]
+ Added `Parameter.coerce_type` method [0243275d]
+ Added `Code.cando` method to allow for `.cando` on all `Callable`s
[45eeab78][69533b50]
+ Removals:
+ Removed --encoding support [bea08ec6][31b19d09]
+ Efficiency:
+ Made Hash.push/append between 1.2x and 1.4x as fast [12cfde2a]
+ Made `"".ord` orders of magnitude faster [b22edce4]
+ Made `==` with Rationals up to 1.55x as fast [c5a2eb81]
+ Made Rational `===` Rational 2.47x as fast [97e8413b]
+ Made many cases of `for (range-like things)` up to 150x as fast
[2dd02751][645eeb52][dfd6450d][49baea70][89787028][2af789d7]
+ Made `[42]` not allocate anything anymore [8c4546bb]
+ Made `[@a]` and `[1,2,3]` about 1.4x as fast [e430813f]
+ Made `Array.List` coercion 1.5x as fast [3d405e89]
+ Made `.isa` about 2x as fast [4e8740c8]
+ Made `infix:<%%>` 10.42x as fast on natives [3d161a56]
+ Other minor optimizations [464a86b1][ab83b9d8][8cc3d5d7][b107cda5]
+ Internal:
+ Made `make` an only [369068ae]
+ Added skip-one method to appropriate PredictiveIterators [e54885e5]
+ More things are now initialized at setting compile time
[06dfbf02][688cbac1][92735770]
+ Simplified initialization of `CompUnit::RepositoryRegistry`
[0425d927][8e1cd01a]
+ Introduced `IterationBuffer.List` [8c10da6a]
+ Made it not go through `.new` if we can `nqp::create` [84311b77]
+ Made sure `.STORE` only works on instances [9daac683]
+ Added `$*INSIDE-EVAL` to mark that we're inside an `EVAL` [73b7c603]
The following people contributed to this release:
Zoffix Znet, Elizabeth Mattijsen, Paweł Murias, JJ Merelo, Tom Browder,
Bart Wiegmans, Jonathan Worthington, Will "Coke" Coleda,
Aleks-Daniel Jakimenko-Aleksejev, Samantha McVey, thebooort,
Juan Julián Merelo Guervós, Ben Davies, Fernando Correa de Oliveira,
Timo Paulssen, Daniel Green, MorayJ, Valentin Anger,
threadless-screw, Jeremy Studer, Nick Logan, finanalyst, Alexander,
Amir Aharoni, Claudio Ramirez, Luis F. Uceta, Nacho Mas, Richard Hainsworth,
Alex Schroeder, Bartosz Janus, Brad Gilbert, Jared Miller, Jason Cole,
Jonathan Beebe, Patrick Sebastian Böker, Rafael Schipiura,
Tzu-Li "tison" Chen, Tzu-Li Chen, sarna
If you would like to contribute or find out more information, visit
<https://perl6.org>, <https://rakudo.org/how-to-help>, ask on the
<perl6-compiler@perl.org> mailing list, or ask on IRC #perl6 on freenode.
Additionally, we invite you to make a donation to The Perl Foundation
to sponsor Perl 6 development: <https://donate.perlfoundation.org/>
(put “Perl 6 Core Development Fund” in the ‘Purpose’ text field)
The next release of Rakudo (#128), is tentatively scheduled for 2018-11-17.
A list of the other planned release dates is available in the
“docs/release_guide.pod” file.
The development team appreciates feedback! If you’re using Rakudo, do
get back to us. Questions, comments, suggestions for improvements, cool
discoveries, incredible hacks, or any other feedback – get in touch with
us through (the above-mentioned) mailing list or IRC channel. Enjoy!
Please note that recent releases have known issues running on the JVM.
We are working to get the JVM backend working again but do not yet have
an estimated delivery date.
[^1]: See <http://moarvm.org/>
[^2]: What’s the difference between the Rakudo compiler and the Rakudo
Star distribution?
The Rakudo compiler is a compiler for the Perl 6 language.
Not much more.
The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, a module installer, Perl 6 introductory
documentation, and other software that can be used with the Rakudo
compiler to enhance its utility.
# Notes and hints for working with Rakudo NQP and Pod
## Traps for the Perl 6 programmer
+ **DO NOT use '$0' in match results** - The Perl 6 shorthand for a match variable '**$0**' doesn't
work in NQP. Instead, use **$/[0]** for the zeroeth match.
Note the parser will be very confused otherwise and it currently cannot point to the error.
+ **DO NOT use 'nqp::say'** - The routine '**say**' is an NQP built-in and it does not need
the '**nqp::**' prefix. You can sometimes get away with using '**nqp::say**' but, when you least
expect it, the parser will fail without a helpful error message.
+ **DO use 'nqp::die'** - As opposed to '**say**', '**die**' does need to be qualified with '**nqp::**'.
If used without the '**nqp::**' prefix, you sometimes may get a very unhelpful error message.
+ **DO NOT use '$\<some-match-var>' inside a sub with a '$/' arg** - Use the full syntax for
a match variable ('**/$<some-match-var**') for more reliable (or at least self-documenting) results.
+ **BE WARNED about "return if (...)" statements** - Sometimes they work and sometimes not. But the
failure message is usually good enough to find the offending code.
For example, all these failed:
```
return if !nqp::elems(@arr);
return unless nqp::elems(@arr);
```
but this finally worked:
```
if !nqp::elems(@arr) {
return;
}
```
## Pod block text content handling
Text inside pod blocks that are contents rather than markup is comprised of
intermixed text and formatting code characters. Newlines and contiguous
whitespace may or may not be significant depending upon the general block type
(abbreviated, paragraph, delimited, or declarator) or block identifier (e.g.,
code, input, output, defn, comment, or data).
The content as it is parsed in Grammar.nqp is first broken into individual
characters which are then assigned to one of three token groups: regular text, text with
formatting code, and text that is to be unchanged from its input form
(code, input, and output).
The regular text and intermingled formatted text are then divided into two more
categories: text that will form one or more paragraphs and text that is part
of a table. Ultimately, each paragraph of text should be grouped into the
@contents array of a single Pod::Block::Para, but not all pod handling per S26
has been fully implemented.
Some notable, not-yet-implemented (NYI) features (in order of one dev's TODO list)
1. NYI: %config :numbered aliasing with '#' for paragraph or delimited blocks
2. NYI: pod data blocks
3. NYI: formatting code in defn block terms
4. NYI: formatting code in table cells
5. NYI: pod configuration aliasing
6. NYI: formatting code in declarator blocks
7. NYI: consistent use of the Pod::Block::Para as the leaf parent of all regular text
8. NYI: pod configuration lines
9. NYI: Pod::Ambient class
10. NYI: nested delimited comment blocks
11. NYI: configuration data on continuation lines are not always handled correctly
Anyone wanting to work on any of the NYI items please coordinate on IRC #perl6-dev to
avoid duplicate efforts. Most of the items are being worked on in a generally logical
order of need and knowledge gained during the process of implementing pod features.
## The <pod_textcontent> token
The token **pod_textcontent** is the match object for regular text and formatted code as
described above. It is the source of the final contents object for regular text containers
except for the table blocks which will be discussed separately. It has a corresponding action
method.
Tracing the pod class building code is tedious and not well documented. Tokens in the grammar
are often made early, along with other objects, and attached to that token's match object's .ast
attribute which is then used later in another object. The developer who wants to change the called .ast
code in that other object (which may be in the grammar, actions, or src/Perl6/Pod.nqp) has to refer
back to the original make point to see its format before doing any changes--not fun!
There is an ongoing effort to better document the process for later developers.
Following is the start of a table to show the grammar tokens that have action methods.
| Grammar tokens | Action method? | Pod sub? |
| --- | --- | --- |
| pod_textcontent | yes
## :numbered aliasing
S26 allows for the '#' character (Unicode name **NUMBER SIGN**), as the first word in a block,
to turn on the **:numbered** %config key; in that case the '#' will be removed from the data.
The user can allow a '#' to be recognized as data by either (1) setting the %config numbered
key to false, typically with the **:!numbered** form, or (2) using the **V** formatting code
around the '#' in the data like this: **V<#>**.
Proper handling of this feature requires changing the block's %config hash after the block data have been
parsed or possibly changing the parsing of the first block data word due to the presence of **:!numbered** in
the %config hash. Another problem is how to handle duplicate or incompatible %config keys and values.
The easiest case to handle is the abbreviated block which cannot have explicit %config data and for
which the :numbered alias is most useful. Examples of the abbreviated blocks most likely to
use this option are the **=item**, **=head**, and **=defn** types.
The '#' turns on the **:numbered** configuration in all these cases:
```
=item # foo bar
=item #
foo bar
=item
#
foo bar
```
Following are examples of situations in other block types that are
not good practice but have to be handled gracefully:
```
=for para :!numbered
# foo bar
```
The **:!numbered** is interpreted to mean accepting the '#' as part of block data.
```
=for para :numbered
# foo bar
```
The '#' means the same as the **:numbered** option: the renderer should number the
paragraph and the two **:numbered** keys (one explict and one implicit) are redundant.
......@@ -18,8 +18,7 @@ Note that we are trying very hard to ensure there are no backward
compatibility issues post Christmas. As such, we may end up delaying
some releases to ensure any compatibility issues are resolved.
2018-10-20 Rakudo #127 (AlexDaniel + Releasable)
2018-11-17 Rakudo #128
2018-11-17 Rakudo #128 (AlexDaniel + Releasable)
2018-12-15 Rakudo #129
(More planned dates can be generated with F<tools/release-dates.p6>).
......@@ -495,6 +494,7 @@ Previous releases were bundled as part of monthly Parrot releases.
2018-06-22 Rakudo #124 "2018.06" (AlexDaniel + Releasable)
2018-09-02 Rakudo #125 "2018.08" (AlexDaniel + Releasable)
2018-09-23 Rakudo #126 "2018.09" (AlexDaniel + Releasable)
2018-10-28 Rakudo #127 "2018.10" (AlexDaniel + Releasable)
=head1 COPYRIGHT
......
Makefile-JS.in
CORE.setting
*.nqp
......@@ -582,13 +582,13 @@ our role Native[Routine $r, $libname where Str|Callable|List|IO::Path|Distributi
}
}
multi sub postcircumfix:<[ ]>(CArray:D \array, $pos) is export(:DEFAULT, :types) is default {
multi sub postcircumfix:<[ ]>(CArray:D \array, $pos) is raw is export(:DEFAULT, :types) is default {
$pos ~~ Iterable ?? $pos.map: { array.AT-POS($_) } !! array.AT-POS($pos);
}
multi sub postcircumfix:<[ ]>(CArray:D \array, *@pos) is export(:DEFAULT, :types) {
multi sub postcircumfix:<[ ]>(CArray:D \array, *@pos) is raw is export(:DEFAULT, :types) {
@pos.map: { array.AT-POS($_) };
}
multi sub postcircumfix:<[ ]>(CArray:D \array, Callable:D $block) is export(:DEFAULT, :types) {
multi sub postcircumfix:<[ ]>(CArray:D \array, Callable:D $block) is raw is export(:DEFAULT, :types) {
nqp::stmts(
(my $*INDEX = 'Effective index'),
array[$block.pos(array)]
......
{
"name": "rakudo-js",
"bugs": {
"url:": "https://github.com/perl6/nqp/issues",
"email": "pawelmurias@gmail.com"
},
"licenses": [{
"type": "Artistic 2",
"url": "http://opensource.org/licenses/Artistic-2.0"
}],
"private": true,
"repository": "http://github.com/perl6/nqp/"
}
......@@ -491,7 +491,7 @@ sub add-sink-to-final-call($parent, $pos, $qast = $parent[$pos]) {
elsif nqp::istype($qast, QAST::Want) {
add-sink-to-final-call($parent, $pos, $qast[0])
}
elsif nqp::istype($qast, QAST::Op) && $qast.op eq 'call' {
elsif nqp::istype($qast, QAST::Op) && $qast.op eq 'call' && !$qast.nosink {
$parent[$pos] := QAST::Op.new: :op<callmethod>, :name<sink>, $qast
}
}
......@@ -1327,21 +1327,26 @@ class Perl6::Actions is HLL::Actions does STDActions {
$unit.name('<unit>');
$outer.name('<unit-outer>');
# Load the needed libraries.
$*W.add_libs($unit);
# If the unit defines &MAIN, and this is in the mainline,
# add a &MAIN_HELPER.
if !$*W.is_precompilation_mode && +(@*MODULES // []) == 0 && $unit.symbol('&MAIN') {
# add a call to &RUN-MAIN
if !$*W.is_precompilation_mode
&& !$*INSIDE-EVAL
&& +(@*MODULES // []) == 0
&& $unit.symbol('&MAIN') -> $main {
$mainline := QAST::Op.new(
:op('call'),
:name('&MAIN_HELPER'),
QAST::WVal.new( # $*IN as $*ARGSFILES
value => $*W.find_symbol: [
'Bool', $*W.lang-ver-before('d') ?? 'False' !! 'True'
]),
$mainline,
:op('call'),
:name('&RUN-MAIN'),
QAST::WVal.new(:value($main<value>)),
$mainline # run the mainline and get its result
);
unless $*W.lang-ver-before('d') {
$mainline.push(
QAST::WVal.new( # $*IN as $*ARGSFILES
value => $*W.find_symbol(['Bool','True'], :setting-only),
:named('in-as-argsfiles')
)
);
}
}
# If our caller wants to know the mainline ctx, provide it here.
......@@ -1984,7 +1989,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
# We'll install PAST in current block so it gets capture_lex'd.
# Then evaluate to a reference to the block (non-closure - higher
# up stuff does that if it wants to).
($*W.cur_lexpad())[0].push(my $uninst := QAST::Stmts.new($block));
$*W.push_inner_block(my $uninst := QAST::Stmts.new($block));
Perl6::Pod::document($/, $*DECLARAND, $*POD_BLOCK, :leading);
$*W.attach_signature($*DECLARAND, $signature);
$*W.finish_code_object($*DECLARAND, $block);
......@@ -2238,7 +2243,6 @@ class Perl6::Actions is HLL::Actions does STDActions {
if $*LABEL {
my $label := QAST::WVal.new( :value($*W.find_symbol([$*LABEL])), :named('label') );
$past[0].push($label);
$past[2].push($label);
}
$past[2].sunk(1);
my $sinkee := $past[0];
......@@ -3091,7 +3095,9 @@ class Perl6::Actions is HLL::Actions does STDActions {
method contextualizer($/) {
my $past := $<coercee>.ast;
if $<sigil> eq '$' && ~$<coercee> eq '' { # for '$()'
my $has_magic := $*W.lang-ver-before('d') && $<coercee> eq '';
if $has_magic && $<sigil> eq '$' { # for '$()'
my $result_var := $past.unique('sm_result');
$past := QAST::Stmt.new(
# Evaluate RHS and call ACCEPTS on it, passing in $_. Bind the
......@@ -3127,7 +3133,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
~$<sigil> eq '%' ?? 'hash' !!
'item';
# @() and %()
$past := QAST::Var.new( :name('$/'), :scope('lexical') ) if ~$<coercee> eq '';
$past := QAST::Var.new( :name('$/'), :scope('lexical') ) if $has_magic;
$past := QAST::Op.new( :op('callmethod'), :name($name), $past );
}
......@@ -3570,7 +3576,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}