Skip to content

Implemented support for keyword and keywordrest proc /lambda parameters#2492

Merged
headius merged 2 commits intojruby:masterfrom
Who828:2489_fix
Jan 21, 2015
Merged

Implemented support for keyword and keywordrest proc /lambda parameters#2492
headius merged 2 commits intojruby:masterfrom
Who828:2489_fix

Conversation

@Who828
Copy link
Contributor

@Who828 Who828 commented Jan 21, 2015

Fixes #2489 by adding support for keyword/keywordrest for proc/lambda parameters.

bin/jruby -e "p proc {|a, b = 1, *c, d, e:1, f:, **g|}.parameters"
#[[:opt, :a], [:opt, :b], [:rest, :c], [:opt, :d], [:key, :e], [:keyreq, :f], [:keyrest, :g]]
bin/jruby -e "p lambda {|a, b = 1, *c, d, e:1, f:, **g|}.parameters"
#[[:req, :a], [:opt, :b], [:rest, :c], [:req, :d], [:key, :e], [:keyreq, :f], [:keyrest, :g]]

@enebo
Copy link
Member

enebo commented Jan 21, 2015

@Who828 for next PR remember that single line if statements should always have curly braces { } unless if is entirely on one line (e.g. if (foo) bar();)

@Who828
Copy link
Contributor Author

Who828 commented Jan 21, 2015

@enebo Sure, fixed them for this PR.

headius added a commit that referenced this pull request Jan 21, 2015
Implemented support for keyword and keywordrest proc /lambda parameters
@headius headius merged commit f7cf5a4 into jruby:master Jan 21, 2015
@headius
Copy link
Member

headius commented Jan 21, 2015

Awesome, thank you.

@headius headius added this to the 9.0.0.0.pre2 milestone Jan 21, 2015
@headius headius self-assigned this Jan 21, 2015
@Who828 Who828 deleted the 2489_fix branch January 21, 2015 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proc.parameters return an empty array

3 participants