ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-language
perl6-language
Re: BEGIN {...} and IO
by Ingo Blechschmidt other posts by this author
Aug 13 2005 10:10AM messages near this date
Re: BEGIN {...} and IO | Re: BEGIN {...} and IO
Hi,

Nicholas Clark wrote:
>  On Tue, Jun 14, 2005 at 07:56:32PM +0200, Ingo Blechschmidt wrote:
> > Maybe we should just hardcode the filehandles-leaking-into-runtime
> > case in the compiler? And, if the compiler can't detect the problem
> > at compile-time, just throw a runtime exception?
> > 
> >     my $fh = BEGIN { open "some_file" };
> >     =$fh;  # "Can't readline() on unopened filehandle leaked
> >            # from compile-time into runtime, try to..."
>  
>  Aren't filehandles just part of a more general case of the compiler
>  serialising something out to the bytecode on disk that can't actually
>  be serialised? So the attempt at serialisation of a file handle,
>  directory handle, database handle, shared memory handle or any other
>  external resource should fail? (Unless that resource class has a
>  viable serialise/deserialise system)

yep. So my question is: How can I tell the Perl 6 compiler how it can
serialize my special object? How can I ask it to not serialize my
special object?

BTW, is it even necessary to support user-defined serializing
behaviours? (After all, an Item can only be an Int, Num, Str, Ref, Bit,
Pair, Junc, Type, Code, Undef, and Object in PIL2 [1].)


--Ingo

[1] http://svn.openfoundry.org/pugs/src/PIL/Val.hs

-- 
Linux, the choice of a GNU | Row, row, row your bits, gently down the
generation on a dual AMD   | stream...  
Athlon!                    | 
Thread:
Ingo Blechschmidt
Nicholas Clark
Ingo Blechschmidt
Yuval Kogman

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved