develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34650 - trunk/languages/lua/src/lib

From:
fperrad
Date:
December 30, 2008 07:10
Subject:
[svn:parrot] r34650 - trunk/languages/lua/src/lib
Message ID:
20081230151034.167B3CB9FA@x12.develooper.com
Author: fperrad
Date: Tue Dec 30 07:10:29 2008
New Revision: 34650

Modified:
   trunk/languages/lua/src/lib/luaio.pir

Log:
[Lua] io
- refactor io.tmpfile() with a StringHandle PMC

Modified: trunk/languages/lua/src/lib/luaio.pir
==============================================================================
--- trunk/languages/lua/src/lib/luaio.pir	(original)
+++ trunk/languages/lua/src/lib/luaio.pir	Tue Dec 30 07:10:29 2008
@@ -606,8 +606,6 @@
 Returns a handle for a temporary file. This file is open in update mode and
 it is automatically removed when the program ends.
 
-TODO: rewrite with a StringHandle
-
 =cut
 
 .sub 'tmpfile'
@@ -616,13 +614,11 @@
     .local pmc res
     new $P0, 'Lua'
     $S0 = $P0.'tmpname'()
-    f = new 'FileHandle'
+    f = new 'StringHandle'
     push_eh _handler
     f.'open'($S0, 'w+')
     pop_eh
     res = newfile(f)
-    new $P0, 'OS'
-    $P0.'rm'($S0)
     .return (res)
   _handler:
     new res, 'LuaNil'



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About