[jruby-user] keyword arg support

134 views
Skip to first unread message

Charles Monteiro

unread,
Jun 7, 2013, 5:51:00 PM6/7/13
to Jruby Users List List
aka named arguments which are available in Ruby 2.0

my question is will that only be available when Jruby supports lang level 2.0 ? If so, then what's the ETA for that ?

thanks

Charles Monteiro
jr...@smallruby.com




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Charles Oliver Nutter

unread,
Jun 8, 2013, 12:32:56 AM6/8/13
to us...@jruby.codehaus.org

It is partially working in JRuby 1.7.5, but there are a lot of cases that need work. Give it a try and let us know if you have issues (--2.0 flag).

- Charlie (mobile)

Charles Monteiro

unread,
Jun 8, 2013, 5:28:34 AM6/8/13
to us...@jruby.codehaus.org
ok thanks will do, can I rvm 1.7.5 ? Rubymine does not show 2.0  as a lang level for the 1.7.4 sdk which I obtained via rvm

Charles Monteiro


Charles Monteiro

unread,
Jun 8, 2013, 5:41:19 AM6/8/13
to us...@jruby.codehaus.org
interesting here is what rvm lists as know Jrubies:

# JRuby
jruby-1.2.0
jruby-1.3.1
jruby-1.4.0
jruby-1.6.5.1
jruby-1.6.6
jruby-1.6.7.2
jruby-1.6.8
jruby[-1.7.3]
jruby-head

but i retrieved 1.7.4 via rvm , will I get 1.7.5 via dvm jruby-head ?

thanks
 
Charles Monteiro


Charles Oliver Nutter

unread,
Jun 8, 2013, 12:11:47 PM6/8/13
to jruby-user
Oops, sorry...I mistyped. It is partially working in JRuby *1.7.4*.
1.7.5 is current master.

So, try out 1.7.4 and report issues.

- Charlie

Charles Monteiro

unread,
Jun 10, 2013, 12:14:16 PM6/10/13
to us...@jruby.codehaus.org
Charlie:

I tried 1.7.4 and jruby-head i.e. both via RVM installs and within Rubymine, both fail to recognize the keyword arg syntax, and in both cases Rubymine does not provide a lang level option of 2.0 , not sure where it looks to pick up the options


Charles Monteiro
jr...@smallruby.com

Uwe Kubosch

unread,
Jun 12, 2013, 2:12:25 PM6/12/13
to us...@jruby.codehaus.org
Hi!

The language levels in RubyMine are hard-coded. You should file an issue to get them to add the "2.0" level.

Until RubyMine adds the "2.0" language level, you can add "--2.0" in "Edit configurations…" => <your app> => Configuration => Ruby arguments

That will run your app in Ruby 2.0 mode.
--
Uwe Kubosch
u...@kubosch.no
http://kubosch.no/

Charles Monteiro

unread,
Jun 12, 2013, 4:32:05 PM6/12/13
to us...@jruby.codehaus.org
thank you so much, works fine. Rubymine will also keep complaining about the syntax and i don't seem to be able to turn that off an an inspection

Charles Monteiro
jr...@smallruby.com

Charles Oliver Nutter

unread,
Jun 12, 2013, 10:22:35 PM6/12/13
to us...@jruby.codehaus.org

I'm guessing they don't have 2.0 syntax support yet *at all* so hopefully it will be coming soon.

Glad to hear kwargs are at least functional for you! Let us know of you run into any issues.

- Charlie (mobile)

Charles Monteiro

unread,
Jun 13, 2013, 10:50:32 AM6/13/13
to us...@jruby.codehaus.org
they appear to have support for 2.0 but in MRI

and I will let you know since will now code with keyword args as default

Charles Monteiro


Charles Oliver Nutter

unread,
Jun 13, 2013, 12:24:34 PM6/13/13
to us...@jruby.codehaus.org

I didn't think they used a different parser for MRI versus JRuby, but perhaps they actually disable 2.0 support on JRuby because it did not support 2.0 stuff until recently.

- Charlie (mobile)

Reply all
Reply to author
Forward
0 new messages