Skip to content

Instantly share code, notes, and snippets.

@colomon
Created October 3, 2011 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colomon/1259443 to your computer and use it in GitHub Desktop.
Save colomon/1259443 to your computer and use it in GitHub Desktop.
ConstructorInfo twriter_open = typeof(StreamWriter).GetConstructor(new Type[1] { Tokens.String });
thandlers["twriter_open"] = delegate(CpsOp[] z) {
return CpsOp.Widen(typeof(TextWriter),
CpsOp.ConstructorCall(twriter_open, z)); };
multi sub open($filename, :$w) is unsafe {
Q:CgOp { (box TextWriter (twriter_open (obj_getstr {$filename}))) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment