Skip to content

Commit

Permalink
Merge branch 'nom' into newio
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Feb 18, 2015
2 parents c386f34 + 9a54f1b commit 9a2ba03
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/ChangeLog
Expand Up @@ -16,7 +16,7 @@ New in 2015.02
+ Metaop "=" now respects the precedence of the op it's meta-ing
+ Enable term definitions via "my", e.g., "my \term:<∞> = Inf"
+ Added "polymod" method on numerical values
+ Made simple Str.trans / tr/// about 20x faster
+ Made simple Str.trans / tr///, Str.subst about 20x faster
+ File test operators now follow symlinks on systems that support them
+ New method Rational.base-repeating, optional precision argument for Real.base
+ Blob.bytes now returns actualy byte size, even for non-byte blobs
Expand Down
5 changes: 3 additions & 2 deletions docs/release_guide.pod
Expand Up @@ -14,7 +14,6 @@ end of this document.

=head2 Planned future releases

2015-02-19 Rakudo #85 lizmat
2015-03-19 Rakudo #86
2015-04-23 Rakudo #87 Coke
2015-05-21 Rakudo #88
Expand Down Expand Up @@ -319,8 +318,10 @@ You're done! Celebrate with the appropriate amount of fun.
2014-09-18 Rakudo #80 "HongKong" (masak)
2014-10-23 Rakudo #81 "Linz" (duff)
2014-11-20 Rakudo #82 "Helsinki" (lizmat)
2014-12-18 Rakudo #82 "Cologne" (lizmat)
2014-12-18 Rakudo #83 "Cologne" (lizmat)
2014-12-19 2014.12.1 (lizmat)
2015-01-22 Rakudo #84 "Gotanda" (Coke)
2015-02-19 Rakudo #85 "Parrotopia" (lizmat)

=head1 COPYRIGHT

Expand Down
2 changes: 1 addition & 1 deletion lib/NativeCall.pm
Expand Up @@ -119,7 +119,7 @@ sub guess_library_name($libname) {
elsif $libname ~~ /\.so(\.<.digit>+)+$/ { $libname }
elsif $*VM.config<load_ext> :exists { $libname ~ $*VM.config<load_ext> }
elsif $*VM.config<nativecall.so> :exists {
if $*DISTRO.name eq 'darwin' {
if $*KERNEL.name eq 'darwin' {
($libname ~ '.' ~ $*VM.config<nativecall.so>).IO.absolute
}
else {
Expand Down
3 changes: 2 additions & 1 deletion src/core/CompUnitRepo/Local/Installation.pm
Expand Up @@ -106,14 +106,15 @@ sub MAIN(:$name, :$auth, :$ver, *@pos, *%named) {
}
else {
if $file ~~ /^bin<[\\\/]>/ {
my $is-win := $*DISTRO.is-win;
mkdir "$path/bin" unless "$path/bin".IO.d;
my $basename = $file.IO.basename;
my $withoutext = $basename;
$withoutext.=subst(/\.[exe|bat]$/, '');
for '', < -p -j -m > -> $be {
"$path/bin/$withoutext$be".IO.spurt:
$perl_wrapper.subst('#name#', $basename, :g).subst('#perl#', "perl6$be");
if $*DISTRO.is-win {
if $is-win {
"$path/bin/$withoutext$be.bat".IO.spurt:
$windows_wrapper.subst('#perl#', "perl6$be");
}
Expand Down
13 changes: 8 additions & 5 deletions src/core/Inc.pm
Expand Up @@ -63,6 +63,7 @@

# normal start up
else {
my %ENV := %*ENV; # only look up environment once
my $I := nqp::atkey(nqp::atkey(%*COMPILING, '%?OPTIONS'), 'I');
if nqp::defined($I) {
if nqp::islist($I) {
Expand All @@ -74,9 +75,11 @@
}
}

my $path-sep := $*DISTRO.path-sep;
add-curs(%*ENV<RAKUDOLIB>, $path-sep) if %*ENV<RAKUDOLIB>;
add-curs(%*ENV<PERL6LIB>, $path-sep) if %*ENV<PERL6LIB>;
if %ENV<RAKUDOLIB> || %ENV<PERL6LIB> {
my $path-sep := $*DISTRO.path-sep;
add-curs(%ENV<RAKUDOLIB>, $path-sep) if %ENV<RAKUDOLIB>;
add-curs(%ENV<PERL6LIB>, $path-sep) if %ENV<PERL6LIB>;
}

#?if jvm
for nqp::jvmclasspaths() -> $path {
Expand Down Expand Up @@ -120,8 +123,8 @@
# XXX Various issues with this stuff on JVM
my Mu $compiler := nqp::getcurhllsym('$COMPILER_CONFIG'); # TEMPORARY
try {
if %*ENV<HOME>
// (%*ENV<HOMEDRIVE> // '') ~ (%*ENV<HOMEPATH> // '') -> $home {
if %ENV<HOME>
// (%ENV<HOMEDRIVE> // '') ~ (%ENV<HOMEPATH> // '') -> $home {
my $ver := nqp::p6box_s(nqp::atkey($compiler, 'version'));
if CompUnitRepo::Local::File.new("$home/.perl6/$ver/lib") -> $cur {
@INC.push: $cur;
Expand Down
48 changes: 34 additions & 14 deletions src/core/Str.pm
Expand Up @@ -1157,22 +1157,42 @@ my class Str does Stringy { # declared in BOOTSTRAP
my int $i;

# something to convert to
if $to.chars {
my str $sto = nqp::unbox_s(expand($to));
my int $sfl = nqp::chars($sfrom);
my int $found;

$sto = $sto ~ $sto while nqp::islt_i(nqp::chars($sto),$sfl);
if $to.chars -> $tochars {
nqp::setelems($result,$chars);

while nqp::islt_i($i,$chars) {
$check = nqp::substr($str,$i,1);
$found = nqp::index($sfrom,$check);
nqp::bindpos_s($result, $i, nqp::iseq_i($found,-1)
?? $check
!! nqp::substr($sto,$found,1)
);
$i = $i + 1;
# all convert to one char
if $tochars == 1 {
my str $sto = nqp::unbox_s($to);

while nqp::islt_i($i,$chars) {
$check = nqp::substr($str,$i,1);
nqp::bindpos_s(
$result, $i, nqp::iseq_i(nqp::index($sfrom,$check),-1)
?? $check
!! $sto
);
$i = $i + 1;
}
}

# multiple chars to convert to
else {
my str $sto = nqp::unbox_s(expand($to));
my int $sfl = nqp::chars($sfrom);
my int $found;

# repeat until mapping complete
$sto = $sto ~ $sto while nqp::islt_i(nqp::chars($sto),$sfl);

while nqp::islt_i($i,$chars) {
$check = nqp::substr($str,$i,1);
$found = nqp::index($sfrom,$check);
nqp::bindpos_s($result, $i, nqp::iseq_i($found,-1)
?? $check
!! nqp::substr($sto,$found,1)
);
$i = $i + 1;
}
}
}

Expand Down

0 comments on commit 9a2ba03

Please sign in to comment.