Skip to content

Commit

Permalink
Start playing with a CgOp type remapper
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Sep 30, 2010
1 parent b8b0f44 commit 3d28e35
Show file tree
Hide file tree
Showing 12 changed files with 203 additions and 192 deletions.
12 changes: 6 additions & 6 deletions lib/CORE.setting
Expand Up @@ -4,7 +4,7 @@ my module CORE;

sub slurp($path) {
Q:CgOp { (box Str (rawscall System.IO.File.ReadAllText
(unbox System.String (@ {$path})))) }
(unbox str (@ {$path})))) }
}
my class IO is Cool {
Expand All @@ -13,22 +13,22 @@ my class IO is Cool {
my class TextReader is IO {
method get() {
Q:CgOp { (box Str (rawcall (unbox System.IO.TextReader (@ {self}))
Q:CgOp { (box Str (rawcall (unbox clr:System.IO.TextReader (@ {self}))
ReadLine:m,System.String)) };
}

method slurp() {
Q:CgOp { (box Str (rawcall (unbox System.IO.TextReader (@ {self}))
Q:CgOp { (box Str (rawcall (unbox clr:System.IO.TextReader (@ {self}))
ReadToEnd:m,System.String)) };
}

method getc() {
Q:CgOp {
(letn chi (rawcall (unbox System.IO.TextReader (@ {self}))
(letn chi (rawcall (unbox clr:System.IO.TextReader (@ {self}))
Read:m,System.Int32)
(ternary (>= (l chi) (int 0))
(box Str (rawnew System.String
(cast System.Char (l chi)) (int 1)))
(box Str (rawnew str
(cast clr:System.Char (l chi)) (int 1)))
{Str}))
};
}
Expand Down

0 comments on commit 3d28e35

Please sign in to comment.