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
mbj has joined #ruby-lang
mytrile has quit [Ping timeout: 260 seconds]
ykk has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
divina has joined #ruby-lang
divina has left #ruby-lang [#ruby-lang]
bamacsguy has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
sepp2k has quit [Read error: Connection reset by peer]
sailias has joined #ruby-lang
ykk has joined #ruby-lang
ykk has quit [Remote host closed the connection]
postmodern has quit [Ping timeout: 256 seconds]
KM has joined #ruby-lang
KM is now known as Guest55873
wyhaines_ has quit [Remote host closed the connection]
ryanf has quit [Quit: leaving]
ryanf has joined #ruby-lang
ryanf has joined #ruby-lang
Technodrome has quit [Quit: Technodrome]
sandbags has quit [Remote host closed the connection]
Gaelan has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
stevechiagozie has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
bamacsguy has quit [Quit: Leaving]
<Wardrop> Quick question just to confirm. There's no shorthand for the following is there: var.empty? if var.respond_to? :empty
<Wardrop> Except for the dodgy: var.empty? rescue nil
mistym has quit [Remote host closed the connection]
<Rakko> hi mistym!
mytrile has quit [Ping timeout: 246 seconds]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<Rakko> Wardrop: maybe this reading will help: http://devblog.avdi.org/2011/06/28/do-or-do-not-there-is-no-try/
mistym has quit [Remote host closed the connection]
setmeaway has quit [Quit: Leaving]
bzalasky has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
setmeaway has joined #ruby-lang
<Wardrop> Rakko: Thanks, I guess the answer is no, though depending on your scenario they're may be a good work-around. I might raise a feature request at bugs.ruby-lang.org to start a discussion.
<Wardrop> If ruby really wants to embrace duck-typing, it needs to have a more succinct means of dealing with potentially non-existent methods.
srbaker has quit [Client Quit]
<Rakko> Maybe.
<Rakko> I think the #try mentioned in the first link is a Rails addon
Technodrome has joined #ruby-lang
Gaelan has joined #ruby-lang
Technodrome has quit [Quit: Technodrome]
Rakko has quit [Quit: leaving]
tbuehlmann has quit [Ping timeout: 246 seconds]
<Wardrop> Rakko: Yep, it's rails.
Technodrome has joined #ruby-lang
<Technodrome> is class << self etc etc the same thing as def self.methodname ?
mwjcomputing has joined #ruby-lang
idkazuma has joined #ruby-lang
aef has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
aef has joined #ruby-lang
reactormonk has quit [Quit: WeeChat 0.4.0]
srbaker has quit [Quit: Computer has gone to sleep.]
srbaker has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
idkazuma has quit [Remote host closed the connection]
sonots has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
tcopp has joined #ruby-lang
Technodrome has quit [Quit: Technodrome]
postmodern has joined #ruby-lang
setmeaway has quit [Quit: Leaving]
setmeaway has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
djwonk has quit []
djwonk has joined #ruby-lang
breakingthings has joined #ruby-lang
agarie has joined #ruby-lang
mytrile has joined #ruby-lang
mytrile has quit [Ping timeout: 240 seconds]
davidedgertonjr has joined #ruby-lang
davidedgertonjr has left #ruby-lang [#ruby-lang]
vlad_starkov has quit [Read error: Connection reset by peer]
mwjcomputing has quit [Ping timeout: 246 seconds]
charliesome has joined #ruby-lang
megha has joined #ruby-lang
baba has quit [Ping timeout: 245 seconds]
Technodrome has joined #ruby-lang
symm- has quit [Ping timeout: 256 seconds]
kgrz has quit [Quit: Computer has gone to sleep.]
idkazuma has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
kgrz has joined #ruby-lang
mytrile has joined #ruby-lang
mytrile has quit [Ping timeout: 245 seconds]
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
Gaelan has quit [Ping timeout: 260 seconds]
swav has joined #ruby-lang
Gaelan has joined #ruby-lang
Squee-D has quit [Quit: The computer fell asleep]
Squee-D has joined #ruby-lang
intellitech has quit [Quit: intellitech]
Squee-D has quit [Ping timeout: 260 seconds]
Guest85414 has quit [Remote host closed the connection]
herpless___ has quit [Remote host closed the connection]
beawesomeinstead has quit [Remote host closed the connection]
thejspr_ has quit [Remote host closed the connection]
norplr has quit [Remote host closed the connection]
anildigital_work has quit [Remote host closed the connection]
UziMonkey__ has quit [Remote host closed the connection]
Spaceghost|cloud has quit [Remote host closed the connection]
wycats__ has quit [Write error: Connection reset by peer]
akahn has quit [Write error: Broken pipe]
randym has quit [Write error: Broken pipe]
bzalasky has joined #ruby-lang
wycats__ has joined #ruby-lang
<drbrain> Technodrome: yes*
<drbrain> * but you can create attr_* in class << self
fosky has joined #ruby-lang
cms has joined #ruby-lang
Technodrome has quit [Quit: Technodrome]
yianna has joined #ruby-lang
<yianna> hey has anyone read Peter Coopers Beginning ruby from Newb to Pro
yianna is now known as ykk
<ykk> am having problems with the dungeon =\ https://gist.github.com/yiannakk/5279592
intellitech has joined #ruby-lang
wycats__ has quit [Remote host closed the connection]
ykk has left #ruby-lang [#ruby-lang]
ykk` has joined #ruby-lang
Technodrome has joined #ruby-lang
<Technodrome> drbrain: you mean self. is just a shortcut right?
jaimef has quit [Excess Flood]
jaimef has joined #ruby-lang
<Technodrome> why would you want to do attr_* on a class itself?
havenwood has quit [Read error: Connection reset by peer]
<Technodrome> i thought accessors were restricted to instances?
<drbrain> any object can have an accessor
bzalasky has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
<drbrain> since objects are instances of classes and classes are modules
<Technodrome> i guess it makes sense why it shouldn't be allowed
<drbrain> one place I use them is when I have a class that has a registry of some sort
<Technodrome> drbrain: i really come from a java background
<Technodrome> i've used ruby for a while, you can really use it without giving this stuff much thought, but i like to get to the bottom of it
madb055 has quit [Ping timeout: 272 seconds]
Tectonic has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
breakingthings has quit []
tsion has quit [Quit: Leaving]
agarie has quit [Read error: Connection reset by peer]
agarie has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
stevechiagozie has quit [Quit: Computer has gone to sleep.]
sonots has quit [Remote host closed the connection]
oguzbilgic has joined #ruby-lang
fosky has quit [Remote host closed the connection]
tcopp has quit [Ping timeout: 240 seconds]
bzalasky has joined #ruby-lang
oguzbilgic has left #ruby-lang [#ruby-lang]
sonots has joined #ruby-lang
vlad_starkov has joined #ruby-lang
Technodrome has quit [Quit: Technodrome]
bzalasky has quit [Remote host closed the connection]
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
dmoctezuma has joined #ruby-lang
ritek has quit [Read error: Connection reset by peer]
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
amerine has joined #ruby-lang
ritek has joined #ruby-lang
dmoctezuma has quit [Read error: Connection reset by peer]
thebastl has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 245 seconds]
sonots has quit [Remote host closed the connection]
randallagordon has quit [Ping timeout: 260 seconds]
mytrile has joined #ruby-lang
thebastl has quit [Remote host closed the connection]
dc5ala has joined #ruby-lang
randallagordon has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
oguzbilgic has joined #ruby-lang
oguzbilgic has left #ruby-lang [#ruby-lang]
mytrile has quit [Remote host closed the connection]
madb055 has joined #ruby-lang
mytrile has joined #ruby-lang
mistym has quit [Remote host closed the connection]
thorncp has left #ruby-lang [#ruby-lang]
mytrile has quit [Remote host closed the connection]
<rue> ykk`: You misspelled initialize
mytrile has joined #ruby-lang
<rue> ykk`: That’s why it doesn’t find the method
<rue> …And it’s several hours later. Maybe I need to add the time visible without hovering
r0bglees0n has joined #ruby-lang
thebastl has joined #ruby-lang
mbj has quit [Ping timeout: 256 seconds]
blacktulip has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
dmoctezuma has joined #ruby-lang
ritek has quit [Read error: Connection reset by peer]
dmoctezuma has quit [Client Quit]
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
thebastl has quit [Remote host closed the connection]
madb055 has quit [Ping timeout: 246 seconds]
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
tbuehlmann has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
Tectonic has quit []
Mon_Ouie has quit [Ping timeout: 255 seconds]
Mon_Ouie has joined #ruby-lang
pygmael has joined #ruby-lang
agarie has quit [Remote host closed the connection]
vlad_sta_ has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 256 seconds]
lupine has quit [Excess Flood]
tbuehlmann has quit [Ping timeout: 255 seconds]
ledestin has quit [Quit: ledestin]
lupine has joined #ruby-lang
amerine has quit [Quit: Computer has gone to sleep.]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
pygmael has quit [Quit: pygmael]
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
postmodern has quit [Ping timeout: 240 seconds]
sepp2k has joined #ruby-lang
Nisstyre-laptop has quit [Ping timeout: 246 seconds]
wycats__ has joined #ruby-lang
UziMonkey__ has joined #ruby-lang
anildigital_work has joined #ruby-lang
Guest85414 has joined #ruby-lang
herpless___ has joined #ruby-lang
thejspr_ has joined #ruby-lang
beawesomeinstead has joined #ruby-lang
UziMonkey__ has quit [Remote host closed the connection]
beawesomeinstead has quit [Remote host closed the connection]
herpless___ has quit [Remote host closed the connection]
thejspr_ has quit [Remote host closed the connection]
wycats__ has quit [Remote host closed the connection]
anildigital_work has quit [Remote host closed the connection]
Guest85414 has quit [Remote host closed the connection]
mbj has joined #ruby-lang
snafoo_ has quit [Quit: Leaving]
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
benanne has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
postmodern has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mbj has quit [Ping timeout: 245 seconds]
havenwood has quit [Remote host closed the connection]
mrfelix has joined #ruby-lang
benanne has quit [Quit: kbai]
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
wycats__ has joined #ruby-lang
UziMonkey__ has joined #ruby-lang
runeb has joined #ruby-lang
anildigital_work has joined #ruby-lang
Guest85414 has joined #ruby-lang
herpless___ has joined #ruby-lang
thejspr_ has joined #ruby-lang
ezkl has quit [Quit: Textual IRC Client: www.textualapp.com]
thone has joined #ruby-lang
UziMonkey__ has quit [Remote host closed the connection]
anildigital_work has quit [Remote host closed the connection]
wycats__ has quit [Remote host closed the connection]
herpless___ has quit [Remote host closed the connection]
Guest85414 has quit [Remote host closed the connection]
thejspr_ has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
thone_ has quit [Ping timeout: 252 seconds]
security has joined #ruby-lang
megha has quit [Ping timeout: 252 seconds]
mytrile has quit [Remote host closed the connection]
wycats__ has joined #ruby-lang
UziMonkey__ has joined #ruby-lang
anildigital_work has joined #ruby-lang
Guest85414 has joined #ruby-lang
herpless___ has joined #ruby-lang
thejspr_ has joined #ruby-lang
runeb has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
runeb has joined #ruby-lang
mytrile has quit [Ping timeout: 245 seconds]
mytrile has joined #ruby-lang
beawesomeinstead has joined #ruby-lang
swombat has joined #ruby-lang
<swombat> hello... I need some help with something that looks ridiculously simple but somehow fails... I suspect it's to do with some strange side-effect of define_method/instance_eval or something like that... the following code: https://gist.github.com/swombat/29cb6ce15db791c8ce68 : gives the following error when the ruby console tries to load it: https://gist.github.com/swombat/6ddb5ba179fbf3a9036b
<swombat> the relevant line in the first gist is 157
<swombat> I've included the whole class because I suspect there's some strange effect going on that is outside the otherwise extremely simple syntax that's blowing up
<swombat> strangely, if I replace that simple loop with its one-line syntactical equivalent ( [1,2,3].each { |i| puts i } ) then it doesn't blow up
<swombat> so it's only the multi-line block that blows up
akahn has joined #ruby-lang
nXqd has joined #ruby-lang
srbaker has joined #ruby-lang
Squee-D has joined #ruby-lang
Technodrome has joined #ruby-lang
<swombat> don't all answer at once :-)
srbaker has quit [Quit: Computer has gone to sleep.]
ledestin has joined #ruby-lang
soknee has joined #ruby-lang
Squee-D has quit [Quit: The computer fell asleep]
Squee-D has joined #ruby-lang
Squee-D has quit [Ping timeout: 255 seconds]
Technodrome has quit [Quit: Technodrome]
soknee has quit [Quit: Leaving.]
crynix has joined #ruby-lang
crynix is now known as zach
zach is now known as zachlatta
zachlatta is now known as zach
zach is now known as zachlatta
soknee has joined #ruby-lang
soknee has quit [Client Quit]
DEac- has quit [Ping timeout: 240 seconds]
<zachlatta> When opening a file for writing, is there any particular reason why "w" is passed as a string and not a symbol? I'm assuming this is because the File class is written in C?
<Wardrop> zachlatta: Your guess is as good as anyone's
Spaceghost|cloud has joined #ruby-lang
<Wardrop> zachlatta: It wouldn't be that useful as a symbol anyway, as the + sign required for half the modes would mean you'd have to quote the symbol
<Wardrop> Hardly short-hand
<zachlatta> Ah, I see.
tomzx_mac has joined #ruby-lang
<Wardrop> swombat: Have you solved the issue yet?
<swombat> nope
<Wardrop> What ruby version are you running?
<Wardrop> Does the block of code work in isolation...
<Wardrop> [1, 2, 3].each do |i|
<Wardrop> puts i
<Wardrop> end
<swombat> yep
<swombat> it just doesn't work inside the define_method/instance_eval block
<swombat> and it works when put in { } instead of do/end blocks
<swombat> ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin12.2.1]
mytrile has quit [Remote host closed the connection]
<injekt> swombat: you know define_method takes a block so you dont have to use procs everywhere right?
<injekt> define_method :find, ->(id) do #=> define_method :find do |id|
<swombat> injekt: I think I had tried that before and it didn't work...
<swombat> is that the cause of this issue?
<injekt> no it's unrelated
chessguy has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
<swombat> then let me solve the issue first :-)
chessguy has joined #ruby-lang
<Wardrop> It's a weird one
<swombat> Wardrop: i've temporarily solved it by one-lining the whole mapping thing
<swombat> mapped_objects = objects.map { |object| mapped = {}; keys.each { |key, map_key| mapped[map_key] = object[key] } }
<swombat> but it feels dirty not to know why the do/end block is blowing up
<Wardrop> Use the method of passing a block as suggested by inject, and wrap the method name in paranthesis
<injekt> yeah this might actually be related
<injekt> also injekt* ;)
<Wardrop> By leaving parenthesis off the call to `define_method`, you're creating an ambiguity.
baz_ has quit [Ping timeout: 245 seconds]
mytrile has joined #ruby-lang
<injekt> doing define_method :foo, ->(..) do .. end is weird
<swombat> hmm, ok, let me see if the other syntax works
randym has joined #ruby-lang
jxie has quit [Quit: leaving]
runeb has quit [Read error: Connection reset by peer]
<Wardrop> injekt: I agree. The "->" is not a method call. It uses a special syntax. It's not surprising it doesn't work in this context,
<swombat> well, the -> works fine until I stick a do/end block inside
<swombat> oh, now i remember why I had to use ->
<swombat> no default params with do |a, b|
<injekt> uh
<injekt> did you try?
<injekt> do |a=1, b=2|
<swombat> I think I did, when I first coded this...
<swombat> but let's try again
<swombat> after all, my present self is infinitely more clever than my past self
<swombat> huh, seems to parse
<Wardrop> You can keep using you're odd lambda, just wrap parenthesis around the arguments to #define_method
* swombat sends a note with the word "STUPID!" on it to his past self
<Wardrop> E.g. define_method(:foo, ->() do … end)
abstr4ct has joined #ruby-lang
<injekt> vomit
rsl has quit [Ping timeout: 252 seconds]
DEac- has joined #ruby-lang
<swombat> NameError: undefined local variable or method `vomit' for main:Object
<swombat> thanks injekt, Wardrop :-)
<swombat> looks like it's fixed now
<Wardrop> No worries
<abstr4ct> Trying to work out a way using xpath/nokogiri to start at a given string and output all text until another string. What i have so far works to some degree, but i dont need the extra "not" analysis. I feel like i should be a ble to use a "until" instead of the way i am doing it.
<injekt> define_method isn't even supposed to be used like that anyway, the only reason if works is because define_method is meant to accept Method instances so you can do define_method(foo, method(:bar))
<injekt> abstr4ct: show us what you have so far with example html
rsl has joined #ruby-lang
<abstr4ct> currently. '//*[contains(text(), "start_whenyou_see_me")]/following::span[not(preceding::*[contains(text(), "stop_whenyou_see_me")])] '
<injekt> abstr4ct: can you give me some html that it should match, it's easy to use that rather than parse the xpath and come up with html from it
<abstr4ct> sure, but the idea behind this is to make it as least dependant on the html as possible..
<injekt> well sure, but I need something
<Wardrop> abstr4ct: Are you saying that you want to retrieve the first text node beneath some parent?
<Wardrop> "start at a given string and output all text until another string" makes no sense
<abstr4ct> i want it to out put all values for all nodes after the given string.. ill show you a similar xpath and where it works very well..
jxie has joined #ruby-lang
<abstr4ct> example: '//*[contains(text(), "Monday")]/following::span[not(preceding::*[contains(text(), "Tuesday")])] '
intellitech has quit [Quit: SMOKE BOMB!]
baz_ has joined #ruby-lang
<Wardrop> abstr4ct: Ok, I think I know what you mean. You want to retrieve all the text between two strings as they appear within a HTML/XML document.
<abstr4ct> exactly
<injekt> you're grouping the menus by day?
<abstr4ct> yes
sonots has joined #ruby-lang
<Wardrop> Is there some reason why you're just using Regex on the document, or all the text in the document?
<Wardrop> E.g. /start string.+?end string/
<abstr4ct> i can do that with nokogiri?
<Wardrop> Well, you can get a HTML fragment out of Nokogiri, or any text fragment, and then Regexp it.
<injekt> why would you use regexp when you have an html parser at hand?
<abstr4ct> the nokogiri html parser makes the text clean
<abstr4ct> thats my main reason for using it. but i am not expert
<abstr4ct> not=no
<Wardrop> By make it clear, I assume you mean it removes the markup, correct?
<Wardrop> make it clean*
<abstr4ct> yes
<Wardrop> Use nokogiri to extract the text without the markup.
<Wardrop> Let me lookup the API to see if I can find what you should use
<injekt> ugh
<injekt> please dont do that
chessguy has quit [Remote host closed the connection]
<abstr4ct> what you got in mind ink?
<injekt> abstr4ct: just writing something
<abstr4ct> k, no rush
<abstr4ct> this is just some silly side project for me to learn ruby with
<Wardrop> This will get all the text, without markup: Nokogiri::HTML(src).text
grandy has joined #ruby-lang
<Wardrop> Where `src` is the HTML stored in a string
<abstr4ct> gotcha
<Wardrop> I have no idea how you're using this, so don't know if this is appropriate or not, but based on your brief description of your requirements, this should work.
<Wardrop> I'm not sure what injekt is cooking up.
<abstr4ct> yes, i appreciate all the ideas.. I kind of hit a mental block so i came here for some new ideas.
madb055 has joined #ruby-lang
<injekt> https://gist.github.com/injekt/027cd30fbcfe07ac2e04 you can pretty much use this and adapt to exactly how you want it
<injekt> and it's easy to adapt it without you having to specify the days too, but I'll leave that as an exercise for you
<injekt> all the crazy xpath is fine but when you get websites like this that have no idea how to markup their page, fancy xpath goes out the window
<abstr4ct> wow
<abstr4ct> that is awesomely simple. not let me see how to use it in my overly complicated existing framework
<abstr4ct> hehe
<injekt> :P
madb055 has quit [Ping timeout: 272 seconds]
<injekt> I love writing extreme xpath but usually it's the simpliest thing that works
adambeynon has joined #ruby-lang
<abstr4ct> extreme xpath. hahaha
<injekt> yeah this is one of my favs and it's actually not even too complicated: //h2[. = 'Foo bar']/following-sibling::p [1 = count(preceding-sibling::h2[1] | ../h2[. = 'Foo bar'])]
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
wallerdev has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
r0bglees0n has quit [Ping timeout: 256 seconds]
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
norplr has joined #ruby-lang
postmodern has quit [Remote host closed the connection]
<abstr4ct> inkjet, in your example "day" works as a pattern to match?
<abstr4ct> doh nm.. haha
ledestin has quit [Ping timeout: 245 seconds]
ledestin has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
<whitequark> what the hell
srbaker has quit [Quit: Computer has gone to sleep.]
<whitequark> >> def a; BEGIN { puts 1 }; end
<eval-in> whitequark => /tmp/execpad-16aa69529cb4/source-16aa69529cb4:2: BEGIN is permitted only at toplevel ... (http://eval.in/14053)
<whitequark> hm.
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
srbaker has joined #ruby-lang
mrfelix has quit [Quit: Computer has gone to sleep.]
Technodrome has joined #ruby-lang
tcopp has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
<abstr4ct> thanks wardrop and inkjet! i apprciate the assistance
r0bglees0n has joined #ruby-lang
<yorickpeterse> whitequark: on 1.9 it raises a syntax error
<yorickpeterse> (without the "permitted..." stuff)
<whitequark> yorickpeterse: yep I know
<whitequark> also hm.
<whitequark> >> 1; else 2
<eval-in> whitequark => /tmp/execpad-197e3b22ed55/source-197e3b22ed55:3: warning: else without rescue is useless ... (http://eval.in/14054)
<abstr4ct> inkjet: i still dont understand in your example how it knows when to stop. I see the starts with. but how does it know to end?
<yorickpeterse> whitequark: lol wat
<yorickpeterse> that error is the best
<yorickpeterse> >> 10 /20
<eval-in> yorickpeterse => 0 (http://eval.in/14055)
<yorickpeterse> oh hm, that requires -W2
<whitequark> 19>> class A; BEGIN{}; end
<eval-in> whitequark => /tmp/execpad-abec8e6cdbca/source-abec8e6cdbca:2: syntax error, unexpected keyword_BEGIN ... (http://eval.in/14056)
<whitequark> 19>> def a; BEGIN{}; end
<eval-in> whitequark => /tmp/execpad-1d32c6294bd9/source-1d32c6294bd9:2: syntax error, unexpected keyword_BEGIN ... (http://eval.in/14057)
<whitequark> >> class A; BEGIN{}; end
<eval-in> whitequark => /tmp/execpad-396086e60ad7/source-396086e60ad7:2: BEGIN is permitted only at toplevel ... (http://eval.in/14058)
<whitequark> >> def a; BEGIN{}; end
mytrile has quit [Remote host closed the connection]
<eval-in> whitequark => /tmp/execpad-7453c60f8528/source-7453c60f8528:2: BEGIN is permitted only at toplevel ... (http://eval.in/14059)
<yorickpeterse> lol wat
kgrz has joined #ruby-lang
mytrile has joined #ruby-lang
<yorickpeterse> I wonder why that feature is there to begin with
<whitequark> awk.
<yorickpeterse> well as in, why it's still there
<yorickpeterse> 10>> def a; BEGIN{}; end
<yorickpeterse> hmpf
<yorickpeterse> http://eval.in/14064 ha
Technodrome has quit [Quit: Technodrome]
<whitequark> hahaha
<yorickpeterse> http://eval.in/14068
<yorickpeterse> even better
glebm has joined #ruby-lang
<yorickpeterse> (apparently puts doesn't exist in 1.0)
<whitequark> yep
runeb has joined #ruby-lang
Wardrop has quit [Quit: Wardrop]
wallerdev has quit [Quit: wallerdev]
mrfelix has joined #ruby-lang
<abstr4ct> i see it follows the P tag
tcopp has quit [Ping timeout: 255 seconds]
<abstr4ct> that break down on sites like this. http://eastvillagegrill.com/pages/Menus
<charliesome> yorickpeterse: wait 10>> works with the eval-in bot
<charliesome> i don't remember doing that lols
<abstr4ct> inkjet, but neither my old way or your new way works for that site
<whitequark> >> module A; rescue; end
<eval-in> whitequark => nil (http://eval.in/14085)
<yorickpeterse> charliesome: ehm, it doesn't?
<whitequark> you can use rescue-else-ensure almost everywhere
<charliesome> oh misread
<charliesome> i'll add that one sec!
cored has quit [Ping timeout: 256 seconds]
<yorickpeterse> yay
kgrz has quit [Read error: Connection reset by peer]
<charliesome> needa figure out a better way to deploy to the irc bot
<charliesome> might look into using the daemons gem or something
<charliesome> right now it runs in a dtach session
cored has joined #ruby-lang
<yorickpeterse> ugh, I loathe the daemons gem
<charliesome> really?
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby-lang
<charliesome> 10>> RUBY_DESCRIPTION
<eval-in> charliesome => /tmp/execpad-b63ecd961e63/source-b63ecd961e63:2: NameError: Uninitialized constant RUBY_DESCRIPTION (http://eval.in/14087)
<charliesome> ok well that works
<yorickpeterse> The idea of it is useful but the code/cruft it generates is not
<charliesome> well writing a daemon is a total pain in the ass
<yorickpeterse> wait, daemons or daemon-kit?
<charliesome> i dunno
<charliesome> either or
<yorickpeterse> The former isn't maintained anymore I believe
<charliesome> ah
<charliesome> in fact
<yorickpeterse> the latter is what we use all over the place, not a huge fan of it
Technodrome has joined #ruby-lang
<charliesome> i use systemd on my server now, i should just use that
<charliesome> i think that handles processes that don't do the whole double fork detach dance nicely
<yorickpeterse> systemd is a cunt to get working with user specific configuration files
<charliesome> nah
<charliesome> the units seem pretty straight forward
<yorickpeterse> Not sure if they fixed that by now but you needed a dbus patch for it
<yorickpeterse> No, not the config
<charliesome> ?
<charliesome> you can separate a unit from its config
<yorickpeterse> Systemd has support for user specific stuff using the --user option. This however did not work with current releases of dbus
<charliesome> oh
<charliesome> meh i dunno
<yorickpeterse> disclaimer: I use dbus for this stuff
<yorickpeterse> errr, systemd
sush24 has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
<charliesome> systemd seems superior to initscripts, but i preferred arch's ui for initscripts
<charliesome> 'rc.d list' gave much nicer output than 'systemctl'
<yorickpeterse> sysvinit is shit
<charliesome> it is
<yorickpeterse> Bash is nice for scripting but it's a pita for service management and what not
<charliesome> bash is a pita for anything except trivial scripting
<Technodrome> Good day
<whitequark> charliesome: yorickpeterse: systemd is a good idea spoiled by an extreme form of NIH syndrome
<yorickpeterse> charliesome: what I use for an IRC bot: http://pastie.org/7203417
<whitequark> plus anti-configurability, plus "we totally need to have a QR code generator in init".
<yorickpeterse> whitequark: personally I don't give a damn about the whole "BUT IT'S NOT FOLLOWING THE UNIX PHILOSOPHY!!!" stuff
<whitequark> yorickpeterse: it's not really about unix philosophy
<charliesome> whitequark: qr code generator wat lol
<charliesome> yorickpeterse: thats pretty cool
<whitequark> it's about reimplementing every single library they see
<charliesome> yorickpeterse: what distro do you use?
<whitequark> dbus, etc
<whitequark> the whole pulseaudio is basically a buggy and slow reimplementation of ALSA
<yorickpeterse> whitequark: as long as it works I don't really care about the internals. I've had more bullshit issues with dbus in the past not to really care about it anymore.
<yorickpeterse> charliesome: arse linux
<charliesome> yorickpeterse: nice
<charliesome> whats wrong with arch?
<yorickpeterse> Not much, but not very suited for more than 1 server
<charliesome> sure it is you just gotta roll that yourself, that's The Arch Way
<yorickpeterse> keeping 3 installations (2 laptops and a server) is a bit of a pita at times
<yorickpeterse> * up to date
<yorickpeterse> Personally I'd just stick with Debian the next time I need to install a server
<yorickpeterse> But for the time being this works just fine
sonots has quit [Quit: Leaving...]
<charliesome> i see my server as an extension of my personal computing activities
<charliesome> so arch works well
<charliesome> if i needed to maintain a server for srs bsns and stuff i'd use ubuntu
<yorickpeterse> meh, I'm personally done with Canonical going full retard
* whitequark sighs
<yorickpeterse> plus there aren't really any benefits of using Ubuntu over Debian if you'd ask me
<whitequark> yorickpeterse: more recent packages
drumond19 has joined #ruby-lang
<charliesome> ^^^^
<whitequark> according to our ops guy
<yorickpeterse> that's a repository issue
<charliesome> i run arch cos i don't enjoy maintaining my own distro
<yorickpeterse> You can get perfectly up to date packages on any given OS depending on what repositories you activate
<yorickpeterse> I believe Debian has "testing-whatever" with all the new stuff
<charliesome> where "new stuff" is "slightly less old stuff"?
* yorickpeterse hasn't used Debian in a while
* whitequark has a server with debian stable+testing, defaulting to stable
<whitequark> best of the both worlds.
<Technodrome> application hosting for the win
* Technodrome doesn't do hardly any server admin anymore
<whitequark> Technodrome: like, heroku?
<Technodrome> or openshift
<yorickpeterse> Neither do I, we have a separate OPs team.
<whitequark> it's fine if you can afford to pay 2x-10x more and have way less features available
<yorickpeterse> They're now moving all our stuff to Cent OS/Amazon Linux. Not sure how I feel about that.
<charliesome> the best bit about heroku is watching people work around its insane artifical limitations
<Technodrome> appfrog to
<Technodrome> open shift is pretty cheap whitequark
* whitequark writes a ruby 1.8 parser
<charliesome> whitequark: why? :(
<charliesome> let 1.8 die
<Technodrome> but i do use oracle linux sometimes in a vm
<Technodrome> oracle linux << sounds scary!
<abstr4ct> you mean, expensive
<whitequark> charliesome: people have to deal with 1.8
<Technodrome> its actually free abstr4ct
<whitequark> the parser doesn't *run* on 1.8, mind you
<charliesome> oracle linux has voip built in
<charliesome> so you can call their sales people from the package manager
<Technodrome> oracle linux is easy to setup oracle db, hence why i installed it
<charliesome> whitequark: but 1.8 needs to die
<zachlatta> Basic question: I'm having trouble with including a variable from another file. I know this is a scope issue, but the issue doesn't seem resolve when using a global variable. Some of you may recognize the code from Why's poignant guide: https://gist.github.com/zachlatta/30ad8c997ac076df21a4
<abstr4ct> its rhel, with all their patchs, they got sick of having to go through redhat
<Technodrome> they also undercut red hats support contracts by like 30 percent to
<abstr4ct> but i thought it was free?
<abstr4ct> ;)
<Technodrome> of course you can buy support
<Technodrome> just like red hat
<Technodrome> but i think oracle is wrong for doing it
<Technodrome> using red hats software, and undercutting their support
<whitequark> lol
<charliesome> abstr4ct: you should be able to use a global variable there
<abstr4ct> so, you must be up to date to get support. but you cannot update without support.. so is it free?
<charliesome> its not the best idea in the world
<charliesome> whoops, zachlatta ^
<Technodrome> abstr4ct: you can update
<abstr4ct> then i guess that is differnt from rhel..
<Technodrome> well define update
<abstr4ct> im just very used to oracles crack model.. its cheap/free until you want to actually use the good stuff
<abstr4ct> which is fine.. im just saying they are known for it
<abstr4ct> orcale standard vs enterprise.. night and day pricing
<Technodrome> as far as i know there is no update like in debian for rhea based stuff
<Technodrome> rhel*
<abstr4ct> rhel uses satelite i beleive
<abstr4ct> charlie, what was that about a global variable?
<charliesome> abstr4ct: i meant to mention zachlatta
<charliesome> you're both green in textual so i got confused
<Technodrome> a fresh install for every new major version update
<whitequark> >> def a; class << self; A = 1; end; end; a
<eval-in> whitequark => 1 (http://eval.in/14088)
<whitequark> so i CAN do constant definition in method body? *confused*
<charliesome> whitequark: trick is you're not in a method body
<charliesome> you're in a class body ;)
<charliesome> also here's a fun trick
<whitequark> charliesome: that doesn't make any sense
<whitequark> ruby is ostensibly lexically scoped
<charliesome> >> A = 1; class C; end; C::A
<eval-in> charliesome => /tmp/execpad-572f715c81b2/source-572f715c81b2:2: warning: toplevel constant A referenced by C::A ... (http://eval.in/14089)
<whitequark> well I know that
<charliesome> >> A = 1; module M; end M::A
<eval-in> charliesome => /tmp/execpad-f3844740044b/source-f3844740044b:2: syntax error, unexpected tCONSTANT, expecting keyword_end ... (http://eval.in/14090)
<charliesome> whoops
<charliesome> >> A = 1; module M; end; M::A
<eval-in> charliesome => /tmp/execpad-2aeff42fb2ce/source-2aeff42fb2ce:2:in `<main>': uninitialized constant M::A (NameError) (http://eval.in/14091)
<whitequark> yea this too
<charliesome> whitequark: classes and methods aren't really lexically scoped
<yorickpeterse> charliesome: can you get rid of the filepath in the error? Right now the output is a tad annoying because of it
<charliesome> yorickpeterse: i could but it would require some dodgy gsubbing
<charliesome> whitequark: they don't inherit their parent scope
intellitech has joined #ruby-lang
Sancho9 has joined #ruby-lang
<yorickpeterse> eh, they do up to a certain extend
<charliesome> they inherit nesting
Sancho9 has quit [Remote host closed the connection]
<charliesome> whatever that cref thingy is
<whitequark> cref :)
<charliesome> its bloody annoying that they can't see locals though
<yorickpeterse> that bit at least makes sense
<yorickpeterse> since they are, *drumroll* local variables!
<charliesome> yorickpeterse: uh you could make the same argument for blocks
<yorickpeterse> eh, wat?
<charliesome> blocks introduce a new scope, but they can still see out into the outer scope
<charliesome> anyway the fact that you can't see locals through a class or method definition leads to hacks like this https://github.com/rtomayko/tilt/blob/master/lib/tilt/template.rb#L219-221
<whitequark> I guess they didn't want to make *all* methods closures
<whitequark> in 1.8 age that would be an incredible perf hit
<charliesome> i dunno about 1.8 but in 1.0 looking up variables in outer scopes was walking a linked list
<charliesome> where each variable had its own node
<whitequark> same in 1.8, roughly
<charliesome> thats pants on head retarded
<whitequark> yea
wallerdev has joined #ruby-lang
<charliesome> anyway the 1.0 source taught me some stuff about flip flops
sush24 has quit [Quit: This computer has gone to sleep]
<whitequark> ... they're still in 2.0...
<charliesome> i know, but it taught me some stuff
<charliesome> one sec
<charliesome> one of them is designed to be like awk, the other is designed to be like sed
<charliesome> interesting
<whitequark> oh shit
<charliesome> also lol @ line 25
<yorickpeterse> hahah
intellitech has quit [Quit: intellitech]
<charliesome> anyway
<charliesome> cya
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
bzalasky has joined #ruby-lang
Gaelan has quit [Read error: Connection reset by peer]
Gaelan has joined #ruby-lang
jg has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
bzalasky has quit [Remote host closed the connection]
<yorickpeterse> huh, interesting: Array#<< in combination with Array#include? is faster than using Set#<<
<yorickpeterse> http://eval.in/14092
nXqd has quit [Ping timeout: 240 seconds]
mrfelix has quit [Quit: Computer has gone to sleep.]
maxmanders has joined #ruby-lang
bzalasky has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
Gaelan has quit [Read error: Connection reset by peer]
Gaelan has joined #ruby-lang
retro|cz has quit [Ping timeout: 246 seconds]
<andrewvos> This makes me very sad https://code.google.com/p/transmisson-remote-gui/
<andrewvos> It's a remote gui for Transmission.app...
<andrewvos> But it looks exactly like uTorrent.
<yorickpeterse> rking: ping
<yorickpeterse> andrewvos: what's the point of it? Transmission already has a perfectly fine web UI
<yorickpeterse> also lol, it looks shit on OS X/Umbongo
voker57_ has quit [Changing host]
voker57_ has joined #ruby-lang
voker57_ is now known as Voker57
djwonk has quit []
judofyr has joined #ruby-lang
<judofyr> hey folks
maxmanders has quit [Ping timeout: 245 seconds]
<yorickpeterse> hai
<judofyr> what's up?
maxmanders has joined #ruby-lang
nXqd has joined #ruby-lang
<yorickpeterse> judofyr: you need to talk about that super secret project on Euruko
<abstr4ct> trying to capture the text between monday and tuesday, but due to the special layout my usual follow doesnt work. any ideas http://www.eastvillagegrill.com/Menus.cfm
<yorickpeterse> also because I want to meet the people I've been chatting with for the past 2 years
<judofyr> yorickpeterse: hm… I haven't been able to finish it :/
<yorickpeterse> then hurry
retro|cz has joined #ruby-lang
<yorickpeterse> also, it doesn't have to be finished as long as you can have a nice talk about it
<judofyr> :)
<judofyr> and now I'm single handed for the moment (accident). vim is hard with only one hand…
runeb has quit [Remote host closed the connection]
<yorickpeterse> <insert bad joke about fapping>
<judofyr> :D
sush24 has joined #ruby-lang
maxmanders has quit [Client Quit]
<yorickpeterse> hmpf, either I have to patch String to add #snake_case or I have to add some helper module/class
<yorickpeterse> not sure which one is worse
<yorickpeterse> inb4 refinements
nXqd has quit [Ping timeout: 252 seconds]
<judofyr> what's wrong with Utils.snake_case?
<yorickpeterse> that could work too, the alternative is something like `unless instance_methods.include?(:snake_case); ....; end`
nXqd has joined #ruby-lang
<judofyr> why not #respond_to?
<yorickpeterse> That won't work when in a class body since that will evaluate the respond_to on class level
<yorickpeterse> >> String.respond_to?(:gsub)
<eval-in> yorickpeterse => false (http://eval.in/14093)
<yorickpeterse> >> class String; p respond_to?(:gsub); end
<eval-in> yorickpeterse => false ... (http://eval.in/14094)
<yorickpeterse> fuckit, patch
<judofyr> >> class String; p method_defined?(:gsub) end
<eval-in> judofyr => true ... (http://eval.in/14095)
<judofyr> method_defined? is better in that case
<yorickpeterse> oh, TIL
sush24 has quit [Ping timeout: 256 seconds]
sush24 has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
vlad_sta_ has quit [Read error: Connection reset by peer]
* whitequark adds DiagnosticEngine, DiagnosticConsumer, DiagnosticBuilder, AbstractDiagnostic and DiagnosticImpl to the codebase
vlad_starkov has joined #ruby-lang
<judofyr> wat
<whitequark> well, all true except the last two
Gaelan has quit [Ping timeout: 258 seconds]
<judofyr> *puh*
<whitequark> puh ?
<judofyr> I was afraid you turned it into Java
<whitequark> no
<whitequark> into C++
<whitequark> I'm basically cloning clang's diagnostics interface
<whitequark> it's frikkin awesome
<judofyr> hm
<judofyr> haven't used it
<judofyr> I've only used libclang a bit for parsing Obj-C
jonahR has joined #ruby-lang
<whitequark> also t.cc:9: error: no match for 'operator+' in '(((a*)P) + (*(long int*)(P->foo::<anonymous>.a::_vptr$a + -0x00000000000000020)))->a::bar() + * P'
<whitequark> gcc is awesome :3
<yorickpeterse> DiagnosticEngineBuilderDiagnostic
<yorickpeterse> .factory
<whitequark> the sad part is that it is actually required to have all of getLineNumber, getSpellingLineNumber, getExpansionLineNumber and getPresumedLineNumber
runeb has joined #ruby-lang
<whitequark> though WTF is the last
* judofyr turned his browser into greyscale this Easter
<whitequark> judofyr: y?
<judofyr> whitequark: dunno really. I stumbled upon an aprilFools.css that contained various tricks for messing with custom stylesheets (the idea being adding it to a co-workers computer)
<whitequark> oooh crap
<whitequark> clang's diagnostic reporting involves several various kinds of LRU caches
<whitequark> and also paging. paging!
* whitequark wonders if it's turing-complete and/or if it is possible to implement an OS with it
<Technodrome> any of you guys winning?
<yorickpeterse> with?
<Technodrome> heh stupid question maybe :)
<Technodrome> well at this time in my life i equate winning == getting money
<Technodrome> and maybe let's say >10k a week would be "winning" but of course less than that would be "doing well"
drumond19 has quit [Remote host closed the connection]
<whitequark> money is overrated
<abstr4ct> greater than 10k a week? thats very good
<Technodrome> abstr4ct: hence the term "winning"
<abstr4ct> just under half a mill a year
<abstr4ct> hrm most people consider 80k a year to winning.
<Technodrome> well, as I said its perspective
<Technodrome> 80k a year for many is good living for sure, depending on where you live
<andrewvos> yorickpeterse: Yeah and it installed with a .pkg file too so I probably have crap lying around now.
<andrewvos> yorickpeterse: Well the point is that the web ui is limited.
mytrile has joined #ruby-lang
runeb has quit [Read error: Connection reset by peer]
wallerdev has quit [Quit: wallerdev]
cesar274 has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
cesar274 has quit [Read error: Connection reset by peer]
<zachlatta> This is directly from _why's book with the addition of making code_words global. Any idea why it thinks code_words is undefined? https://gist.github.com/zachlatta/30ad8c997ac076df21a4
swombat has quit [Remote host closed the connection]
cored has quit [Ping timeout: 245 seconds]
cored has joined #ruby-lang
security is now known as fire
<yorickpeterse> because it's never defined
<yorickpeterse> unless it's some method in the wordlist file
<zachlatta> How can I use it in operation_starmonkeys.rb then?
<zachlatta> I know I could encapsulate it into some class, but is there a simpler way?
<yorickpeterse> define it
<yorickpeterse> I have no idea what it's supposed to do, but your first step is to make sure it's actually there
bzalasky has joined #ruby-lang
<zachlatta> yorickpeterse: http://mislav.uniqpath.com/poignant-guide/book/chapter-4.html "makign the Swap"
<yorickpeterse> code_words is a local variable, thus it's not made available to the file that runs `require 'wordlist'`
<yorickpeterse> put the variable in the same file, above the rest
<zachlatta> I thought I made it global though?
<zachlatta> Is it still scoped to that same file?
<yorickpeterse> oh
<yorickpeterse> Yes, you created a global variable but you're still using a local one
<yorickpeterse> (didn't see that)
<yorickpeterse> code_words.each do |real, code| => $code_words.each do |real, code|
<zachlatta> Oh! So I actually need use the $ when referring to it.
<zachlatta> So does this mean I can also have a variable named code_words?
<zachlatta> That has a scope local to the file?
<yorickpeterse> if you create it in the same file/scope, yes
<zachlatta> Hmm. Now I'm getting "undefined method 'each' for nil:NilClass (NoMethodError)"
<zachlatta> Shouldn't the hash have the method each?
<yorickpeterse> $code_words = { ... }; $code_words.each { ... } # should work just fine
<yorickpeterse> assuming you still load the wordlist file
<zachlatta> I think it's instantiating code_words to nil.
<zachlatta> Also, is it more common to use semicolons or not in Ruby? I noticed why wasn't using them in his book.
<yorickpeterse> No, there's zero need for them
<yorickpeterse> unless you do a one liner
<yorickpeterse> >> p '10'; p '20'
<eval-in> yorickpeterse => "10" ... (http://eval.in/14105)
<yorickpeterse> like that
<zachlatta> So it's general practice to not use them?
<yorickpeterse> yes
<zachlatta> Alright, thanks!
<yorickpeterse> np
cored has quit [Ping timeout: 245 seconds]
maxmanders has joined #ruby-lang
<zachlatta> I updated https://gist.github.com/zachlatta/30ad8c997ac076df21a4 to reflect the change you suggested. I'm still getting undefined method'each' for nil:NilClass (NoMethodError) though. Any idea why it wouldn't be instantiating correctly?
thebastl has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
<yorickpeterse> zachlatta: works for me. If you're on Ruby 1.9 make sure you use `require './wordlist'` since "." is no longer in the load path
<zachlatta> That's probably my issue. Let me try that.
thebastl has quit [Remote host closed the connection]
stev_____ has joined #ruby-lang
<zachlatta> Same issue.
<zachlatta> Let me update to Ruby 2.0. Currently running the version that comes with macs.
stev_____ has left #ruby-lang [#ruby-lang]
ssssss has joined #ruby-lang
<yorickpeterse> eh, wat
<zachlatta> ?
ssssss has left #ruby-lang [#ruby-lang]
<yorickpeterse> unless you have some seriously broken Ruby setup that should work fine
Gaelan has joined #ruby-lang
<zachlatta> I've been meaning to compile it from source anyways.
<yorickpeterse> use ruby-build for that and save yourself trouble
ssssss has joined #ruby-lang
<ssssss> How would I do this in ruby? [1,2,3,4] -> [[1,2],[3,4]] ?
<apeiros_> each_slice(2).to_a
sush24 has quit [Ping timeout: 246 seconds]
<ssssss> apeiros_: thanks :-)
<zachlatta> yorickpeterse: Here's a screenshot of my setup, if it helps http://i.imgur.com/mZbAM8h.png
<zachlatta> It has the specific error, version of ruby, and code I'm running.
<drbrain> zachlatta: gist.github.com is the best way to post code and output
mbj has joined #ruby-lang
<zachlatta> drbain: I've been using that. I was hoping seeing all three things at once would be useful in some way.
<drbrain> zachlatta: you can put multiple files in a single gist
<zachlatta> Have been. Here's the gist of the code https://gist.github.com/zachlatta/30ad8c997ac076df21a4
<mbj> whitequark: Can we agree on using parentheses for method calls? This mayor difference to my stiyle confuses me.
<drbrain> your problem is that you assign to a local variable code_words (which only exists in wordlist.rb)
<drbrain> then reference a global variable $code_words that you haven't created
<drbrain> I would use a constant, CODE_WORDS
<zachlatta> Oh!
<whitequark> mbj: I think I follow it...
<yorickpeterse> zachlatta: in other words, you didn't do what you actually did in the Gist
<whitequark> mbj: can you give an example?
<drbrain> local variables aren't shared across files
<zachlatta> I forgot to make it in wordlist.rb a global variable.
<zachlatta> Entirely my fault.
<zachlatta> Sorry for wasting your time. Thank you so much for spotting that~
<yorickpeterse> no worries
<zachlatta> *!
chessguy has joined #ruby-lang
<drbrain> zachlatta: the best part about a gist is that you can check it out, update, then commit
<drbrain> so we see exactly what you just ran
sush24 has joined #ruby-lang
<zachlatta> Yeah. I love how they're each their own git repo.
<mbj> whitequark: I'd write this https://github.com/whitequark/parser/blob/master/lib/parser/static_environment.rb#L16 as @stack.push(@variables)
<zachlatta> Really sorry for being stupid and wasting your time.
<drbrain> zachlatta: nah, it's cool
<drbrain> I made typos like that all the time when I was first learning stuff
<whitequark> mbj: OK
<mbj> whitequark: Expect commits. Walking through the code changing all the method calls.
<drbrain> unfortunately there wasn't a nice IRC channel like this one, or any paste services, to point out the simple things I did wrong
<yorickpeterse> Fuck you Ruby, fuck you for having a recursive list of the same constants
<whitequark> mbj: yep. I'll probably write them again like that in the future--I don't really notice the difference between two styles--feel free to change them as you see fit.
<mbj> whitequark: thx for accepting that change. I can read code with that specific style fastest, I'm trained ;)
<ssssss> How would I do this in ruby, e.g. create links between my array items? [1,2,3,4] -> [[1,2], [2,3], [3,4]]
<whitequark> ssssss: array.each_cons(2)
<mbj> whitequark: BTW I only use parentheses for methods that take arguments! No so you'll not see foo.bar()
<ssssss> whitequark: thanks :-)
<whitequark> ssssss: I think it's the first time in my life when that method was useful
<whitequark> what are you using it for?
<whitequark> mbj: sure
<ssssss> I have a list of points, and I want to draw lines between them. Making the array a list of joined points seems nicer than iterating and remembering the last point as I go, if that makes sense
<mbj> whitequark: Problem to use strict CQS, command methods that mutate state return self, query methods the query result and do NOT mutate the instance.
<mbj> whitequark: So attr writers would return self.
<whitequark> ssssss: you cau use array.each_cons(2) do |first, second| ... end
mistym has joined #ruby-lang
ubersapiens has joined #ruby-lang
<ssssss> cool
<whitequark> mbj: yeah I see your point. that particular method isn't used in that fashion but it's better that way nevertheless
<mbj> whitequark: I follow CQS very strictly, reduces longterm error count.
<mbj> whitequark: Are you used to metric tools such as flay / flog / reek ?
<mbj> whitequark: Especially flay is very good in helping to find duplicated code / duplicated structures.
<whitequark> mbj: I use codeclimate
<whitequark> all these tools will fail on autogenerated code, which is the majority of code in parser
<mbj> whitequark: Codeclimate uses flay internally, but it is not very strict. Typicall code we wrote for dm2 core libs is A once I push the first time.
sush24 has quit [Quit: This computer has gone to sleep]
cms has quit [Remote host closed the connection]
<mbj> whitequark: I'll add these tools and ignore autogenerated stuff?
<whitequark> mbj: sure thing.
cms has joined #ruby-lang
<yorickpeterse> hahahaha File
<yorickpeterse> here, watch
Technodrome has quit [Quit: Technodrome]
<yorickpeterse> >> File.constants.include?(:readable)
<eval-in> yorickpeterse => false (http://eval.in/14106)
<yorickpeterse> oh
<yorickpeterse> then that's Rbx
<yorickpeterse> ffs
<yorickpeterse> either way
<whitequark> rbx>> true
<yorickpeterse> File.constants.include?(:readable) # => true on Rbx, File.const_get(:readable) => error
Technodrome has joined #ruby-lang
<Technodrome> my friend dented my macbook retina, blah
<Technodrome> nothing to bad but damnnit
<yorickpeterse> Technodrome: dent his face
<Technodrome> seriously man, if i did this, he would be demanding a new one
* whitequark just found pliers in his blanket
<Technodrome> swinging his key around , i told him to stay away while swinging it
<Technodrome> nothing to bad, but still, messes up the perfect light refraction
<yorickpeterse> whitequark: always handy to have a pair of pliers
<Technodrome> all my friends are bums
<whitequark> yorickpeterse: but wtf were they doing there?!
<yorickpeterse> Don't ask me, they're your blankets
<Technodrome> my girlfriends are more of hustlers than these men
<mbj> whitequark: I'd like it to have all requires in the main lib file. "parser.rb" in this case. This makes it easy to keep track of dependencies.
<whitequark> mbj: the idea was to allow `require 'parser/ruby19'` and only have stuff required to parse 1.9
<whitequark> given that the parsers are 6KLOC ruby files with lots of stuff, I think that might be important.
<yorickpeterse> ^
<yorickpeterse> and fuck autoload
<whitequark> yes, no autoload.
<mbj> whitequark: Ack, but lets move requires for stuff in stdlib to parser.rb
<whitequark> mbj: require 'set' ?
<mbj> yeah
<whitequark> it's the same reason actually. require 'parser/ruby19' won't require 'parser'
<mbj> whitequark: parser/ruby19 could require 'parser'
<whitequark> mbj: but then it will also require parser/18 parser/20 etc
<mbj> whitequark: Than lets add parser/dependencies
<whitequark> thus pulling in all the stuff I have tried to avoid pulling in
<mbj> whitequark: So parser/ruby19 could pull that file.
<mbj> whitequark: Just like parser/{18,20}
<whitequark> mbj: I have a better idea: let's have parser/all which pulls parser and parser/ruby{18,19,20}
<whitequark> and parser will pull in everything else
<mbj> whitequark: yeah
<mbj> whitequark: good one.
<mbj> whitequark: Changeing
nertzy2 has joined #ruby-lang
<mbj> whitequark: There will only be one leyer for 18 19 and 20 ?
<mbj> s/leyer/lexer/
<whitequark> mbj: yes
<whitequark> the changes to lexer are insignificant
Gaelan has quit [Remote host closed the connection]
<whitequark> well, not significant enough to mandate forking it
<mbj> yeah
breakingthings has joined #ruby-lang
Gaelan has joined #ruby-lang
<mbj> whitequark: From specs I typically only do require '$main_lib_here'
<mbj> whitequark: No "selective require"
nertzy has quit [Ping timeout: 240 seconds]
<whitequark> mbj: why not?
<whitequark> it encourages decoupling
<mbj> whitequark: So we do not have to care if each class / module under test can act like a require entry point.
<mbj> whitequark: Lets say we test foo/bar/baz
<mbj> whitequark: Do we now foo/bar/baz knows to require all the dependencies in correct order?
<yorickpeterse> whitequark: you don't happen to have some code lying around that fetches all constants of X recursively? The stuff I have shits up for some reason (sec)
<whitequark> yorickpeterse: I don't think so
<yorickpeterse> https://gist.github.com/YorickPeterse/925ca0fb759656656cbf too lazy to fix indentation
<mbj> whitequark: Maintaining all files as possible require entrypoints is a pain in the ass.
<yorickpeterse> it bars because of a SystemStackError due to File/Dir being recursive somehow
<yorickpeterse> even though the ignore list should prevent that from happening
<whitequark> mbj: ok
<mbj> whitequark: This project is aimed to be small, but IMHO it is good pratcies to only explicitly maintain specific entrypoints. {parser,parser/{all,18,19,20}} in our case.
<whitequark> mbj: you have a point, yea
cms has quit [Remote host closed the connection]
<mbj> whitequark: Sorry for reparsing ;) thx for accepting.
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
S2kx has quit [Ping timeout: 256 seconds]
<mbj> whitequark: I'll not add parentheses for assertions n tests. I typically consider the assertion methods as keywords.
<mbj> whitequark: Just when parsing mentally.
<whitequark> mbj: ... you don't want to know how exactly parenthesesized arguments to keywords are handled
<whitequark> you REALLY don't want to know.
<mbj> whitequark: heh
* whitequark cries
<mbj> whitequark: I read through the lexer already, it is understandable but for now I only scratched the surface.
<whitequark> mbj: I'll soon have the Ruby Hacking Guide chapter 11 translated from Japanese, it explains the MRI lexer in detail
<mbj> whitequark: yeah
<whitequark> the Ragel lexer is a far descendant of the MRI lexer with most of weird quirks removed, but RHGc11 still helps
<mbj> whitequark: Isnt there good information about lexing in the ruby iso standard?
<whitequark> mbj: nope, it only provides the formal grammar
<mbj> whitequark: EBNF?
<whitequark> it could be used as an input to a PEG parser, maybe, after quite a few adjustments. but not more
<whitequark> mbj: EBNF, yes.
<mbj> whitequark: on my ever growing "to read" list ;)
<yorickpeterse> >> Dir::File
<eval-in> yorickpeterse => /tmp/execpad-fdf7f1f3ae46/source-fdf7f1f3ae46:2: warning: toplevel constant File referenced by Dir::File ... (http://eval.in/14108)
<yorickpeterse> huh wtf
<yorickpeterse> >> Dir.constants.sort
<eval-in> yorickpeterse => [] (http://eval.in/14109)
<yorickpeterse> wat
<mbj> yorickpeterse: If you access a constant in a scope such as Foo::Bar and Bar is NOT defined in Foo BUT defined in :: (toplevel) you get a warning and the toplevel one returned.
<yorickpeterse> Yes, but the odd thing here is that Rbx behaves differently
<yorickpeterse> e.g. Dir.constants *does* return a list of constants
<whitequark> yorickpeterse: rbx is odd in a lot of places.
<yorickpeterse> God damn it, this explains my stack error I think
drumond19 has joined #ruby-lang
<mbj> I do not like the "use toplevel const with warning" behavior. I hope the warning is a sign this behavior will be removed in future versions of ruby.
<whitequark> mbj: btw, consider adding yourself to LICENSE.txt and README as a contributor
<mbj> whitequark: Will do so, once I think my contribution is significant enough
<whitequark> mbj: also do you think if it's a good idea to move LexerLiteral under lexer/ and Lexer:: ?
<whitequark> it's actually a part of lexer extracted into another file for readability
<mbj> whitequark: This was on my "to speak about" list ;)
<mbj> whitequark: I prefer single substantive namespaces
<mbj> whitequark: So Parser::Lexer::Literal would be perfect for me.
<whitequark> very well
<mbj> whitequark: Also I expect we can have a Parser::Environment::{Static,Dynamic,Whatever} on the longterm.
<whitequark> mbj: no, it's only StaticEnvironment.
<whitequark> it's finished
<whitequark> "static environment" is a CS term.
<mbj> whitequark: CS term > SingleNounRule !
<whitequark> :D
<mbj> nice
judofyr has quit [Remote host closed the connection]
amerine has joined #ruby-lang
<mbj> whitequark: Back in around 2h driving. Moving back from family easter business ;)
mbj has quit [Quit: leaving]
tcopp has joined #ruby-lang
thufir_ has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Qwak has joined #ruby-lang
Gaelan has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
madb055 has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
ubersapiens has quit [Ping timeout: 245 seconds]
Asher has quit [Quit: Leaving.]
Gaelan has joined #ruby-lang
tsion has joined #ruby-lang
tsion has quit [Changing host]
tsion has joined #ruby-lang
Asher has joined #ruby-lang
hakunin has joined #ruby-lang
<whitequark> antonym to "assign"?
<whitequark> "get"? "read"? "query"?
<whitequark> or, more precisely, I need an antonym to "assignable"
symm- has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
<whitequark> 18>> a=1; a 1
<eval-in> whitequark => /tmp/execpad-7c400d080397/source-7c400d080397:2: undefined method `a' for main:Object (NoMethodError) (http://eval.in/14110)
<whitequark> 19>> a=1; a 1
<eval-in> whitequark => /tmp/execpad-22106a23693d/source-22106a23693d:2:in `<main>': undefined method `a' for main:Object (NoMethodError) (http://eval.in/14111)
<whitequark> 19>> a=1; a [1]
<eval-in> whitequark => 0 (http://eval.in/14112)
<whitequark> 18>> a=1; a [1]
<eval-in> whitequark => 0 (http://eval.in/14113)
<apeiros_> awfully uncreative, but what about unassignable?
Aria has joined #ruby-lang
MaddinXx has joined #ruby-lang
<whitequark> apeiros_: no
<whitequark> see, `var`, a local variable, is both assignable and, um, readable
<dominikh> it can appear both on the lhs and the rhs?
<whitequark> yep
<dominikh> "valid lhs" and "not a valid lhs" :P
<apeiros_> I see
cored has quit [Ping timeout: 256 seconds]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
intellitech has joined #ruby-lang
havenwood has joined #ruby-lang
jonahR has quit [Quit: jonahR]
mytrile has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mytrile has joined #ruby-lang
kbouwser has joined #ruby-lang
amerine has quit [Quit: Computer has gone to sleep.]
ruby-lang670 has joined #ruby-lang
tcopp has quit [Ping timeout: 240 seconds]
runeb has joined #ruby-lang
fire has quit [Ping timeout: 256 seconds]
Ridders24 has joined #ruby-lang
<Ridders24> anyone used axlsx ?
vlad_starkov has joined #ruby-lang
bin7me has joined #ruby-lang
runeb has quit [Ping timeout: 256 seconds]
vlad_starkov has quit [Ping timeout: 260 seconds]
Technodrome has quit [Quit: Technodrome]
fire has joined #ruby-lang
bzalasky has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
bzalasky has quit [Remote host closed the connection]
MehLaptop has joined #ruby-lang
bzalasky has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
mbj has joined #ruby-lang
ledestin has quit [Quit: ledestin]
media_slave has joined #ruby-lang
tylersmith has joined #ruby-lang
Ridders24 has quit [Quit: Leaving]
Squee-D has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
media_slave has quit [Client Quit]
thufir_ has quit [Quit: Leaving.]
tylersmith has quit [Client Quit]
media_slave has joined #ruby-lang
media_slave has quit [Client Quit]
media_slave has joined #ruby-lang
drumond19 has quit [Remote host closed the connection]
media_slave has quit [Client Quit]
rippa has quit [Ping timeout: 240 seconds]
Technodrome has joined #ruby-lang
media-slave24 has joined #ruby-lang
hakunin has quit [Remote host closed the connection]
hakunin has joined #ruby-lang
james has joined #ruby-lang
james is now known as Guest2859
Guest2859 has left #ruby-lang [#ruby-lang]
Squee-D has quit [Quit: The computer fell asleep]
beawesomeinstead has quit [Remote host closed the connection]
akahn has quit [Write error: Broken pipe]
grandy has quit [Write error: Broken pipe]
wycats__ has quit [Write error: Broken pipe]
madb055 has quit [Quit: Konversation terminated!]
media-slave24 has left #ruby-lang [#ruby-lang]
srbaker has joined #ruby-lang
akahn has joined #ruby-lang
grandy has joined #ruby-lang
wycats__ has joined #ruby-lang
beawesomeinstead has joined #ruby-lang
sepp2k has quit [Quit: Leaving.]
ykk` has quit [Remote host closed the connection]
srbaker has quit [Quit: Computer has gone to sleep.]
srbaker has joined #ruby-lang
<whitequark> oooh crap
glebm has quit [Ping timeout: 272 seconds]
<whitequark> I need to proof-read 33 pages of 10pt text
<whitequark> GHCc11 translation has arrived.
glebm has joined #ruby-lang
<whitequark> this is going to be a lot of work.
<mbj> whitequark: Why SourceFile is mutable?
<mbj> whitequark: I think two classes such as Source::String, Source::File would allow immutable implementations.
<mbj> whitequark: An interface such as Source::File.read('foo.rb') would remove the need for current SourceFile#read mutator.
<whitequark> mbj: because SourceFile will be referenced by the entire Sexp tree
<mbj> whitequark: A reason more to make it immutable!
<whitequark> ... and if you need to parse a lot of files, this is going to translate to significant amount of memory
<whitequark> even if you don't need to keep the source in memory.
<mbj> whitequark: The lexer needs to read the source so as long as Source#string returns a string we do not have to cache it in the instance?
symm- has quit [Ping timeout: 240 seconds]
<mbj> whitequark: This will not solve the cases where an explicit source is string is given.
<mbj> whitequark: I'll just accept it for now as is. Lets see where it goes.
<whitequark> mbj: this issue is more complex than that.
<whitequark> see, the SourceFile class will be used by Diagnostic and DiagnosticsEngine to output snippets of the source with highlighted locations of errors
<whitequark> for this, you need the entire source
<whitequark> (also, SourceFile will have on-demand caching of newline positions, so we can't just freeze it)
<whitequark> but on the other hand, in a lot of use cases you don't need to emit any Diagnostic-s after you've got the sexps
<mbj> whitequark: But why need the ability to exchange #source ?
<whitequark> mbj: I don't really need the ability to exchange it. I do need the ability to clear it.
<mbj> whitequark: To free memory
<whitequark> yeah.
<whitequark> since sexps are immutable, this would be the only way
<mbj> whitequark: Why cant we assign a new SourceFile instance, because it was referenced so many times...
<mbj> whitequark: Understood.
<mbj> whitequark: Thx.
<mbj> whitequark: I'm thinking about a solution, there is always one. But it takes time.
<mbj> whitequark: I'll accept it for now.
<whitequark> sure
zachlatta has quit [Read error: Connection reset by peer]
crynix has joined #ruby-lang
lcdhoffman has joined #ruby-lang
ruby-lang670 has quit [Ping timeout: 245 seconds]
sepp2k has joined #ruby-lang
ykk` has joined #ruby-lang
scottschecter has quit [Quit: WeeChat 0.4.0]
Ridders24 has joined #ruby-lang
<Ridders24> can xlsx be appended?
<Ridders24> sorry, can xlsx files be appended?
<Aria> Not without editing. They're zipped XML.
<crynix> Is the standard amount of spaces for a tab 2? Or is it user-defined.
<crynix> *user-preference
<r0bglees0n> 2 spaces.
<r0bglees0n> also known a "soft tabs".
<havenwood> +1 2-space soft-tabs
<ggreer> 2 or 4 depending on how indentation-heavy your code is :)
<ggreer> but never 3. only heretics use 3 spaces
<havenwood> ggreer: Absolutely heretical to 4-space Ruby!
<ggreer> I usually end up in callback hell in javascript, so I use 2 spaces there
<ggreer> but in python and ruby I use 4
<havenwood> ggreer: At least 3-space is avant guard!
<havenwood> s/guard/guarde
<ggreer> heh
<r0bglees0n> ggreer: common practice is 2 spaces, though.
<havenwood> garde**
<ggreer> yeah I don't mind 2 spaces
<ggreer> or 3 really, although I rarely see 3
<havenwood> ggreer: Seems to me that in Python there is a real choice of 2 or 4 spaces, but Ruby is solely 2. I jest about 3. :P
<ggreer> heh
<havenwood> Actually, now that I think about it... how odd that Python has a choice and Ruby is set in its ways. Opposite of Ruby's normal TIMTOWTDI ethos.
<ggreer> weird. I could have sworn I used 4 spaces
<havenwood> 4 is gross.
<ggreer> I think it depends on how wide your screen is and how many indentations you go to
<zenspider> whitequark: how the hell do you come up with these?
<rue> zenspider: He grows them in a lab, I’ve seen the jars.
<zenspider> they must smell bad
mytrile has quit [Remote host closed the connection]
Ridders24 has quit [Ping timeout: 240 seconds]
<whitequark> zenspider: I have an FSM engine in my head.
<whitequark> zenspider: also if you're interested I have a preliminary translation of RHG chapter 11
Ridders24 has joined #ruby-lang
<whitequark> about the finite-state-machine MRI lexer
<Ridders24> crynix: i have a loop that outputs twitter info into what was a tsv file, however i wanted to out the info into an xlsx file, how can i get it to put each tweet on a new line rather than over writing the last
<crynix> I'm really not the person to ask, as I'm not very familiar with Ruby. You could try building a string and writing the entire thing to a file (this might be wrong).
MehLaptop has quit [Remote host closed the connection]
<zenspider> whitequark: wrt the tern stack state thing... I'm gonna have to go diffing against history, but I don't think it can be removed.
<zenspider> I think I'm prolly missing a test mixing ternaries and ?x lits
<zenspider> which... blows.... but there ya go
<whitequark> fuck. fuck. fuck. fuck. fuck. do you know what I've just paid $500 to look at?!
<whitequark> Finally, the definition of `COND_LEXPOP()` looks a bit strange – that seems to be a way of dealing with lookahead. However, the rules now do not allow for lookahead to occur, so there’s no purpose to make the distinction between `POP` and `LEXPOP`. Basically, at this time it would be correct to say that `COND_LEXPOP()` has no meaning.
<whitequark> HAS. NO. MEANING.
* whitequark proceeds to bang his head on the nearest wall.
<zenspider> I recommend a desk
<zenspider> you get more torque bending that way
<whitequark> zenspider: the tern stack state is missing in 1.9 and 2.0 MRI lexers
<zenspider> you should come to my cafe... marble tabletops at navel height. you can really bash your brains in that way
<whitequark> don't you think I've just removed it mindlessly :S
<whitequark> hrm, also in 1.8 lexer
<zenspider> whitequark: that doesn't mean I can't remove it. not until I stop sharing my lexer code across impls
scottschecter has joined #ruby-lang
<whitequark> zenspider: I've grepped ruby_parser and it was not used anywhere else.
<zenspider> I know. that's why I said I needed to look at history
<whitequark> 'k
<zenspider> I had a couple pull requests that hit that code and it may have removed something it shouldn't have
<zenspider> basically, I need to figure out if I _am_ missing a test
<whitequark> zenspider: btw I finally decided to split my code into my own test and simply make an RP compatibility layer
<zenspider> if I am, then I need to decide if ressurecting the old tern code is the right way to go
<whitequark> err, my own gem
<zenspider> did you ever address your speed issues?
<whitequark> I'll still prepare a PR with the new lexer for you, though
drumond19 has joined #ruby-lang
m4t_ has joined #ruby-lang
<whitequark> zenspider: yes, kind of. in fact there were no speed issues
<zenspider> I can't take it if it is 3x slower ... I think that's what you said back in the day
<whitequark> I should've only measured the time taken by successful tests; exception raising is really slow
anildigital_work has quit [Remote host closed the connection]
herpless___ has quit [Remote host closed the connection]
Spaceghost|cloud has quit [Remote host closed the connection]
Guest85414 has quit [Remote host closed the connection]
beawesomeinstead has quit [Remote host closed the connection]
grandy has quit [Write error: Broken pipe]
randym has quit [Write error: Broken pipe]
<whitequark> so I think it should be faster now. plus I solved the Unicode problem without losing any speed (I thought that would be a big perf hit).
<whitequark> (faster than RP lexer)
<zenspider> if in benchmarks at least as fast as my stuff, then I'm more than happy to fold it in. I have NO love for my lexer.
<zenspider> it is a fucking PITA
akahn has quit [Remote host closed the connection]
wycats__ has quit [Remote host closed the connection]
<zenspider> that won't die
thejspr_ has quit [Remote host closed the connection]
UziMonkey__ has quit [Remote host closed the connection]
norplr has quit [Remote host closed the connection]
ruby-lang772 has joined #ruby-lang
<zenspider> anyhow... I need to practice my talk and I'm procrastinating
<zenspider> bbi30
<whitequark> k sure
mwjcomputing has joined #ruby-lang
ruby-lang772 has quit [Client Quit]
JEG2 has joined #ruby-lang
arturo has joined #ruby-lang
arturo has left #ruby-lang [#ruby-lang]
mytrile has joined #ruby-lang
o7yhjvgdty has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
o7yhjvgdty has quit [Client Quit]
symm- has joined #ruby-lang
Ridders24 has quit [Ping timeout: 245 seconds]
agarie has joined #ruby-lang
ledestin has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
<crynix> How would I write for(int i = 0; i < 10; i++) in Ruby?
media-slave24 has joined #ruby-lang
<whitequark> crynix: 10.times { |i|
media-slave24 has left #ruby-lang [#ruby-lang]
MaddinXx has quit [Remote host closed the connection]
<crynix> woah
<crynix> elegant
<whitequark> yep.
KU0N has joined #ruby-lang
<KU0N> Hello
JEG2 has left #ruby-lang ["Leaving..."]
<crynix> Is there a do while in ruby?
media-slave24 has joined #ruby-lang
media-slave24 has left #ruby-lang [#ruby-lang]
lele has quit [Quit: Coyote finally caught me]
<KU0N> Is it possible to have the memory usage of an object and all it's reference?
wycats__ has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
lcdhoffman has joined #ruby-lang
ykk` has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
UziMonkey__ has joined #ruby-lang
TheNotary has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
s0ber_ has joined #ruby-lang
<r0bglees0n> crynix: begin; expr; end while expr.
lele has joined #ruby-lang
s0ber has quit [Ping timeout: 260 seconds]
s0ber_ is now known as s0ber
TheNotary has quit [Client Quit]
anildigital_work has joined #ruby-lang
bin7me has quit [Quit: Verlassend]
Ridders24 has joined #ruby-lang
<whitequark> ROFL
<whitequark> `EXPR_CMDARG` stands for “Before the first parameter of `command_call`” and is excluded. But wait, this meaning is also included in `CMDARG_P()`. Thus, the final conclusion of this section:
<whitequark> EXPR_CMDARG is completely useless
Ridders24 has quit [Client Quit]
<whitequark> Truth be told, when I realized this, I almost broke down crying. I was sure it had to mean SOMETHING and spent enormous effort analyzing the source, but couldn’t understand anything. Finally, I ran all kind of tests on the code using `rubylex-analyser` and arrived at the conclusion that it has no meaning whatsoever.
tsion has quit [Disconnected by services]
Guest85414 has joined #ruby-lang
semajs has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
fosky has joined #ruby-lang
<abstr4ct> Any ideas how to output to a file and/or why html does not show on standard out? https://gist.github.com/anonymous/ee04b8b39ad28aa3d22a
lcdhoffman_ has joined #ruby-lang
herpless___ has joined #ruby-lang
lcdhoffman has quit [Ping timeout: 240 seconds]
thejspr_ has joined #ruby-lang
<crynix> Ridders24: I wrote a quick script to write to an xlsx for you https://gist.github.com/zachlatta/f1b4434d3460b7ce33e0
<zenspider> crynix: just in case: don't use that for walking over arrays
<crynix> zenspider: Oh! .each is a better way, right?
<zenspider> yes
<crynix> Thanks for pointing that out!
<crynix> I'll change it right now
wmoxam has joined #ruby-lang
<zenspider> whitequark: how did you determine that EXPR_CMDARG is useless?
<crynix> zenspider: Actually, I think I need to do it that way because I need an index.
<zenspider> crynix: no, you don't. look at the Enumerable module
<crynix> I could always use each and create my own index, but that's awkward.
fosky has quit [Remote host closed the connection]
<r0bglees0n> crynix: .each.with_index is what zenspider is alluring to.
<zenspider> r0bglees0n: no, it isn't
<r0bglees0n> crynix: ok, i dont know what zenspider is alluring to :) i think he is saying you dont need an index. let me look at the code.
fosky has joined #ruby-lang
<zenspider> whitequark: CMDARG_P is just the predicate method to see if it is set. I don't see how that entirely obviates EXPR_CMDARG
<r0bglees0n> crynix: I see you need the index for write(), but i think each.with_index is probably the nicer way to do that.
<zenspider> r0bglees0n: each_with_index
<r0bglees0n> or that, sure.
<crynix> Which one is recommended to use?
<crynix> Or does it not matter?
<zenspider> avoid dots whenever possible
<r0bglees0n> well, there is no map_with_index, so sometimes you need to say map.with_index.
<r0bglees0n> that applies for other methods too
<crynix> Isn't that micro-optimization though? Or do extra method calls add significant overhead?
kbouwser has quit [Quit: Textual IRC Client: www.textualapp.com]
<r0bglees0n> i dont think its for optimization at all
<r0bglees0n> law of demeter, probably.
srbaker has quit [Quit: Computer has gone to sleep.]
<zenspider> whitequark: line 8024 in parse.y... lex_state = EXPR_CMDARG;
<zenspider> so... it IS used outside of cmdarg_stack
Technodrome has quit [Quit: Technodrome]
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
ruby-lang303 has joined #ruby-lang
<r0bglees0n> is there any language out there that lets you extend its syntax?
<r0bglees0n> from within the language itself.
<zenspider> plenty
<zenspider> smalltalk, lisp, forth, perl6... just to name a few
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
<r0bglees0n> zenspider: thanks
pkrnj has joined #ruby-lang
ruby-lang303 has quit [Ping timeout: 245 seconds]
thorncp has joined #ruby-lang
<whitequark> zenspider: very simple
<whitequark> I read the translation of RHG chapter 11
<whitequark> also I've eliminated it from my lexer. it is not a trivial transformation, but everything you need is already contained in CMDARG_P
lcdhoffman_ has quit [Quit: lcdhoffman_]
mbj has quit [Ping timeout: 246 seconds]
beawesomeinstead has joined #ruby-lang
idkazuma has joined #ruby-lang
tcopp has joined #ruby-lang
Wardrop has joined #ruby-lang
<andrewvos> whitequark: Can I get a status report on this new language?
mwjcomputing has quit [Quit: Leaving]
jg has quit [Ping timeout: 246 seconds]
Gaelan has quit [Remote host closed the connection]
idkazuma has quit [Remote host closed the connection]
<whitequark> andrewvos: the led blinker is to be compiled soon.
<whitequark> I plan to release first alpha builds in a month or two.
<andrewvos> Can I see?
chessguy has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 255 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
<whitequark> andrewvos: what exactly?
<whitequark> alpha builds? sure, I'll add you to the list
<andrewvos> Cool thanks :)
Qwak has quit []
akahn has joined #ruby-lang
lewis1711 has joined #ruby-lang
Gaelan has joined #ruby-lang
nXqd has quit [Ping timeout: 256 seconds]
chessguy has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
wmoxam has quit [Ping timeout: 240 seconds]
mrfelix has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
postmodern has joined #ruby-lang
wmoxam has joined #ruby-lang
sepp2k has quit [Remote host closed the connection]
mrfelix has quit [Quit: Computer has gone to sleep.]
TheNotary has joined #ruby-lang
wmoxam has quit [Ping timeout: 252 seconds]
idkazuma has joined #ruby-lang