Last active
December 11, 2015 11:48
-
-
Save lukaszkorecki/4596308 to your computer and use it in GitHub Desktop.
Would be cool if this was possible. I know(ish) why it's hard to do.... But it would be cool :-)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ok a ; puts "ok #{a} " ; end | |
ok 1 # => "ok 1" | |
def yo a ; puts "yo #{a}" ; end | |
yo 1 # => "yo 1" | |
ok(a), yo(b) = [1,2] # => exception! | |
a , b = [1,2]; ok(a) ; yo(b) # => meh! |
hm, for example in Sinatra:
get '/lolz' do
# something
body(b), status(x) = return_body_and_status(some_data)
end
or some cool processing stuff like
[ a.reverse, b.downcase = ["ab", "AA"] ].reduce("") { |c,i| c + i } # => "baaa"
As long as it would be quite a nice feature, I think it would also mess with the code readability. At least from my pythonic point of view :). BTW, it doesn't work in Python, too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Interesting but how often would you use it?