Changeset 5171
- Timestamp:
- 07/04/05 00:39:16 (4 years ago)
- svk:copy_cache_prev:
- 6965
- Location:
- src/perl6
- Files:
-
- 2 modified
-
Prelude.pm (modified) (3 diffs)
-
Prelude/PIR.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/perl6/Prelude.pm
r5143 r5171 21 21 # on p6-l. 22 22 23 multi sub open (Str $filename, Str +$layer, Bool +$r, Bool +$w, Bool +$rw, Bool +$a) returns IO is primitive is unsafe is export{23 multi sub open (Str $filename, Str +$layer, Bool +$r, Bool +$w, Bool +$rw, Bool +$a) returns IO is primitive is unsafe is builtin { 24 24 die "fancy open modes not supported yet" if $a & any($r, $w, $rw); 25 25 my $mode; … … 85 85 # (maybe :lang<YAML> doesn't quite belong here?) 86 86 multi sub eval (Str ?$code = $CALLER::_, Str +$lang = 'Perl6') 87 is primitive is safe is export{87 is primitive is safe is builtin { 88 88 given lc $lang { 89 89 when 'perl6' { Pugs::Internals::eval($code) }; … … 118 118 has Str $.params; # FIXME: needs attention; don't use yet. 119 119 120 multi sub caller (Class ?$kind = Any, Int +$skip = 0, Str +$label) returns Control::Caller is primitive is exportis safe {120 multi sub caller (Class ?$kind = Any, Int +$skip = 0, Str +$label) returns Control::Caller is primitive is builtin is safe { 121 121 my @caller = Pugs::Internals::caller($kind, $skip, $label); 122 122 -
src/perl6/Prelude/PIR.pm
r5001 r5171 3 3 4 4 # our &prefix:<?> := &true doesn't work yet. 5 sub prefix:<?> ($var) returns Bool is primitive { true $var }5 sub prefix:<?> ($var) returns Bool is builtin is primitive { true $var } 6 6 7 sub chomp (Str $str) returns Str is primitive {7 sub chomp (Str $str) returns Str is builtin is primitive { 8 8 # XXX return $str but newline("\n") 9 9 if substr($str, -1, 1) eq "\n" { … … 14 14 } 15 15 16 sub chop (Str $str is rw) returns Str is primitive {16 sub chop (Str $str is rw) returns Str is builtin is primitive { 17 17 if chars($str) == 0 { 18 18 undef; … … 24 24 } 25 25 26 sub sleep (Num $seconds) returns Num is primitive {26 sub sleep (Num $seconds) returns Num is builtin is primitive { 27 27 my $time = time; 28 28 Perl6::Internals::sleep $seconds; … … 31 31 } 32 32 33 sub exit (Int ?$status = 0) is primitive {33 sub exit (Int ?$status = 0) is builtin is primitive { 34 34 Perl6::Internals::exit $status; 35 35 } 36 36 37 sub Perl6::Internals::eval_parrot (Str $code) is primitive {37 sub Perl6::Internals::eval_parrot (Str $code) is builtin is primitive { 38 38 my $sub = substr($code, 0, 1) eq "." 39 39 ?? Perl6::Internals::compile_pir($code) … … 42 42 } 43 43 44 sub pi () returns Num is primitive {44 sub pi () returns Num is builtin is primitive { 45 45 3.14159265358979323846264338327950288419716939937510; 46 46 } 47 47 48 sub lcfirst (Str $str) returns Str is primitive {48 sub lcfirst (Str $str) returns Str is builtin is primitive { 49 49 lc(substr $str, 0, 1) ~ substr $str, 1, chars($str) - 1; 50 50 } 51 51 52 sub ucfirst (Str $str) returns Str is primitive {52 sub ucfirst (Str $str) returns Str is builtin is primitive { 53 53 uc(substr $str, 0, 1) ~ substr $str, 1, chars($str) - 1; 54 54 } 55 55 56 sub shift (@a) is primitive {56 sub shift (@a) is builtin is primitive { 57 57 my $top = +@a -1; 58 58 return undef if $top < 0; … … 67 67 68 68 # splice entirely untested. 69 sub splice (@a, ?$offset=0, ?$length, *@list) is primitive {69 sub splice (@a, ?$offset=0, ?$length, *@list) is builtin is primitive { 70 70 my $off = $offset; 71 71 my $len = $length;
