Forum: JRuby fully qualified path not possible?

Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2012-06-20 20:18
Should I expect the following to work?

require 'java'
class javax.swing.JFrame
end


Currently it results in

SyntaxError: (irb):6: syntax error, unexpected ';'

class javax.swing.JFrame; end
                        ^
        from org/jruby/RubyKernel.java:1088:in `eval'


I guess I'm forced to use "ruby style" syntax like

class javax::swing::JFrame; end

?
-r
40e5e9fe36a1f85166493faac2c17499?d=identicon&s=25 Hirotsugu Asari (Guest)
on 2012-06-20 20:20
(Received via mailing list)
class requires a constant, and "javax.swing.JFrame" doesn't look like
one.
13313ac2ec7ba7c43b1b952db034ff3b?d=identicon&s=25 Thomas E Enebo (Guest)
on 2012-06-21 15:55
(Received via mailing list)
however you can do:

class javax::swing::JFrame; end

It is too bad you need to resort to this (I do this quite a bit), but
we are living withing Ruby's syntax.

-Tom

On Wed, Jun 20, 2012 at 1:19 PM, Hirotsugu Asari <asari.ruby@gmail.com>
wrote:
>>
>>
>>
>
--
blog: http://blog.enebo.com   twitter: tom_enebo
mail: tom.enebo@gmail.com
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.