MoeOrganization / moe

An -OFun prototype of an Ultra Modern Perl 5
http://moe.iinteractive.com
MIT License
278 stars 46 forks source link

Add support for __FILE__ #112

Open stevan opened 11 years ago

stevan commented 11 years ago

We should refactor the way we handle parsing of files so that we can keep track of the filename in the CompilationUnit AST node, this can then set FILE when it is evaluated.

jjl commented 11 years ago

On 13 May 2013, at 00:35, Stevan Little notifications@github.com wrote:

We should refactor the way we handle parsing of files so that we can keep track of the filename in the CompilationUnit AST node, this can then set FILE when it is evaluated.

We should support idioms like flock(FILE) by making it a real FH as it is in p5

stevan commented 11 years ago

@jjl I was kind of trying to split the difference between Perl 5 and Perl 6 and make NAME a string (as it often is with Perl 5 (PACKAGE, etc)) and then $?NAME as the actual object (as it often is in Perl 5 ($?CLASS)). Which would mean that the file handle is actually in $?FILE maybe?