Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[my first niecza commit] implement 'now' as per Synopsis 02
  • Loading branch information
mberends committed Mar 13, 2011
1 parent af2dab4 commit 543ebb3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/CLRBackend.cs
Expand Up @@ -3184,6 +3184,7 @@ class NamProcessor {
thandlers["bif_mul"] = SimpleB("Mul");
thandlers["bif_divide"] = SimpleB("Divide");
thandlers["bif_not"] = SimpleB("Not");
thandlers["bif_now"] = SimpleB("GetNow");
thandlers["bif_negate"] = SimpleB("Negate");
thandlers["bif_chars"] = SimpleB("Chars");
thandlers["bif_substr3"] = SimpleB("Substr3");
Expand Down
5 changes: 4 additions & 1 deletion lib/CORE.setting
Expand Up @@ -1187,7 +1187,10 @@ sub spew($path,$text) is unsafe { Q:CgOp { (rnull (spew (unbox str (@ {$path.Str
my class Instant {
has $.val;
method to-posix() { $!val }
method to-posix() { ($!val, False) }
}
sub term:« now »() {
Instant.new( val => Q:CgOp { (bif_now) } );
}
my class IO {
Expand Down
1 change: 1 addition & 0 deletions src/CgOp.pm6
Expand Up @@ -38,6 +38,7 @@ method bif_minus (*@_) { self._cgop("bif_minus", @_) }
method bif_mul (*@_) { self._cgop("bif_mul", @_) }
method bif_negate (*@_) { self._cgop("bif_negate", @_) }
method bif_not (*@_) { self._cgop("bif_not", @_) }
method bif_now () { self._cgop("bif_now") }
method bif_num (*@_) { self._cgop("bif_num", @_) }
method bif_numand ($n1, $n2) { self._cgop("bif_numand", $n1, $n2) }
method bif_numcompl ($n) { self._cgop("bif_numcompl", $n) }
Expand Down

0 comments on commit 543ebb3

Please sign in to comment.