apeiros_ changed the topic of #ruby-lang to: Ruby 2.0.0-p0: http://ruby-lang.org (Ruby 1.9.3-p392) || Paste >3 lines of text on http://gist.github.com
yankeefan04 has joined #ruby-lang
MartynKeigher has joined #ruby-lang
<TheNotary> .each is fine in jQuery too. I wonder where I picked up this myth..
<whitequark> 1.8?
<TheNotary> where ever it came from it's now washed from my mind =)
yankeefan04 has quit [Remote host closed the connection]
torrieri has quit [Quit: Leaving...]
marr has quit [Ping timeout: 252 seconds]
ruby-lang479 has joined #ruby-lang
ruby-lang479 has left #ruby-lang [#ruby-lang]
ootoovak has quit [Quit: ootoovak]
krohrbaugh has joined #ruby-lang
mwjcomputing has joined #ruby-lang
bzalasky has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 256 seconds]
idkazuma has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
Guest51459 has joined #ruby-lang
soknee has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
nXqd has quit [Ping timeout: 252 seconds]
soknee has quit [Client Quit]
wmoxam has joined #ruby-lang
ootoovak has joined #ruby-lang
torrieri has joined #ruby-lang
Guest51459 has quit [Quit: leaving]
Bosox20051 has joined #ruby-lang
dingus_khan has joined #ruby-lang
ykk` has quit [Remote host closed the connection]
ykk` has joined #ruby-lang
Andromeda has joined #ruby-lang
amerine has quit [Quit: Computer has gone to sleep.]
amerine has joined #ruby-lang
amerine has quit [Client Quit]
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
torrieri has quit [Quit: Leaving...]
soknee has joined #ruby-lang
soknee has quit [Client Quit]
mytrile has quit [Remote host closed the connection]
benanne has quit [Quit: kbai]
soknee has joined #ruby-lang
baba has quit [Ping timeout: 245 seconds]
megha has joined #ruby-lang
Erlkoenig has quit [Quit: Leaving.]
<dingus_khan> I'm sorry for what is probably a really stupid question, but I'm in that head space where I can't tell up from left: when defining a method, is it alright to have separate single-condition if statements (no elsif's), each exiting the method if their condition is met, and then methods below those that continue to evaluate the arguments passed in?
ykk` has quit [Remote host closed the connection]
<whitequark> mbj: ping
<micaeked> dingus_khan: Yes.
soknee has quit [Quit: Leaving.]
<dingus_khan> whew, thanks, lol. also, right on about the for loops up above--I first programmed in C++ a long time ago, so I got kinda use to them, but it seems like "idiomatic" ruby is more important over slight performance gains, and I'll admit I like it when it's readable, lol
<micaeked> dingus_khan: Yep. Also, no performance gains.
<dingus_khan> oh word? I thought someone mentioned that--I've no idea one way or another, just that each-do looks better, hah. now I just have to stop putting parens everywhere, apparently!
krohrbaugh has joined #ruby-lang
<micaeked> dingus_khan: I actually use parens. I like it better that way.
<whitequark> dingus_khan: each..do is actually marginally faster.
<whitequark> by a few %
<dingus_khan> well good then, I'll take your word for it! the parens though, aren't there cases where they're a bad thing?
<whitequark> dingus_khan: what are you talking about?
r0bglees0n has quit [Ping timeout: 260 seconds]
krohrbaugh has quit [Ping timeout: 246 seconds]
<micaeked> dingus_khan: I have not found any yet. Personally, they make reading code much easier.
r0bby has quit [Read error: Connection reset by peer]
r0bby has joined #ruby-lang
<dingus_khan> whoops, nevermind, I had that backwards--yes on parens more often than not, according to Eloquent Ruby.
zachlatta has quit [Ping timeout: 245 seconds]
woollyams has joined #ruby-lang
r0bgleeson has joined #ruby-lang
crynix has joined #ruby-lang
Fantaz has joined #ruby-lang
crynix has quit [Remote host closed the connection]
tylersmith has joined #ruby-lang
wmoxam has quit [Ping timeout: 248 seconds]
wmoxam has joined #ruby-lang
mchang has joined #ruby-lang
symm- has quit [Ping timeout: 245 seconds]
<mchang> howdy - anyone here to help me with a quick ruby regexp question? (har har)
<Gaelan> mchang: What's wrong?
<mchang> input string, one line: <aresponse><bresponse><cresponse>
sv has joined #ruby-lang
sv has quit [Changing host]
sv has joined #ruby-lang
meizaps_ has quit [Ping timeout: 256 seconds]
dhruvasagar has joined #ruby-lang
<mchang> regexp help: http://rubular.com/r/i4AuoZTd51 works, but not in my actual ruby interpreter
discopig has quit [Ping timeout: 264 seconds]
crackity_jones has quit [Quit: Computer has gone to sleep.]
meizaps has joined #ruby-lang
dingus_khan has quit [Ping timeout: 245 seconds]
<whitequark> weird
<whitequark> post your code?
krohrbaugh has joined #ruby-lang
<mchang> whitequark: /<([^>]*)(response)[^>]*>/.match("<aresponse><bresponse><cresponse>")
<mchang> whitequark: => #<MatchData "<aresponse>" 1:"a" 2:"response">
<mchang> I think I'm not understanding matching multiple times on the same line...
<mchang> er... wrong code
<mchang> whitequark: /<([^>]*)response[^>]*>/.match("<aresponse><bresponse><cresponse>")
<whitequark> >> "<aresponse><bresponse><cresponse>".scan /<([^>]*)response[^>]*>/
<eval-in> whitequark => [["a"], ["b"], ["c"]] (http://eval.in/15264)
<mchang> wat. (looks up scan)
krohrbaugh has quit [Ping timeout: 252 seconds]
<mchang> omg thanks whitequark
mwjcomputing has quit [Ping timeout: 240 seconds]
mrfjor has quit [Ping timeout: 245 seconds]
TheNotary has quit [Ping timeout: 240 seconds]
cored has quit [Ping timeout: 256 seconds]
cored has joined #ruby-lang
crackity_jones has joined #ruby-lang
Andromeda has quit [Read error: Connection reset by peer]
plains has quit [Ping timeout: 245 seconds]
Andromeda has joined #ruby-lang
postmodern has quit [Quit: Leaving]
wmoxam has quit [Ping timeout: 240 seconds]
crackity_jones has quit [Quit: Computer has gone to sleep.]
Glass_saga has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 276 seconds]
krohrbaugh has joined #ruby-lang
crackity_jones has joined #ruby-lang
sailias has quit [Quit: Leaving.]
krohrbaugh has quit [Ping timeout: 276 seconds]
mchang has quit [Remote host closed the connection]
tylersmith has quit [Quit: tylersmith]
Gaelan has quit [Remote host closed the connection]
Fantaz has quit []
woollyams has quit [Quit: Computer has gone to sleep.]
bzalasky has joined #ruby-lang
chessguy has quit [Remote host closed the connection]
bushido has quit [Ping timeout: 245 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
bzalasky has quit [Remote host closed the connection]
crackity_jones has quit [Quit: Computer has gone to sleep.]
dhruvasagar has quit [Read error: Operation timed out]
ootoovak has quit [Quit: ootoovak]
dhruvasagar has joined #ruby-lang
crackity_jones has joined #ruby-lang
r0bby has quit [Ping timeout: 276 seconds]
plains has joined #ruby-lang
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
crackity_jones has quit [Quit: Computer has gone to sleep.]
crackity_jones has joined #ruby-lang
Bosox20051 has quit [Quit: Leaving]
cored has quit [Ping timeout: 252 seconds]
crackity_jones has quit [Quit: Computer has gone to sleep.]
Gaelan has joined #ruby-lang
mbj_ has joined #ruby-lang
amerine has joined #ruby-lang
mbj has quit [Ping timeout: 248 seconds]
Gaelan has quit [Ping timeout: 264 seconds]
crynix has joined #ruby-lang
amerine has quit [Ping timeout: 255 seconds]
Gaelan has joined #ruby-lang
ootoovak has joined #ruby-lang
musl has quit [Read error: Connection reset by peer]
musl has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 245 seconds]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
setmeaway has quit [Quit: Leaving]
dhruvasagar has joined #ruby-lang
Gaelan has quit [Ping timeout: 264 seconds]
crynix has quit [Remote host closed the connection]
breakingthings has quit []
hramrach has quit [Ping timeout: 276 seconds]
hramrach has joined #ruby-lang
kain has quit [Quit: exit]
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Read error: Operation timed out]
rippa has joined #ruby-lang
<rue> For bonus points, add named captures
kgrz has joined #ruby-lang
vlad_starkov has joined #ruby-lang
znz_jp has quit [Quit: kill -QUIT $$]
znz_jp has joined #ruby-lang
<whitequark> yorickpeterse: 99.33% grammar coverage
Gaelan has joined #ruby-lang
xxaM has quit [Ping timeout: 260 seconds]
Gaelan has quit [Ping timeout: 276 seconds]
ryez has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 256 seconds]
wallerdev has quit [Quit: wallerdev]
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Client Quit]
bzalasky has joined #ruby-lang
ledestin has quit [Quit: ledestin]
ledestin has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
xxaM has joined #ruby-lang
plains has quit [Read error: Operation timed out]
kgrz has quit [Quit: Computer has gone to sleep.]
oguzbilgic has joined #ruby-lang
nXqd has joined #ruby-lang
kgrz has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 276 seconds]
dhruvasagar has joined #ruby-lang
tbuehlmann has joined #ruby-lang
amerine has joined #ruby-lang
tsion has joined #ruby-lang
amerine has quit [Ping timeout: 256 seconds]
Gaelan has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
ootoovak has quit [Quit: ootoovak]
Gaelan has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Read error: Connection reset by peer]
<tsion> whitequark: What version of rbx (and what Ruby mode)? I don't get that behaviour.
<tsion> Oh strange. I do. But let me show you this:
<tsion> FIrst I have def foo(*args); args; end
<tsion> >> foo(*[1,2,3], [4, 5, 6])
<tsion> => [1, 2, 3, [4, 5, 6]]
<eval-in> tsion => /tmp/execpad-1b4fa406c830/source-1b4fa406c830:2:in `<main>': undefined method `foo' for main:Object (NoMethodError) (http://eval.in/15270)
<tsion> .>> a = [1,2,3]; b = [4,5,6]; foo(*a, b)
<tsion> => [1, 2, 3, 4, 5, 6]
<tsion> It doesn't act the same with literals vs variables.
dhruvasagar has joined #ruby-lang
mistym has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
<whitequark> weird
vlad_starkov has joined #ruby-lang
<whitequark> tsion: can you confirm that this triggers the issue? I'd add this to the bugreport
<whitequark> p([*[1,2,3], [4,5,6]])
<whitequark> a = [1,2,3]; b = [4,5,6]; p([*a, b])
<tsion> Nope, in both of those cases it works correctly.
<whitequark> oh, so it's specific to function arguments
<tsion> Yep, it seems so.
krohrbaugh has joined #ruby-lang
<whitequark> so... def foo(*args); p args; end; foo(*[1,2,3], [4,5,6]); a = [1,2,3]; b = [4,5,6]; foo(*a, b)
<whitequark> is broken then?
<tsion> Yes, the foo(*a, b) is broken.
<tsion> I'm examining the bytecode for "a = [1,2,3]; b = [4,5,6]; foo(*a, b)" and it's somewhat bewildering.
dc5ala has joined #ruby-lang
<whitequark> bewildering?
<tsion> I don't understand why some parts of it are there at all. It checks if b is a Hash.
skade has joined #ruby-lang
<whitequark> errr
<whitequark> 2.0 kwargs?
<tsion> Maybe. I'm in 1.9-mode, but maybe...
krohrbaugh has quit [Ping timeout: 245 seconds]
<whitequark> though it's not the responsibility of the caller
<whitequark> by any measure
<tsion> In foo(a, b) it doesn't do the check if its a Hash
vlad_starkov has quit [Remote host closed the connection]
dhruvasagar has quit [Read error: Operation timed out]
dhruvasagar has joined #ruby-lang
woollyams has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
swav has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 248 seconds]
dhruvasagar has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
sush24 has joined #ruby-lang
robbyoconnor has joined #ruby-lang
fsvehla has joined #ruby-lang
solars has joined #ruby-lang
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby-lang
marr has joined #ruby-lang
jastix has joined #ruby-lang
jastix has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
intellitech has quit [Ping timeout: 256 seconds]
Gaelan has quit [Ping timeout: 256 seconds]
skade has quit [Quit: Computer has gone to sleep.]
krohrbaugh has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
<whitequark> grrr, why is rubyforge down
Andromeda has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby-lang
marr has quit [Read error: Connection reset by peer]
intellitech has joined #ruby-lang
skade has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
sush24 has quit [Quit: This computer has gone to sleep]
Luwe has joined #ruby-lang
solars has quit [Ping timeout: 276 seconds]
charliesome has joined #ruby-lang
oguzbilgic has quit [Quit: leaving]
face has quit [Ping timeout: 264 seconds]
kiddorails has joined #ruby-lang
face has joined #ruby-lang
solars has joined #ruby-lang
amerine has joined #ruby-lang
amerine has quit [Ping timeout: 256 seconds]
Luwe has quit [Ping timeout: 240 seconds]
chao has joined #ruby-lang
Luwe has joined #ruby-lang
kiddorails has quit [Read error: Connection reset by peer]
kiddorails has joined #ruby-lang
megha has quit [Ping timeout: 252 seconds]
security has joined #ruby-lang
lsegal has quit [Ping timeout: 245 seconds]
mbj_ has quit [Quit: leaving]
benanne has joined #ruby-lang
mbj has joined #ruby-lang
kiddorails has quit [Quit: Leaving.]
kiddorails has joined #ruby-lang
Gaelan has joined #ruby-lang
Gaelan has quit [Ping timeout: 248 seconds]
krohrbaugh has joined #ruby-lang
Gaelan has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 256 seconds]
solars has quit [Ping timeout: 255 seconds]
Gaelan has quit [Ping timeout: 256 seconds]
woollyams has joined #ruby-lang
woollyams has quit [Remote host closed the connection]
woollyams has joined #ruby-lang
woollyams has quit [Client Quit]
vlad_starkov has quit [Remote host closed the connection]
<ddfreyne> whitequark: How is your `parser` different from `ruby_parser`?
Burgestrand has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
solars has joined #ruby-lang
postmodern has joined #ruby-lang
vlad_starkov has joined #ruby-lang
kiddorails has quit [Quit: Leaving.]
kiddorails has joined #ruby-lang
kiddorails has quit [Read error: Connection reset by peer]
kiddorails has joined #ruby-lang
kiddorails has quit [Read error: Connection reset by peer]
kiddorails has joined #ruby-lang
<whitequark> ddfreyne: 2.0 support in a few days, much better AST, precise source maps
kiddorails has quit [Quit: Leaving.]
kiddorails has joined #ruby-lang
amerine has joined #ruby-lang
amerine has quit [Read error: Connection reset by peer]
amerine has joined #ruby-lang
sush24 has joined #ruby-lang
idkazuma has joined #ruby-lang
marr has joined #ruby-lang
Luwe has quit [Quit: leaving]
kiddorails has quit [Quit: Leaving.]
kiddorails has joined #ruby-lang
kiddorails has quit [Read error: Connection reset by peer]
kiddorails has joined #ruby-lang
<whitequark> ddfreyne: ... nice diagnostics, also.
<whitequark> and recovery from parsing errors.
idkazuma has quit [Remote host closed the connection]
<whitequark> and it handles *all* 1.9 syntax (RP fails on e.g. -> f={} {}
<whitequark> and readable source :)
<tsion> -> f={} {} doesn't seem to work in Ruby itself
<whitequark> er
<whitequark> >> ->(f={}) {}
<eval-in> whitequark => #<Proc:0x40c49588@/tmp/execpad-269325ca7317/source-269325ca7317:2 (lambda)> (http://eval.in/15288)
dc5ala has quit [Quit: Ex-Chat]
<whitequark> plus, I completely rewrote the lexer. it should now be much faster and generally hackable. also, documented.
<whitequark> practially everything is different :D
dc5ala has joined #ruby-lang
maxmanders has joined #ruby-lang
krohrbaugh has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
krohrbaugh has quit [Ping timeout: 245 seconds]
Luwe has joined #ruby-lang
idkazuma has joined #ruby-lang
Burgestrand has left #ruby-lang [#ruby-lang]
Burgestrand has joined #ruby-lang
fosky has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 245 seconds]
Luwe has quit [Quit: leaving]
kiddorails has quit [Ping timeout: 252 seconds]
meizaps has quit [Ping timeout: 256 seconds]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
solars has quit [Read error: Operation timed out]
skade has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
meizaps has joined #ruby-lang
vlad_starkov has joined #ruby-lang
marr has quit [Ping timeout: 246 seconds]
fsvehla has quit [Quit: fsvehla]
dhruvasagar has quit [Ping timeout: 255 seconds]
solars has joined #ruby-lang
dhruvasagar has joined #ruby-lang
chendo has joined #ruby-lang
apeiros has quit [Ping timeout: 264 seconds]
kke_ has quit [Quit: Reconnecting]
kgrz has joined #ruby-lang
kke has joined #ruby-lang
maxmanders has joined #ruby-lang
<kke> what are the cool kids using to handle zips these days?
mbj has quit [Ping timeout: 245 seconds]
<whitequark> libarchive bindings?
Gaelan has joined #ruby-lang
Gaelan has quit [Ping timeout: 255 seconds]
idkazuma has quit [Remote host closed the connection]
kgrz has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Operation timed out]
dhruvasagar has joined #ruby-lang
<charliesome> kke: remember if you can't find suitable libraries, shelling out is always a valid option
idkazuma has joined #ruby-lang
setmeaway has joined #ruby-lang
<kke> seems like our big blob of legacy mess is using every possible variation
<whitequark> burn it
<canton7> kke, Zip::ZipFile is the best I've found
<kke> rubyzip, shell zip, zip:zipfile
<whitequark> collect it all into a big heap, and set it on fire. then watch and relaaaax
<charliesome> canton7: i've seen rubyzip break some zip archives that the zip command line util handles fine
<TTilus> whitequark: accurate source mapping is pure awesome!
<whitequark> TTilus: well duh
<whitequark> I'm planning to write an article with a few examples of rewriting
<kke> whitequark: does it involve burninating?
<charliesome> whitequark: how does your parser perform?
<whitequark> like "make an automated aligner of = signs on consecutive lines" in 10 ruby loc
<whitequark> charliesome: runs on every possible platform, parses complete 1.8 syntax
<charliesome> whitequark: performance wise
<whitequark> charliesome: depends
<whitequark> gimme a big heap of 1.8.7 code and I'll say ya
<whitequark> actually nevermind I can just make it parse itself
<TTilus> whitequark: =D
<whitequark> the autogenerated lexer is about 7KLOC
<whitequark> half of that is tables
<TTilus> generated with?
<whitequark> TTilus: ragel
<TTilus> ok
<whitequark> ragel is awesome
<TTilus> ive been told
<whitequark> I'm fairly certain it is not possible to write a ruby lexer in anything else
<whitequark> I've used almost every single feature ragel's grammars provide
<whitequark> nondeterministic actions, embeddable exit and pass-thru actions, stream walking, stack, etc
<TTilus> uh-oh
<TTilus> that sounds almost like parsing perl
<charliesome> at least parsing ruby isn't turing complete
<whitequark> please do not mention anything like that. I already have PTSD from ruby :/
<kke> std?
<whitequark> you could call it that way, too
meise has quit [Quit: leaving]
<whitequark> hah, it cannot parse itself
<whitequark> "parser, parse thyself"
symm- has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
<whitequark> hah, I'm faster than RP
srbaker has joined #ruby-lang
<whitequark> like this:
srbaker has quit [Client Quit]
<whitequark> ruby_parser 2.280000 0.090000 2.370000 ( 2.366882)
<whitequark> parser 1.720000 0.000000 1.720000 ( 1.725297)
<whitequark> though this will probably change to a certain extent when I actually collect all the location information I want to collect
workmad3 has joined #ruby-lang
<charliesome> whitequark: lazy question
srbaker has joined #ruby-lang
<whitequark> charliesome: hm?
<charliesome> is ragel good at generating lexers that you can feed input into
<whitequark> yep, it totally supports streaming input
<charliesome> cool
<whitequark> yep
<charliesome> i tried writing some of that shit by hand and i was all like nope
<whitequark> actually, you need not use it just for lexers
idkazuma has quit [Remote host closed the connection]
<whitequark> you can use ragel to define state transitions in the logic of your programs
<whitequark> it's like AASM but on some seriously cool drugs
<whitequark> (string):8:44: error: unexpected token tNL
<whitequark> # type start token interpolate?
<whitequark> ^
<whitequark> go home parser, you're drunk :/
chendo_ has joined #ruby-lang
sanjeev has joined #ruby-lang
Gaelan has joined #ruby-lang
sanjeev_ has joined #ruby-lang
symm- has quit [Ping timeout: 256 seconds]
sanjeev has left #ruby-lang [#ruby-lang]
krohrbaugh has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
srbaker has quit [Quit: Computer has gone to sleep.]
<yorickpeterse> you mean your code is drunk
<yorickpeterse> and in ther words, you
<yorickpeterse> * other
mbj has joined #ruby-lang
Gaelan has quit [Ping timeout: 248 seconds]
<whitequark> no it got drunk by itself
<whitequark> like, totally on its own
<yorickpeterse> suuure
<charliesome> how could would it be to be able to un-include modules
<whitequark> yorickpeterse: also. remember that time I spent half a hour incorporating precise location reporting for tNLs?
<whitequark> LOL
<charliesome> s/could/good/
krohrbaugh has quit [Ping timeout: 252 seconds]
sanjeev_ has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
vlad_starkov has joined #ruby-lang
slick has joined #ruby-lang
slick has quit [Remote host closed the connection]
chessguy has joined #ruby-lang
sanjeev has joined #ruby-lang
wmoxam has joined #ruby-lang
Gaelan has quit [Ping timeout: 260 seconds]
<r0bgleeson> charliesome: you can do that in pure Ruby core but there's also C extensions to do it as well. I donno how useful it is. I've needed to do it only once.
<r0bgleeson> the pure Ruby version I found very hard to make thread safe
sanjeev has quit [Remote host closed the connection]
sailias has joined #ruby-lang
mbj has quit [Ping timeout: 245 seconds]
mbj has joined #ruby-lang
al_besimi has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 276 seconds]
wmoxam has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
<al_besimi> ________ ,d888888888b, ________
<al_besimi> """" _.-;' ,dP"' `"Qb, _.-'.' """"
<al_besimi> .' < ,d88buP" "Qud88b, < .'
<al_besimi> `> `, dP" .::8 _ :.@; _ ;@.: _ 8::. "Qb `, `>
<al_besimi> `. `. dP" 8' .. .. `8 "Qb \ `.
<al_besimi> /' / ,8' .::dP" `.' "Qb::. `8, /' /'
<al_besimi> /' `\ dP .:::8( `--^--' )8:::. Qb `\ /'
<al_besimi> `-,_ `\ 8' ::::"Qba,.., ,..,adP":::: `8 `-,_
<al_besimi> ~-. /' ,8 ::::::,p`"" ""'q,:::::: 8, /' ~-.
<al_besimi> _-'/' ,d' .:::::,d' `b,:::::. `b,/' _-'
<al_besimi> ,-' `\ ,d' .::::::d' `b::::::. `b\ .-'
<al_besimi> `-,_ `\,d' q888q8b,8 ,p q, 8,d8p888p `b,\`-.
<al_besimi> `-,. d' d", ; `b, 8, ,8 ,d' ; ,"b `b `. `-,.
<al_besimi> .' ,8 8 ` ` `b, `b, ,d' ,d' ' ' 8 8 ,' .'
<al_besimi> ,' / q, `b, `b a88a. .a88a d' ,d' ,p/ ,'
<al_besimi> < `. `q, `b, 8 8.8 8 ,d" ,p'. <
<al_besimi> `. ; `"Q888`b, `Q8888P" "Q8888P' ,d'888P"' ; `.
<al_besimi> _____ `_' "Q888P" "Q888P" `._; ____
<al_besimi> """""""" """""""
postmodern has quit [Quit: Leaving]
<whitequark> what the fuuck
<whitequark> please don't do that.
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
workmad3 has joined #ruby-lang
<whitequark> also this:
<whitequark> $ ./bin/benchmark lib/parser/lexer.rb user system total real
<whitequark> parser 2.410000 0.000000 2.410000 ( 2.414168)
<whitequark> ruby_parser 6.450000 0.070000 6.520000 ( 6.523504)
thisirs has joined #ruby-lang
<charliesome> https://github.com/charliesome/alias_blocker check it out yo
<whitequark> charliesome: alias is awesome
<mbj> whitequark: nice result. Would love to see how it performes against ripper and rbx
<charliesome> whitequark: alias makes me sad
<whitequark> mbj: zenspider claims that RP is 2x slower than MRI
<bougyman> charliesome: +1
<whitequark> if that's true, then I'm... faster than MRI?
<mbj> whitequark: hehe
<whitequark> that somehow seems unlikely
<mbj> whitequark: That would be awesome
<bougyman> there are very few legitimate reasons for alias, and a wealth of misuse, imo.
<bougyman> I highly approve of alias_blocker
<mbj> bougyman: Also aliases work very inconsistend if the aliased method gets overriden in a subclass
<whitequark> I'd rather see the `and` and `or` keywords dead
<whitequark> mbj: not "inconsistent". this is the point of aliasing.
<charliesome> whitequark: and and or are awesome
<bougyman> whitequark: I'd use 'unpredictable'
* whitequark hands charliesome "foo or baz and bar"
<bougyman> they become unpredictable the more layers you descend.
<whitequark> bougyman: wat?
<mbj> whitequark: I love and and or for branching statements
<bougyman> aliases, that is.
<charliesome> whitequark: "foo || baz && bar" is just as bad
<charliesome> i dunno which has precedence
<whitequark> charliesome: foo || baz && bar at least works correctly
<whitequark> and/or don't have precedence.
<whitequark> and they bind not tight enough
<bougyman> who cares if you use parens for grouping?
<charliesome> the point of using them is they have low precedence
<mbj> whitequark: I love this quote "if you have to use parentheses with and / or keywords you are useing them wrong"
<tsion> Whenever I've dealt with boolean logic, and always has higher precedence, so I would expect that.
<whitequark> charliesome: I'm talking relative
<whitequark> besides
<whitequark> when my parser is complete
<whitequark> I'll make a gem "unseattlerb"
<charliesome> haha excellent
<mbj> hehe
<whitequark> which removes then/do's, adds parens to defs and fixes and/or usage
<mbj> whitequark: a linter?
<charliesome> wait does seattlerb code seriously have then/do?
<whitequark> charliesome: all over the place
<bougyman> yes
<whitequark> mbj: no, a rewriter.
<whitequark> without any to_source magic, just some composition magic
<mbj> whitequark: nice
<whitequark> yeeeah
<whitequark> mbj: also, are you up to some coding? :)
al_besimi has quit [Quit: Leaving]
<whitequark> some parts in parser are in serious need of refactoring
<whitequark> I'd rather have a second opinion on that
<mbj> whitequark: currently doing the veritas to axiom renaming
<whitequark> also 97% test coverage
<mbj> whitequark: wow, nice!
<whitequark> and 100% grammar coverage
<whitequark> which I'm especially proud of
<mbj> whitequark: yeah
<mbj> whitequark: Any chance to have comments in the AST? Would love to build a to_source style ruby prettifier on top of your parser.
<whitequark> mbj: I'm not sure if a prettifier should use to_source
<whitequark> actually
<whitequark> I'm sure as hell it should not
<mbj> whitequark: why?
chimkan has quit [Quit: chimkan]
sepp2k has joined #ruby-lang
<whitequark> are you going to preserve whitespace, and vs &&, do/{, = alignment, etc etc etc?
<whitequark> with rewriting you only care about the parts you chang
<whitequark> *change
<whitequark> with to_source you have to care about everything
<whitequark> can you pretty-print heredocs as they were written in the original?
<bougyman> sure
<mbj> whitequark: this prettifier would output "my" style
<whitequark> heh
<whitequark> sure :)
<whitequark> haha, RP cannot even parse 1.8 stdlib
<mbj> s/prettifier/stylerewriter/
<tsion> whitequark: I seem to recall the stdlib having some pretty horrible code in it. That's funny though.
<whitequark> tsion: lemme extract the failing part
<whitequark> I wonder if I handle it correctly
<mbj> whitequark: Test your parser against /home/whitequark/**/*.rb ;)
<whitequark> mbj: 1.9 code mostly
<whitequark> and it parses itself already
<mbj> whitequark: nice, it should also generate itself soon!
<whitequark> heh
<mbj> whitequark: I'll do a new project "unparser" soon
<whitequark> mbj: it would be really nice if you could help with source maps
<mbj> whitequark: And base mutant on top, having lots of bug reports related to the RBX ast difficulties
srbaker has joined #ruby-lang
<whitequark> currently I do not compute them for compound nodes
<whitequark> also have you seen a bug I found in rbx? :3
judofyr has joined #ruby-lang
<judofyr> whitequark: how's parser coming along?
<whitequark> judofyr: 60% faster than RP, can parse itself
<judofyr> nice
<whitequark> now checking against 1.8 stdlib
<whitequark> RP fails :D
<mbj> whitequark: I also found lots of stuff I forgot about outside the stdlib in "rails" ;)
<mbj> whitequark: So check also against rails if you have the time.
<mbj> whitequark: Interesting RBX bug
<whitequark> omg I totally fail 1.8 stdlib
<judofyr> haha
<judofyr> how far away is 1.9 support?
<whitequark> judofyr: a day?
<judofyr> not bad
<whitequark> I just have to begin and end writing it
<judofyr> :)
<whitequark> srsly, 1.9 isn't that complex when you already have the lexer
<whitequark> and bison rules
<judofyr> I heard the massign got more complex
<whitequark> judofyr: more general
<whitequark> I dunno why rbx fails it that much
<judofyr> whitequark: has zenspider responded to your PR?
<whitequark> judofyr: nope yet
JohnBat26 has joined #ruby-lang
<whitequark> hmmm
<whitequark> (string):159:28: error: unexpected token tOP_ASGN if words.find{|x| x =~ /=/} then words.join('&') else words.join('+') end
<whitequark> so I misparse =~ /=/ as =~ divide_and_equal
<bougyman> funny, vim used to do the same
<whitequark> my parser is totally powered by vimscript
<judofyr> whitequark: anything I could do on parser?
<whitequark> judofyr: oh, yes
<whitequark> first you can look at the code and say where it could be better
<whitequark> second you can check out branch ruby19 and port some rules over from ruby18.y
<whitequark> they're like 80% same
<whitequark> *rule actions
<whitequark> heh, my bin/benchmark has P (parser) and RP (ruby_parser)
<whitequark> the P=RP problem :D
<mbj> whitequark: lol
<whitequark> fixed 3 failures in stdlib due to "class<<self" being treated as heredoc
<whitequark> as opposed to "class <<self"
<whitequark> (don't ask)
<whitequark> judofyr: I've just rebased ruby19 on master, btw
CorpusCallosum has joined #ruby-lang
<whitequark> some helpful hints: if you wanna look at the parsing process, or smth fails and you have no idea why
<whitequark> $ ./bin/explain-parse file.rb
<judofyr> whitequark: what do you store in Source::Map?
<whitequark> judofyr: please refer to the AST_FORMAT.md file. all nodes should ideally have a Source::Map or its subclass
<whitequark> for example, array's Source::Map subclass should have #expression, which covers the entire node, and #begin and #end, which point to the starting and ending token
<judofyr> ah, right
<whitequark> also a possible target for hacking on :3
<judofyr> you use classes instead of a Hash?
MaddinXx has joined #ruby-lang
<whitequark> yes. memory consumption.
<whitequark> I aim to have as little overhead as possible and optimize for clever runtimes (Rbx, jruby) which compactify stable ivar layouts
MaddinXx has quit [Remote host closed the connection]
tbuehlmann has quit [Remote host closed the connection]
<whitequark> it's still going to be pretty fat, but I have some optimizations in mind if that becomes a problem
<judofyr> whitequark: there's no source map that includes "begin"/"end" yet?
<whitequark> judofyr: yep
<whitequark> I haven't had any time to hack on source maps yet.
<whitequark> all the infrastructure is there, you should just add the relevant stuff to the node composition in builders/default.rb
<whitequark> I think it contains a single example
idkazuma has joined #ruby-lang
<whitequark> ah, no, not anymore
<judofyr> `def t` adds a source map
idkazuma has quit [Remote host closed the connection]
<whitequark> well, the point is that for a composite node, you get the relevant range--for an array that would be either lparen..rparen, or elems[0]..elems[-1], and do the #join on the Source::Range's
<judofyr> whitequark: but the attributes in the AST is still stored as a Hash? or do you use a subclass for that too? *checks*
<whitequark> judofyr: a subclass
<whitequark> Parser::AST::Node
<whitequark> it's just assigned thru a hash and I'm going to fix that
<whitequark> that's some useless byte shuffling
ruby-lang966 has joined #ruby-lang
<judofyr> whitequark: have you done any diag work? are the classes used?
<whitequark> judofyr: absolutely, see assert_diagnoses in test_parser.rb
<whitequark> I have 100% coverage for parser diagnostics and a few of lexer ones are covered too
<charliesome> whitequark: mri also has some smarts when it comes to looking up ivars vs. looking up keys in a hash
<whitequark> charliesome: yeah
<judofyr> whitequark: I'll port some ruby18 to ruby19 then
<whitequark> judofyr: awesome, thanks!
<whitequark> tip: fix compstmt at the begin of .y, then begin from the end of file
<whitequark> it's easier this way
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
heftig has quit [Quit: Quitting]
<judofyr> whitequark: ruby19.y should use @builder like ruby18, right? direct access to #s is deprecated?
<whitequark> judofyr: direct access to #s is exception :)
chimkan has joined #ruby-lang
<whitequark> yeah
<judofyr> I noticed :)
<judofyr> a very hard deprecation :P
<whitequark> it's much cleaner with @builder also
<whitequark> and I'm going to implement an RP compat mode probably
<whitequark> without all the niceties and all the parsetree crap
<whitequark> *and with
<whitequark> like 0 instead of s(:args)
<whitequark> (omg why)
* whitequark idly wonders why does he interpret %= at expr_beg as an tOP_ASGN
<whitequark> and I did that on purpose
<whitequark> ... and I have squashed the commits. damn.
wallerdev has joined #ruby-lang
<whitequark> >> %=foo=
<eval-in> whitequark => "foo" (http://eval.in/15289)
* whitequark shrugs
apeiros has joined #ruby-lang
heftig has joined #ruby-lang
swav has quit [Remote host closed the connection]
<yxhuvud> >> % foo
<eval-in> yxhuvud => /tmp/execpad-d7b66a7a226f/source-d7b66a7a226f:2: unterminated string meets end of file ... (http://eval.in/15290)
<yxhuvud> seems something stripped the trailing space. :(
chimkan has quit [Quit: chimkan]
<whitequark> >> % foo
<eval-in> whitequark => /tmp/execpad-cd0edf3ee292/source-cd0edf3ee292:2: unterminated string meets end of file ... (http://eval.in/15291)
<whitequark> heh
<tsion> >> % foo
<eval-in> tsion => /tmp/execpad-85590081b58d/source-85590081b58d:2: unterminated string meets end of file ... (http://eval.in/15292)
<tsion> Strange.
<tsion> What would be stripping that?
<ddfreyne> Why the heck does File.ftype return a *string* instead of a symbol?
<tsion> My IRC client, I suppose?
<ddfreyne> That makes no sense at all.
<whitequark> ddfreyne: also
<whitequark> >> foo=1; defined? foo
<eval-in> whitequark => "local-variable" (http://eval.in/15293)
<ddfreyne> whitequark: Yes, indeed
almost9 has joined #ruby-lang
krohrbaugh has joined #ruby-lang
<judofyr> whitequark: ruby19 is using `none` some places. should I keep that or use `# nothing` as in 18?
<whitequark> judofyr: when in doubt, keep rules as-is
<whitequark> also # nothing is what I put instead of "| <end of line>"
<whitequark> more clear this way
<rue> tsion: You have a PHP-scripted IRC client?
nXqd_ has joined #ruby-lang
<rue> ERB?
<tsion> rue: Sounds nightmarish.
nXqd has quit [Ping timeout: 256 seconds]
<whitequark> yay, down to 15 failures on 1.8 stdlib
<whitequark> it's broken in some rrrreally interesting ways
<whitequark> I'd even say exciting
krohrbaugh has quit [Ping timeout: 252 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
ddd has quit [Quit: restarting tmux]
<whitequark> fun thing: parser is much faster on ragel-generated code, ruby_parser is much faster on stdlib
nXqd has joined #ruby-lang
Luwe has joined #ruby-lang
<whitequark> I'm fairly sure the problem is how I dispatch strings: one character at a time and with lots of method calls
<judofyr> whitequark: what does this do: `foo: bar { result = … } baz quz { result = … }
mbj has quit [Ping timeout: 240 seconds]
Gaelan has joined #ruby-lang
ddd has joined #ruby-lang
chimkan_ has joined #ruby-lang
<whitequark> omg stdlib
<whitequark> str.gsub(/(\\[\[\]\-\\])|\\(.)|([\[\]\\])/) do
<whitequark> $1 || $2 || '\\' + $3
<whitequark> end
<whitequark> I mean this is TOTALLY CLEAR
nXqd_ has quit [Ping timeout: 264 seconds]
<tsion> That's beautiful.
almost9 has quit [Remote host closed the connection]
<tsion> You should see some of the code in my IRC bot that performs s/// replacements that users type.
ddd has quit [Client Quit]
<whitequark> also this:
<whitequark> str.scan(/(?:\\(.)|([^\\]))-(?:\\(.)|([^\\]))|(?:\\(.)|(.))/m) do
<tsion> whitequark: You should chmod +x bin/parse
<whitequark> tsion: right, have that in queue
swav has joined #ruby-lang
Gaelan has quit [Ping timeout: 256 seconds]
ddd has joined #ruby-lang
ddd has quit [Client Quit]
<tsion> Bundler keeps asking me to type my password to install rubygems, even though I have rubygems configured with --user-install. Any ideas?
mbj has joined #ruby-lang
ddd has joined #ruby-lang
swav has quit [Remote host closed the connection]
ddd has quit [Client Quit]
<whitequark> omg percent-strings :/
<whitequark> >> foo %{1}
<eval-in> whitequark => /tmp/execpad-a6fe1698a4d1/source-a6fe1698a4d1:2:in `<main>': undefined method `foo' for main:Object (NoMethodError) (http://eval.in/15294)
<whitequark> >> foo %[1]
<eval-in> whitequark => /tmp/execpad-e666edd2344f/source-e666edd2344f:2:in `<main>': undefined method `foo' for main:Object (NoMethodError) (http://eval.in/15295)
<whitequark> grrrr
<whitequark> >> p %{1}
<eval-in> whitequark => "1" ... (http://eval.in/15296)
<whitequark> >> p %=1=
<eval-in> whitequark => /tmp/execpad-53d4bcf2bfd4/source-53d4bcf2bfd4:2: syntax error, unexpected '=', expecting keyword_end (http://eval.in/15297)
* whitequark goes postal
<judofyr> whitequark: 148 errors left now (was 179 when I started)
<whitequark> judofyr: excellent, thanks :)
<judofyr> whitequark: it's mostly copy-paste :P
<judofyr> jesus, the argument parsing is massive
<whitequark> yea I know, designed it that way
<whitequark> YES
<judofyr> and block params
<whitequark> also the reasons it's massive is... welll...
<whitequark> it's in the article
<whitequark> but LALR(1) kinda sucks
<whitequark> LL(k) is much better
ddd has joined #ruby-lang
ddd has quit [Client Quit]
wallerdev has quit [Quit: wallerdev]
<whitequark> >> p /bar/
<eval-in> whitequark => /bar/ ... (http://eval.in/15298)
<whitequark> grrrr
kbouwser has joined #ruby-lang
ddd has joined #ruby-lang
<whitequark> >> / 42 /
<eval-in> whitequark => / 42 / (http://eval.in/15299)
<whitequark> argh
<ddd> ok i really do NOT understand wtf is going on suddenly. my tmux is overwriting the last line of channel text until I change to a different win and then back (this happens when the window is full and it would have to scroll to display the text)
kbouwser has left #ruby-lang [#ruby-lang]
<ddd> sorry, said that in a diff channel and accidently reposted here
security is now known as fire
Rich_Morin has joined #ruby-lang
jxie has quit [Quit: leaving]
<whitequark> >18:56 -!- security is now known as fire
<whitequark> lol.
mrfelix has joined #ruby-lang
<fire> whitequark: :P
chessguy has quit [Read error: Connection reset by peer]
chessguy has joined #ruby-lang
* whitequark headdesks
chessguy has quit [Read error: Connection reset by peer]
<whitequark> I just did the following testcase and was wondering why doesn't it work. On consecutive lines:
<whitequark> foo %=bar
<whitequark> foo /bar/
<whitequark> ... and /bar/ is suddenly tDIVIDE, tIDENTIFIER, etc
jxie has joined #ruby-lang
chessguy has joined #ruby-lang
<whitequark> whoever invented that snooping must be shot.
<whitequark> also: 11 failures on 1.8 stdlib.
ddd has quit [Quit: ok restarting with no tmux. just means I will disconnect when done]
ddd has joined #ruby-lang
maxmanders has joined #ruby-lang
tbuehlmann has joined #ruby-lang
Rich_Morin has left #ruby-lang [#ruby-lang]
a3li has quit [Ping timeout: 246 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
<judofyr> whitequark: I'm seeing a lot of `{ result = self.lexer.lineno }` which are then passed in as `line` later. is this needed with the Ragel-lexer?
<whitequark> judofyr: nope they're handled in builder
<whitequark> as you can see there are no such statements in ruby18.y
<whitequark> also note that {} appears as a token in the val array
<whitequark> so you should remove it if it's empty but don't forget about indexes
a3li has joined #ruby-lang
* whitequark thinks about writing an automated testcase reduction tool
<whitequark> aka 'bugpoint' in llvm
<whitequark> it does exactly that: points you at bugs.
Gaelan has joined #ruby-lang
<judofyr> hm. how does that work?
cored has quit [Ping timeout: 246 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
<whitequark> basically it performs binary search of the bug in the supplied code
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
dhruvasagar has joined #ruby-lang
<mbj> git bisect like on the source level
<whitequark> bugpoint is useful for proactively finding bugs in LLVM. Invoking bugpoint with the -find-bugs option will cause the list of specified optimizations to be randomized and applied to the program. This process will repeat until a bug is found or the user kills bugpoint.
<whitequark> <3
<whitequark> for gcc that would be "until a bug is found."
<whitequark> ok, a bug with ?. now only to check which one of EIGHT overloads in the grammar has handled that ?.
swav has joined #ruby-lang
<judofyr> 183 tests, 386 assertions, 1 failures, 100 errors, 0 skips
<whitequark> awesome
jet4fire has joined #ruby-lang
<whitequark> 6.
<judofyr> 6?
<whitequark> six failures in 1.8 stdlib
<judofyr> ah
krohrbaugh has joined #ruby-lang
<judofyr> nice
<mbj> whitequark: I'm very happy with parsers progress!
<mbj> I love the future, when I can drop the RBX ast ;)
<mbj> whitequark: And again big sorry there is no real contribution from my side. Had some indeterministic business issues here.
<whitequark> mbj: happens, yeah :/
<whitequark> omg a bug I missed because my editor strips trailing spaces
krohrbaugh has quit [Ping timeout: 264 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
maxmanders has joined #ruby-lang
sush24 has joined #ruby-lang
<whitequark> 4
<mbj> whitequark: BTW IMHO your parser is build with the deepest level of attention, unit-specs coverage etc. No other ruby parser does have these quality proving properties?
<whitequark> mbj: yep.
<whitequark> well, there's only one other ruby parser :)
<mbj> whitequark: nice, you already talked to some rbx guys if they'd like to adapt yours?
<whitequark> the MRI one. everyone else just translated it into their respective language
<whitequark> dbussink said that ruby_parser didn't cut it (OMG I'M SO SURPRISED) and it'd be nice to look how parser would work here
<mbj> heh
<whitequark> omg why date.rb
Andromeda has joined #ruby-lang
<whitequark> someone didn't know how `return` works?
workmad3 has joined #ruby-lang
<tsion> whitequark: That's totally insane...
<injekt> yet not surprising
<whitequark> it seems to be fixed in 2.0 by rewriting Date in C
<whitequark> I wonder if it uses setjmp/longjmp there
<r0bgleeson> whitequark: wow that's nuts.
<whitequark> this goes up to 1.9.2
<whitequark> also I did check and it does not use longjmp in the C impl
<whitequark> :p
<r0bgleeson> i wonder if that code use to have nested loops or something and never got updated properly
<r0bgleeson> otherwise im totally confused as to why it was done that way
<whitequark> def self.weeknum(y=1582, w=41, d=5, f=0, h=0, min=0, s=0, of=0, sg=ITALY) # :nodoc:
<mbj> whitequark: And I thought running mutant against rails is fun
Mon_Ouie has quit [Read error: Operation timed out]
jet4fire has left #ruby-lang [#ruby-lang]
<judofyr> whitequark: dinner now. going to continue working on it later. I'll probably send a PR tonight.
<whitequark> judofyr: thanks:)
ruby-lang966 has quit [Ping timeout: 245 seconds]
ddd has quit [Quit: Lost terminal]
swav has quit [Remote host closed the connection]
<whitequark> >> self*other.conjugate/other.abs2
<eval-in> whitequark => /tmp/execpad-1ff1e0f45b40/source-1ff1e0f45b40:2:in `<main>': undefined local variable or method `other' for main:Object (NameError) (http://eval.in/15307)
<whitequark> why is that not a regexp -_-
<whitequark> >> self*other.conjugate /other.abs2
<eval-in> whitequark => /tmp/execpad-2ac88edce31e/source-2ac88edce31e:2: syntax error, unexpected tREGEXP_BEG, expecting keyword_end ... (http://eval.in/15308)
<whitequark> oh so it is a regexp NOW. AWESOME
heftig has quit [Ping timeout: 245 seconds]
<whitequark> >> a%{1}
<eval-in> whitequark => /tmp/execpad-707c40d4017b/source-707c40d4017b:2: syntax error, unexpected '}', expecting => (http://eval.in/15309)
a3li has quit [Ping timeout: 248 seconds]
<whitequark> >> a<<EOS
<eval-in> whitequark => /tmp/execpad-9cbca93131e0/source-9cbca93131e0:2:in `<main>': undefined local variable or method `a' for main:Object (NameError) (http://eval.in/15310)
nXqd has quit [Ping timeout: 245 seconds]
Andromeda has quit [Remote host closed the connection]
heftig has joined #ruby-lang
<whitequark> >> a/1
<eval-in> whitequark => /tmp/execpad-05b938649859/source-05b938649859:2:in `<main>': undefined local variable or method `a' for main:Object (NameError) (http://eval.in/15311)
<whitequark> does that make sense to anyone?..
<whitequark> 2!
a3li has joined #ruby-lang
a3li has quit [Ping timeout: 246 seconds]
cored has quit [Ping timeout: 252 seconds]
a3li has joined #ruby-lang
<whitequark> hm
<whitequark> I might've found a bug in Ragel
randalla1ordon has left #ruby-lang [#ruby-lang]
<whitequark> no I just screwed up
aef_ has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 245 seconds]
tomzx_mac has joined #ruby-lang
aef has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
beiter has joined #ruby-lang
soknee has joined #ruby-lang
nXqd has joined #ruby-lang
a3li has quit [Ping timeout: 248 seconds]
cored has joined #ruby-lang
aef has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
a3li has joined #ruby-lang
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
gix has quit [Ping timeout: 264 seconds]
ddd has joined #ruby-lang
cored has quit [Ping timeout: 252 seconds]
looneydoodle has joined #ruby-lang
krohrbaugh has joined #ruby-lang
<looneydoodle> anyone know why i get "RuntimeError - unknown class: Time:"
<looneydoodle> though the class works fine in my console
<mbj> looneydoodle: "Time:" ? const_get ? (note the colon)
<ddd> looneydoodle: trying to access something under Time and only have ONE : rather than TWO?
sush24 has quit [Quit: This computer has gone to sleep]
<looneydoodle> def self.get_space(space_id, now = Time.now)
<looneydoodle> is my funciton definition
<looneydoodle> tryig to get records out of rails that are after a certain date
krohrbaugh has quit [Ping timeout: 246 seconds]
gix has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
bzalasky has joined #ruby-lang
chrismar035 has joined #ruby-lang
chrismar035 has quit [Client Quit]
apeiros has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
chessguy has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
soknee has quit [Quit: Leaving.]
xcombelle has joined #ruby-lang
<whitequark> it's done!
Luwe has quit [Ping timeout: 256 seconds]
<whitequark> trying to parse 2.0 stdlib
<whitequark> all fine except for one error: ahem
<whitequark> someone thought that this heredoc literal is a good idea: https://gist.github.com/whitequark/7b839a6fd49d85fb6ee9
soknee has joined #ruby-lang
blacktulip has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
<whitequark> what the hell...
<judofyr> whitequark: in ruby19.y there is no longer an `open_args`. instead `command_args` uses `call_args` directly. there's a bunch of code that unpacks `begin_t, args, end_t` from `command_args`, but I can't see where that information is now
<whitequark> judofyr: the idea behind that unpacking is to propagate the tokens of tLPAREN2 tRPAREN from their respective rules to the call site of @builder.call_method
<whitequark> I guess it should be clear now?
chao has left #ruby-lang [#ruby-lang]
<whitequark> if there are parens in call_args, pack them into the array and return it from call_args
<whitequark> if not, pack nils there
<whitequark> if call_args delegates parens to something else, repeat
<whitequark> protip: don't use pry when debugging weird whitespace issues. http://eval.in/15315
<mbj> whitequark: congratz on 1.8 stdlib parsing!
chimkan_ has quit [Quit: chimkan_]
Luwe has joined #ruby-lang
<whitequark> mbj: thanks! :)
<mbj> whitequark: Once we have a generator lets reproduce the stdlib and run tests ;)
<mbj> whitequark: Did this with veritas an captured some bugs in to_source this way
io_syl has joined #ruby-lang
<judofyr> f_args O_o
<judofyr> whitequark: thanks, I think I'll figure it out
fire has quit [Ping timeout: 245 seconds]
<whitequark> judofyr: what's about f_args?
baba has joined #ruby-lang
<judofyr> whitequark: it was just a bit funky :P
<whitequark> ... what in parse.y isn't?
mwjcomputing has joined #ruby-lang
<judofyr> touché
<judofyr> whitequark: I've discovered some tests that are actually (correct) syntax errors in 1.9. what should I do with those?
<whitequark> judofyr: add the fourth argument %w(1.8) and add the 1.9 counterpart, if applicable
<whitequark> (to assert_parses)
<whitequark> man
<whitequark> please don't make me add a special case for %-strings with \n as delimiter to handle a case where <<'HEREDOC' is terminated by a bare backslash, newline, and HEREDOC
<judofyr> whitequark: thanks. is there a way to "trace" the parser? I want to figure out what calls this non-terminal
<judofyr> (in this test case)
<whitequark> export RACC_DEBUG=1; rake regenerate; call the parser
<whitequark> ie ./bin/parse foo.rb
<judofyr> and down the rabbit we go
kgrz has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
<judofyr> 59 now
Swimming_Bird has joined #ruby-lang
<whitequark> hah, fixed that heredoc bullshit
setmeaway has quit [Quit: Leaving]
Luwe has quit [Quit: leaving]
Luwe has joined #ruby-lang
riotbit has joined #ruby-lang
<whitequark> huh, 2.0's optionparse has support for creating bash and zsh completion files
<whitequark> über cool
marr has joined #ruby-lang
<whitequark> but code :/
<whitequark> what does that ever do
srbaker has quit [Quit: Computer has gone to sleep.]
MaddinXx_ has joined #ruby-lang
Guest35746 has quit [Read error: Connection reset by peer]
Guest35746 has joined #ruby-lang
anildigital_work has quit [Ping timeout: 246 seconds]
cored has quit [Ping timeout: 246 seconds]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
<whitequark> judofyr: btw you might want to rebase
<whitequark> HEAD should handle everything you'll encounter in stdlib
meise has joined #ruby-lang
<judofyr> whitequark: done. at 49 now.
setmeaway has joined #ruby-lang
MaddinXx_ has quit [Remote host closed the connection]
Luwe has quit [Ping timeout: 260 seconds]
jvrmaia has joined #ruby-lang
jvrmaia has quit [Remote host closed the connection]
meise has quit [Quit: leaving]
meise has joined #ruby-lang
<judofyr> whitequark: is it okay to just do `result = val`, or do you prefer re-packing it?
<whitequark> judofyr: result = val is fine, *val is not
<whitequark> (the latter produces bugs plentifully)
<whitequark> judofyr: also note the 1.8 compat
<whitequark> you can't do [ *a, b ]
workmad3 has joined #ruby-lang
srbaker has joined #ruby-lang
soknee has quit [Quit: Leaving.]
srbaker has quit [Client Quit]
bzalasky has joined #ruby-lang
Luwe has joined #ruby-lang
realDAB has joined #ruby-lang
Luwe has quit [Client Quit]
benanne has quit [Quit: kbai]
toretore has joined #ruby-lang
workmad3 has quit [Ping timeout: 252 seconds]
ryez has quit [Ping timeout: 245 seconds]
krohrbaugh has joined #ruby-lang
<whitequark> judofyr: btw, when you finish with 1.9, wanna do the same with 2.0? :)
<whitequark> it's basically `cp ruby19.y ruby20.y` and porting rules from the diff on RXR
<whitequark> I've took care of the lexer already
<judofyr> whitequark: maybe. I need to do all the new 1.9 syntax too. are there already tests for that?
<whitequark> judofyr: I think there are tests for everything except stabby lambda and postargs in formal args / masgn
<whitequark> the coverage tools will tell you which rules are untested
<judofyr> whitequark: in 1.9 it appears that `break()` is parsed as `break` + compstmt. this causes the AST to be (break (nil)) because `()` is returns `(nil)`. is this okay?
<whitequark> judofyr: no, it isn't, but there's nothing you can do
<whitequark> I need to refactor the Builder quite badly
wmoxam has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
<judofyr> whitequark: how are you going to fix that without refactoring the grammar?
realDAB has quit [Quit: realDAB]
<whitequark> judofyr: short answer: this grammar produces correct results in ruby
krohrbaugh has quit [Ping timeout: 252 seconds]
<whitequark> long answer: there are things like arg_value, primary_value, etc. currently they are no-ops. they are needed for various evil hacks (begin end while, for one) and are vastly different in 1.8, 1.9 *and* 2.0
<whitequark> but the way they're handled in MRI and RP is unsatisfying
<whitequark> so I have to find a better one
<judofyr> okay. I'm not touching it then.
<judofyr> for now
sv is now known as discopig
<whitequark> yup...
setmeaway has quit [Ping timeout: 256 seconds]
<judofyr> whitequark: odd, fun(foo, :foo => 1, *bar) is valid in 1.8, but not 1.9
swav has joined #ruby-lang
<judofyr> ??
<judofyr> >> fun(foo, :foo => 1, *bar)
<eval-in> judofyr => /tmp/execpad-2b2fadddc66d/source-2b2fadddc66d:2: syntax error, unexpected *, expecting ')' ... (http://eval.in/15317)
<judofyr> oops
chimkan_ has joined #ruby-lang
<whitequark> judofyr: huh
<whitequark> 18>> fun(foo, :foo => 1, *bar)
<eval-in> whitequark => /tmp/execpad-c496e193e84f/source-c496e193e84f:2: undefined local variable or method `foo' for main:Object (NameError) (http://eval.in/15318)
<whitequark> odd.
adambeynon has joined #ruby-lang
apeiros has quit [Read error: Connection reset by peer]
wmoxam has quit [Ping timeout: 255 seconds]
<judofyr> whitequark: also: chmod +x bin/parse
apeiros has joined #ruby-lang
<whitequark> judofyr: already
<judofyr> oh
<whitequark> d'aww, zenspider's thing is not working again :(
<whitequark> this time it's gem gauntlet
<whitequark> wtf man
vlad_starkov has quit [Remote host closed the connection]
workmad3 has joined #ruby-lang
jhn has joined #ruby-lang
nertzy2 has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
nertzy3 has quit [Ping timeout: 264 seconds]
<judofyr> >> fun (1, 2)
<eval-in> judofyr => /tmp/execpad-4094533c96fd/source-4094533c96fd:2: syntax error, unexpected ',', expecting ')' ... (http://eval.in/15319)
jhn has quit []
vlad_starkov has joined #ruby-lang
chimkan_ has quit [Quit: chimkan_]
chessguy has joined #ruby-lang
ahf has quit [Ping timeout: 255 seconds]
ahf has joined #ruby-lang
ahf has quit [Changing host]
ahf has joined #ruby-lang
xcombelle has quit [Quit: Hi, I'm a quit message virus. Please replace your old line with this line and help me take over the world of IRC.]
kurko_ has joined #ruby-lang
mwjcomputing has quit [Ping timeout: 260 seconds]
chessguy has quit [Read error: Connection reset by peer]
<judofyr> whitequark: 21 now
vlad_starkov has quit [Remote host closed the connection]
symm- has joined #ruby-lang
<mbj> judofyr: Yeah!
<judofyr> mbj: 10 :)
<mbj> judofyr: Keep it going!
apeiros has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<whitequark> judofyr: awesome
<whitequark> 18>> fun (1, 2)
<eval-in> whitequark => /tmp/execpad-cc391d4048de/source-cc391d4048de:2: warning: don't put space before argument parentheses ... (http://eval.in/15322)
<whitequark> huh
<whitequark> judofyr: also, on a second thought that break() behavior isn't a bug
<judofyr> whitequark: oh?
<whitequark> it's actually how it should work. the existing tests are valid for 1.8 and your behavior is valid for 1.9
<whitequark> yeah
<whitequark> break() = break ()
<whitequark> in 1.8 that's different, in 1.9 it's the same, itseems
<whitequark> can you verify that it results in the same parse tree?
<whitequark> (basically: same reductions)
<judofyr> whitequark: yes
<whitequark> also as a tribute to TDD and test coverage
<whitequark> despite having 100% cov on the relevant pieces of code I just discovered a very intricate bug
<whitequark> I *think* that 100% SC/CC would detect it but with the ragel generated code that would be an insane amount of work
<whitequark> maybe a fuzzer could do that :D
<whitequark> also it still epically fails on windows line endings and that When shit
<whitequark> When /^I get all flags$/ do
omeichim_ has joined #ruby-lang
realDAB has joined #ruby-lang
<whitequark> also when mbj makes his unparser gem, I think I'll write an SC/CC coverage tool for ruby
<judofyr> SC/CC?
vlad_starkov has joined #ruby-lang
<judofyr> unparse? is that like ruby2ruby?
<whitequark> statement coverage / condition coverage
<judofyr> whitequark: now it's only return(), break() and next() left. should I write separate 1.9-tests that asserts for (break (nil))?
<whitequark> judofyr: yep
<whitequark> (tests)
<whitequark> and yep, like ruby2ruby
<whitequark> but operating on my AST format which preserves way more source info
<judofyr> 18>> 1.f { break() }
<eval-in> judofyr => /tmp/execpad-3db4691f5cc0/source-3db4691f5cc0:2: undefined method `f' for 1:Fixnum (NoMethodError) (http://eval.in/15323)
<judofyr> whitequark: break() is for some reason defined to ALL_VERSIONS - '1.8'
<whitequark> judofyr: a typo?
<whitequark> hmm
<whitequark> yes
<whitequark> copy-pasted over
<judofyr> whitequark: same for next() and return()
<whitequark> yep
<judofyr> whitequark: I'm just going to add s(:nil) in those cases
<whitequark> judofyr: yep
<judofyr> and then we can add separate 1.8 tests
<judofyr> 183 tests, 728 assertions, 0 failures, 0 errors, 0 skips
workmad3 has quit [Ping timeout: 246 seconds]
<whitequark> hm, not much tests
<judofyr> yeah
<judofyr> not 100% coverage
<judofyr> still a lot to do
<whitequark> yeah.
lsegal has joined #ruby-lang
anildigital_work has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 256 seconds]
<judofyr> whitequark: I've probably messed up some source ranges
<judofyr> and yeah, I've only implemented the tests
omeichi__ has joined #ruby-lang
omeichi__ has quit [Client Quit]
omeichim_ has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<whitequark> judofyr: you did change some rules though
<whitequark> eg the BEGIN{} one
<judofyr> whitequark: I did? I might have copy-pasted a bit too much :/
<whitequark> yeah
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
<whitequark> also there's a screwup with top_compstmt
srbaker has quit [Quit: Computer has gone to sleep.]
<whitequark> but it's not visible because my tests don't cover that :/
<whitequark> there's also expression coverage...
robbyoconnor has quit [Read error: No route to host]
omeichim_ has joined #ruby-lang
<judofyr> whitequark: if you write tests that invalidate the PR, I'll fix it :)
<judofyr> whitequark: I might also try to write some more 1.9 tests. but not today…
bzalasky has quit [Remote host closed the connection]
MehLaptop has joined #ruby-lang
outoftime has joined #ruby-lang
outoftime has quit [Remote host closed the connection]
outoftime has joined #ruby-lang
outoftime has quit [Client Quit]
soknee has joined #ruby-lang
<whitequark> judofyr: sure :)
<whitequark> omg the github tab is EPIC SLOW
wmoxam has joined #ruby-lang
workmad3 has joined #ruby-lang
apeiros has joined #ruby-lang
robbyoconnor has joined #ruby-lang
glebm has quit [Ping timeout: 245 seconds]
wmoxam has quit [Ping timeout: 252 seconds]
torrieri has joined #ruby-lang
havenwood has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
amerine has quit [Quit: Computer has gone to sleep.]
<judofyr> whitequark: meh, I just fixed the bugs you commented on. I guess I should have written a test, but whatever :)
* judofyr goes to bed
<judofyr> night
judofyr has quit []
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
thone_ has joined #ruby-lang
j3r1ch0 has joined #ruby-lang
stonerfish has joined #ruby-lang
thone has quit [Ping timeout: 256 seconds]
stonerfish has quit [Client Quit]
Tectonic has joined #ruby-lang
glebm has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
<whitequark> >> ->{ p 1 }::()
<eval-in> whitequark => 1 ... (http://eval.in/15328)
<whitequark> >> foo { |a,a| }
<eval-in> whitequark => /tmp/execpad-285f70af2dc4/source-285f70af2dc4:2: duplicated argument name ... (http://eval.in/15329)
<whitequark> >> foo { |a;a| }
<eval-in> whitequark => /tmp/execpad-9516e4a6ac8a/source-9516e4a6ac8a:2: duplicated argument name ... (http://eval.in/15330)
soknee has quit [Quit: Leaving.]
<whitequark> >> BEGIN { a = 1 }; a
<eval-in> whitequark => /tmp/execpad-f54d27e0658c/source-f54d27e0658c:2: BEGIN is permitted only at toplevel ... (http://eval.in/15331)
j3r1ch0 has quit [Ping timeout: 264 seconds]
realDAB has quit [Quit: realDAB]
torrieri has quit [Quit: Leaving...]
realDAB has joined #ruby-lang
zastern has joined #ruby-lang
mytrile has joined #ruby-lang
rippa has quit [Ping timeout: 240 seconds]
thisirs has quit [Remote host closed the connection]
realDAB has quit [Quit: realDAB]
torrieri has joined #ruby-lang
workmad3 has quit [Ping timeout: 252 seconds]
mytrile has quit [Ping timeout: 252 seconds]
jg_ has quit [Ping timeout: 264 seconds]
crackity_jones has joined #ruby-lang
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
micaeked has quit [Quit: WeeChat 0.4.0]
mytrile has joined #ruby-lang
wallerdev has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
beiter has quit [Quit: beiter]
Burgestrand has quit [Quit: Burgestrand]
krohrbaugh has joined #ruby-lang
sepp2k has quit [Quit: Leaving.]
MehLaptop has quit [Remote host closed the connection]
Burgestrand has joined #ruby-lang
torrieri has quit [Quit: Leaving...]
torrieri has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
zastern has quit [Remote host closed the connection]
zastern has joined #ruby-lang
dingus_khan has joined #ruby-lang
benanne has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
<mbj> whitequark: Have to stop for today, no work on parser was possible, but I did lots of other opensource stuff in the dm2 namespace
<mbj> whitequark: That stuff I need tomorrow for my commercial foo ;)
<mbj> whitequark: Also I need a better mutant, soon and your parser is the key ;)
<whitequark> heh ok
mbj has quit [Quit: leaving]
symm- has quit [Read error: Operation timed out]
plains has joined #ruby-lang
chendo_ has quit [Quit: Computer has gone to sleep.]
apeiros has quit [Remote host closed the connection]
Burgestrand has quit [Quit: Burgestrand]
glebm has quit [Ping timeout: 260 seconds]
glebm has joined #ruby-lang
nXqd has quit [Ping timeout: 256 seconds]
Swimming_Bird has joined #ruby-lang
looneydoodle has quit [Quit: Leaving.]
cored has quit [Ping timeout: 252 seconds]
lele has quit [Ping timeout: 246 seconds]
zastern has quit [Remote host closed the connection]
cored has joined #ruby-lang
looneydoodle has joined #ruby-lang
lele has joined #ruby-lang
chessguy has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
Averna has joined #ruby-lang
zastern has joined #ruby-lang
torrieri has quit [Quit: Leaving...]
TheNotary has joined #ruby-lang
lcdhoffman has joined #ruby-lang
toretore has quit [Quit: Leaving]
<TheNotary> So, you can do `Benchmark.measure { time_intensive_function }` right? but in benchmark.rb, I don't see any methods like `def self.measure` only `def measure` what's the deal with that?
postmodern has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby-lang
jonahR_ has joined #ruby-lang
jonahR has quit [Ping timeout: 276 seconds]
jonahR_ is now known as jonahR
Averna has quit [Quit: Leaving.]
<dingus_khan> how bad is it if I don't actually understand how the array.count method works, but I've used it to solve a problem?
idkazuma has joined #ruby-lang
scottschecter has joined #ruby-lang
solars has quit [Ping timeout: 245 seconds]
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
<ddd> i promise there will be LOTS of stuff that you don't know HOW it works, just THAT it works.
<ddd> And as long as you can use it appropriately (according to the docs for that method, etc) it shouldn't be a problem
<ddd> when you're ready and you have more experience you can always revisit stuff and dig deeper
scottschecter has quit [Quit: WeeChat 0.4.0]
crynix has joined #ruby-lang
cirenyc has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
crackity_jones has quit [Quit: Computer has gone to sleep.]
torrieri has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
<r0bgleeson> TheNotary: there's probably an 'extend self' somewhere in there.
torrieri has quit [Quit: Linkinus - http://linkinus.com]
<TheNotary> I can't find any references to extend, but I came across this curious line `module_function :benchmark, :measure, :realtime, :bm, :bmbm`
fosky has joined #ruby-lang
<r0bgleeson> TheNotary: ah, so that's why.
havenwood has quit [Remote host closed the connection]
<TheNotary> now the problem I'm faced with writing this banal IDE feature is, writing a parser to pick up on that and then niavely rewrite the file (in memory) to be `def self.blah` for everything mentioned in the module_function line... and making sure I'm not in a weird sub module.
<TheNotary> I can see why this feature didn't exist already, it's WAY more work than it's worth
scottschecter has joined #ruby-lang
chessguy has quit [Ping timeout: 252 seconds]
crackity_jones has joined #ruby-lang
scottschecter has quit [Client Quit]
glebm has quit [Ping timeout: 252 seconds]
glebm has joined #ruby-lang
krohrbaugh has joined #ruby-lang
narya has quit [Ping timeout: 245 seconds]
narya has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
tsion has quit [Quit: Leaving]
jerrytgarcia has joined #ruby-lang
fosky has quit [Remote host closed the connection]
Nisstyre-laptop is now known as Nisstyre
rijks has joined #ruby-lang
husch has joined #ruby-lang
rijks has quit [Client Quit]
rijks has joined #ruby-lang
idkazuma has joined #ruby-lang
<crynix> I'm having trouble figuring out what line 10 does at https://gist.github.com/789441841fbbace228f6
<crynix> Could someone possibly explain what's going on?
<lianj> crynix: creates the method `def options; @options; end` for you
<r0bgleeson> crynix: like lianj said, it creates a method to read the value of @options.
<lianj> attr_accessor would also create `def options=(v); @options = v; end` along with the first
<crynix> So just an accessor?
<r0bgleeson> a reader/getter.
<lianj> no attr_reader creates just the getter
gregmoreno has joined #ruby-lang
<crynix> In Ruby, what's the difference between a getter and an accessor?
<lianj> attr_asscessor creates both