Permalink
Browse files

[STD] start carping about undef

[CORE] trim pi and e to fit into Rat


git-svn-id: http://svn.pugscode.org/pugs@29182 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 4cdc7b7 commit b998a5d0f235c6980ed67415122021ca20fbb6fa lwall committed Nov 24, 2009
Showing with 8 additions and 8 deletions.
  1. +3 −3 CORE.setting
  2. +5 −5 STD.pm
View
6 CORE.setting
@@ -72,9 +72,9 @@ my class Version { }
my role Numeric { }
my class Num {
- # XXX, would these generate FatRats, and is that bad?
- constant pi is export = 3.14159_26535_89793_23846_26433_83279_50288;
- constant e is export = 2.71828_18284_59045_23536_02874_71352_66249;
+ # for now, limit denominator to one quintillion to fit in Rat64.
+ constant pi is export = 3.14159_26535_89793_238; # 46_26433_83279_50288;
+ constant e is export = 2.71828_18284_59045_235; # 36_02874_71352_66249;
constant i is export = 1i;
}
import Num <pi e i>;
View
10 STD.pm
@@ -84,10 +84,10 @@ our $ALL;
=end notes
-method TOP ($STOP = undef) {
+method TOP ($STOP = '') {
my $lang = self.cursor_fresh( ::STD::P6 );
- if defined $STOP {
+ if $STOP {
my $*GOAL ::= $STOP;
$lang.unitstop($STOP).comp_unit;
}
@@ -1007,7 +1007,7 @@ token ws {
[
| \h+ <![#\s\\]> { @*MEMOS[$¢.pos]<ws> = $startpos; } # common case
| <?before \w> <?after \w> :::
- { @*MEMOS[$startpos]<ws> = undef; }
+ { @*MEMOS[$startpos]<ws>:delete; }
<.panic: "Whitespace is required between alphanumeric tokens"> # must \s+ between words
]
||
@@ -1020,7 +1020,7 @@ token ws {
{{
if ($¢.pos == $startpos) {
- @*MEMOS[$¢.pos]<ws> = undef;
+ @*MEMOS[$¢.pos]<ws>:delete;
}
else {
@*MEMOS[$¢.pos]<ws> = $startpos;
@@ -3041,7 +3041,7 @@ grammar P6 is STD {
[ <?before \h*<sigil><twigil>?\w >
<.obs('undef as a verb', 'undefine function')>
]?
- <O(|%term)>
+ <.obs('undef as a value', "one of:\n Object or Nil as an empty value,\n !*.defined as a matcher,\n Any:U as a type constraint\n or fail() as a failure return\n")>
}
token term:sym<continue>

0 comments on commit b998a5d

Please sign in to comment.