Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:rakudo/rakudo
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Lenz committed Sep 29, 2009
2 parents ec0ad78 + 0331d60 commit 9792a2e
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 40 deletions.
2 changes: 1 addition & 1 deletion build/PARROT_REVISION
@@ -1 +1 @@
41380
41447
1 change: 1 addition & 0 deletions build/gen_setting_pm.pl
Expand Up @@ -39,4 +39,5 @@ ()
" \%*INC<$_> = 1;\n Perl6::Compiler.import('$colon_form', ':DEFAULT', ':MANDATORY');\n"
} @classes);
print "}\n";
print "\n# vim: set ft=perl6 nomodifiable :\n";

5 changes: 5 additions & 0 deletions docs/ChangeLog
@@ -1,5 +1,10 @@
New in 2009-10 release
+ smolder reports for spectest runs
+ more Complex trig functions
+ some variants of the new series operator
+ correct construction of twigilled colonpairs
+ infix:<eqv>, .pred and .succ for the Rat type
+ when configuring with --gen-parrot, pass --optimize to parrot's Configure.pl

New in 2009-09 release
+ updates to numeric operators: infix</>(Int, Int) creates a Rat
Expand Down
5 changes: 3 additions & 2 deletions docs/release_guide.pod
Expand Up @@ -19,12 +19,12 @@ part of monthly Parrot releases.
2009-06-18 Rakudo #18 "Pittsburgh" (pmichaud)
2009-07-23 Rakudo #19 "Chicago" (moritz)
2009-08-20 Rakudo #20 "PDX" (kyle)
2009-09-17 Rakudo #21 "Seattle" (particle)

=head2 Planned 2009 releases

Dates are based on Parrot's expected release schedule.

2009-09-17 Rakudo #21 "Seattle" (particle)
2009-10-22 Rakudo #22 (duff)
2009-11-19 Rakudo #23 (masak)
2009-12-17 Rakudo #24 (chromatic)
Expand Down Expand Up @@ -62,7 +62,8 @@ release name, etc.
=item *

Verify that the Parrot trunk head is able to build Rakudo
and run the spectest suite.
and run the spectest suite. Also check the smolder reports
at L<http://tinyurl.com/rakudosmoke>.

=item *

Expand Down
2 changes: 1 addition & 1 deletion src/parser/actions.pm
Expand Up @@ -2919,7 +2919,7 @@ method colonpair($/, $key) {
if $<desigilname><longname> {
$pair_key := PAST::Val.new( :value( ~$<desigilname> ) );
$pair_val := PAST::Var.new(
:name( ~$<sigil> ~ ~$<twigil> ~ $<desigilname> )
:name( ~$<sigil> ~ ~$<twigil>[0] ~ $<desigilname> )
);
}
else {
Expand Down
4 changes: 2 additions & 2 deletions src/pmc/mutablevar.pmc
@@ -1,6 +1,6 @@
/*
$Id$
Copyright (C) 2001-2008, The Perl Foundation.
Copyright (C) 2001-2009, The Perl Foundation.

=head1 NAME

Expand Down Expand Up @@ -41,7 +41,7 @@ pmclass MutableVAR need_ext dynpmc group perl6_group {
PMC *scalar;
GET_ATTR_scalar(INTERP, SELF, scalar);
if (scalar)
Parrot_gc_mark_PObj_alive(INTERP, (PObj*)scalar);
Parrot_gc_mark_PMC_alive(INTERP, scalar);
}

VTABLE void destroy() {
Expand Down
10 changes: 5 additions & 5 deletions src/pmc/p6invocation.pmc
Expand Up @@ -115,10 +115,10 @@ static PMC *get_next_candidate(PARROT_INTERP, PMC *SELF, int check_only) {
pmclass P6Invocation need_ext dynpmc group perl6_group {
ATTR PMC *first_candidate;
ATTR PMC *candidate_list;
ATTR INTVAL position;
ATTR STRING *name;
ATTR PMC *search_list;
ATTR INTVAL resume_point;
ATTR INTVAL position;

VTABLE void init() {
PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_P6Invocation_attributes);
Expand All @@ -140,13 +140,13 @@ pmclass P6Invocation need_ext dynpmc group perl6_group {
GETATTR_P6Invocation_search_list(interp, SELF, search_list);
GETATTR_P6Invocation_name(interp, SELF, name);
if (!PMC_IS_NULL(first_candidate))
Parrot_gc_mark_PObj_alive(interp, (PObj*)first_candidate);
Parrot_gc_mark_PMC_alive(interp, first_candidate);
if (!PMC_IS_NULL(candidate_list))
Parrot_gc_mark_PObj_alive(interp, (PObj*)candidate_list);
Parrot_gc_mark_PMC_alive(interp, candidate_list);
if (!PMC_IS_NULL(search_list))
Parrot_gc_mark_PObj_alive(interp, (PObj*)search_list);
Parrot_gc_mark_PMC_alive(interp, search_list);
if (name)
Parrot_gc_mark_PObj_alive(interp, (PObj*)name);
Parrot_gc_mark_STRING_alive(interp, name);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/pmc/perl6multisub.pmc
Expand Up @@ -1099,7 +1099,7 @@ Marks the candidate list.
GETATTR_Perl6MultiSub_cache_single(interp, SELF, cache_single);
GETATTR_Perl6MultiSub_cache_many(interp, SELF, cache_many);
if (!PMC_IS_NULL(candidates))
Parrot_gc_mark_PObj_alive(interp, (PObj*)candidates);
Parrot_gc_mark_PMC_alive(interp, candidates);
if (cache_single)
Parrot_mmd_cache_mark(interp, cache_single);
if (cache_many)
Expand Down
14 changes: 9 additions & 5 deletions src/setting/Any-num.pm
Expand Up @@ -55,12 +55,12 @@ class Any is also {
}
}

our Num multi method !from-radians(Num $x, $base) {
our multi method !from-radians($base) {
given $base {
when /:i ^d/ { $x * 180/pi } # Convert to degrees.
when /:i ^g/ { $x * 200/pi } # Convert to gradians.
when /:i ^r/ { $x } # Convert to radians.
when Num { $x /(2 * pi) } # Convert to revolutions.
when /:i ^d/ { self * 180/pi } # Convert to degrees.
when /:i ^g/ { self * 200/pi } # Convert to gradians.
when /:i ^r/ { self } # Convert to radians.
when Num { self /(2 * pi) } # Convert to revolutions.
default { die "Unable to convert to base: $base" }
}
}
Expand Down Expand Up @@ -126,6 +126,10 @@ class Any is also {
self.Num.atan($base);
}

our Num multi method atan2($x = 1, $base = 'radians') is export {
self.Num.atan2($x, $base);
}

our Num multi method asec($base = 'radians') is export {
self.Num.asec($base);
}
Expand Down
43 changes: 38 additions & 5 deletions src/setting/Complex.pm
Expand Up @@ -103,13 +103,46 @@ multi sub infix:<**>($a, Complex $b) {
}

class Complex is also {
multi method sin($base = 'radians') {
$.re.sin($base) * $.im.cosh($base) + ($.re.cos($base) * $.im.sinh($base))i;
# multi method sin($base = 'radians') {
# $.re.sin($base) * $.im.cosh($base) + ($.re.cos($base) * $.im.sinh($base))i;
# }
#
# multi method cos($base = 'radians') {
# $.re.cos($base) * $.im.cosh($base) - ($.re.sin($base) * $.im.sinh($base))i;
# }

multi method cosec($base = 'radians') {
1.0 / self!to-radians($base).sin;
}

multi method cosech($base = 'radians') {
1.0 / self!to-radians($base).sinh;
}

multi method acosec($base = 'radians') {
(1.0 / self).asin!to-radians($base);
}

multi method cotan($base = 'radians') {
1.0 / self!to-radians($base).tan;
}
multi method cos($base = 'radians') {
$.re.cos($base) * $.im.cosh($base) - ($.re.sin($base) * $.im.sinh($base))i;

multi method cotanh($base = 'radians') {
1.0 / self!to-radians($base).tanh;
}

multi method acotan($base = 'radians') {
(1.0 / self).atan!to-radians($base);
}

multi method acosech($base = 'radians') {
(1.0 / self).asinh!to-radians($base);
}

multi method acotanh($base = 'radians') {
(1.0 / self).atanh!to-radians($base);
}

}

# vim: ft=perl6
3 changes: 3 additions & 0 deletions src/setting/IO.pm
Expand Up @@ -52,6 +52,9 @@ class IO is also {
$!PIO.readall();
}

multi method t() {
$!PIO.isatty;
}
}

multi sub lines(IO $filehandle,
Expand Down
27 changes: 14 additions & 13 deletions src/setting/Num.pm
Expand Up @@ -5,7 +5,7 @@ class Num is also {
$N1 = acos $N0
%r = box $N1
};
self!from-radians($r, $base)
$r!from-radians($base)
}
our Num multi method acosh($base = 'radians') is export {
Expand All @@ -18,7 +18,7 @@ class Num is also {
$N0 = ln $N0
%r = box $N0
};
self!from-radians($r, $base)
$r!from-radians($base)
}

our Num multi method acosec($base = 'radians') is export {
Expand All @@ -28,13 +28,14 @@ class Num is also {
$N2 = asin $N1
%r = box $N2
};
self!from-radians($r, $base)
$r!from-radians($base)
}
our Num multi method acosech($base = 'radians') is export {
# MUST: This is certainly wrong -- if nothing else,
# asinh also calls from-radians on its result.
self!from-radians(asinh(1/+self), $base)
# (Except it seems to be passing tests?)
asinh(1/+self)!from-radians($base)
}

our Num multi method acotan($base = 'radians') is export {
Expand All @@ -44,7 +45,7 @@ class Num is also {
$N2 = atan $N1
%r = box $N2
};
self!from-radians($r, $base)
$r!from-radians($base)
}
our Num multi method acotanh($base = 'radians') is export {
Expand All @@ -57,7 +58,7 @@ class Num is also {
$N4 = $N4 / 2
%r = box $N4
};
self!from-radians($r, $base)
$r!from-radians($base)
}

our Num multi method asec($base = 'radians') is export {
Expand All @@ -66,7 +67,7 @@ class Num is also {
$N1 = asec $N0
%r = box $N1
};
self!from-radians($r, $base)
$r!from-radians($base)
}
our Num multi method asech($base = 'radians') is export {
Expand All @@ -81,7 +82,7 @@ class Num is also {
$N1 = ln $N1
%r = box $N1
};
self!from-radians($r, $base)
$r!from-radians($base)
}

our Num multi method asin($base = 'radians') is export {
Expand All @@ -90,7 +91,7 @@ class Num is also {
$N1 = asin $N0
%r = box $N1
};
self!from-radians($r, $base)
$r!from-radians($base)
}
our Num multi method asinh($base = 'radians') is export {
Expand All @@ -103,7 +104,7 @@ class Num is also {
$N0 = ln $N0
%r = box $N0
};
self!from-radians($r, $base)
$r!from-radians($base)
}

our Num multi method atan($base = 'radians') is export {
Expand All @@ -112,7 +113,7 @@ class Num is also {
$N1 = atan $N0
%r = box $N1
};
self!from-radians($r, $base)
$r!from-radians($base)
}
our Num multi method atan2(Num $x = 1, $base = 'radians') is export {
Expand All @@ -123,7 +124,7 @@ class Num is also {
$N2 = atan $N0, $N1
%r = box $N2
};
self!from-radians($r, $base)
$r!from-radians($base)
}

our Num multi method atanh($base = 'radians') is export {
Expand All @@ -136,7 +137,7 @@ class Num is also {
$N0 /= 2
%r = box $N0
};
self!from-radians($r, $base)
$r!from-radians($base)
}
our Num multi method cos($base = 'radians') is export {
Expand Down

0 comments on commit 9792a2e

Please sign in to comment.