[MacRuby] #888: Compiled MacRuby can't read the DATA const for the text after __END__ in the source
#888: Compiled MacRuby can't read the DATA const for the text after __END__ in the source ---------------------------------+------------------------------------------ Reporter: dev@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ {{{ $ cat foo.rb #!/usr/bin/env macruby puts DATA.read __END__ lolcats $ macruby foo.rb lolcats $ macrubyc foo.rb -o foo $ ./foo uninitialized constant DATA (NameError) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/888> MacRuby <http://macruby.org/>
#888: Compiled MacRuby can't read the DATA const for the text after __END__ in the source ---------------------------------+------------------------------------------ Reporter: dev@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Changes (by lsansonetti@…): * milestone: MacRuby 0.7 => Comment: That's a problem. DATA is supposed to be a File object seeked to the end of the source file. I am not sure we really want to preserve this during AOT compilation. -- Ticket URL: <http://www.macruby.org/trac/ticket/888#comment:2> MacRuby <http://macruby.org/>
#888: Compiled MacRuby can't read the DATA const for the text after __END__ in the source ---------------------------------+------------------------------------------ Reporter: dev@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by dev@…): Hum, I didn't know about this implementation detail. But so it is. You can even rewind it and read the whole source. It may not make sense indeed, since the source is (sometimes on purpose) gone after compilation, and bunch of files may be linked together. Maybe make the string after __END__ available through some other means? Or just tell programmers not to use the data section in compiled programs? In case of the latter, at least an attempt to access DATA should have a more meaningful error. Maybe provide an object in the DATA constant, but any attempt to call a method on it will raise and explain that DATA is unavailable to compiled code. -- Ticket URL: <http://www.macruby.org/trac/ticket/888#comment:3> MacRuby <http://macruby.org/>
#888: Compiled MacRuby can't read the DATA const for the text after __END__ in the source ---------------------------------+------------------------------------------ Reporter: dev@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby Later Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Changes (by lsansonetti@…): * milestone: => MacRuby Later Comment: For Later. -- Ticket URL: <http://www.macruby.org/trac/ticket/888#comment:4> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby