<ReinH>
anannie: it makes a hash use .equal? instead of .eql? when comparing hash keys
<ReinH>
but I've never actually seen it used
<bnagy>
anannie: s1="a"; s2="a"
<bnagy>
s1==s2 but they're not the same object
<anannie>
they are not identical
gaveen has joined #ruby-lang
<ReinH>
.equal? is true iff the argument is the same object as the receiver
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
<ReinH>
== is true if the argument has the same value as the receiver
<ReinH>
so for instance 1 == 1.0 # => true
<ReinH>
where "has the same value" can be defined differently for different classes
<ReinH>
.eql? is true iff the objects are both == equal and the same type
<ReinH>
at least this is the expected contract of these methods
<ReinH>
you can define them to do whatever you want ofc
<bnagy>
compare n1=3; n2=3 - because ruby fixnums are immediate, they are equal and eql
undersc0re97 has quit [Ping timeout: 244 seconds]
<anannie>
but n1 = 4; n2 = 5 is equal but not eql
<bnagy>
ditto symbols, which is a lot of the point of them
<whitequark>
whereas n1=3e20; n2=3e20 are eql, but not equal
<ReinH>
anannie: uh no
<bnagy>
anannie: no those are neither :)
<anannie>
ReinH, bnagy: Okay, so it isn't the same object type either. It has to be exactly the same object?
<bnagy>
that's the intent
<ReinH>
anannie: equal? is true iff the object and the receiver are the same object
<ReinH>
at least that's the expected behavior
Ethan3 has joined #ruby-lang
<anannie>
so what does the compared_by_identity method do again when you put it into a hash? If I use it then I can't retrieve the values using the key, why?
<whitequark>
you can think of equal? as this: def equal?(other); object_id == other.object_id; end
<ReinH>
anannie: because it compares values using equal?
<ReinH>
rather than eql?
<bnagy>
anannie: depends what you use as keys
<bnagy>
if you use fixnums, symbols etc it should work
<ReinH>
so hash["a"] = 6; hash["a"] # => nil
<anannie>
I'm using strings
<ReinH>
because "a" and "a" are different objects
<ReinH>
anannie: you don't want to use compare_by_identity
<ReinH>
so... stop using it
<whitequark>
anannie: there are rare cases where compare_by_identity is actually needed, namely finalizers
<whitequark>
maybe some more
<anannie>
ReinH: I was just playing around, trying to learn the language
stepnem has joined #ruby-lang
<ReinH>
seems good
<anannie>
so in the case of compare by identity I actually set it to use an object as a key of sorts. The hash will retrieve some value if and only if the referenced key is the same object
<ReinH>
right
<anannie>
If my understanding is correct then that's kind of cool because it's like a lock
<ReinH>
I'm not sure how it's like a lock
<ReinH>
it just changes the way a hack compares keys for equality
<ReinH>
s/hack/hash
<certainty>
a hack :D
<anannie>
there's only one object, the same object that can "open" it and retrieve the value
<ReinH>
anannie: sure
Ethan has quit [Ping timeout: 248 seconds]
<ReinH>
I was thinking you meant something else by lock
<ReinH>
but that makes sense
Assurbanipal has joined #ruby-lang
<anannie>
Yeah I use words in non-conventional ways. Sorry.
<ReinH>
anannie: no, it's conventional, it's just that lock has another specific meaning in programming
<ReinH>
which we were just discussing
<ReinH>
so I was in the wrong context
<certainty>
the problem is that there are other ways to access the values, so the analogy doesn't hold
<anannie>
ReinH: Ah I see
<bnagy>
also it's a really terrible lock in the lock-key sense cause you can just enumerate the hash
<ReinH>
bnagy: not if I store thousands of values, most of which are bogus ;)
<anannie>
bnagy: Which means?
<certainty>
some_hash.values will give you all values. You don't need a key
<certainty>
also as this is ruby, anything can quack like your key
<ReinH>
certainty: depends on how object equality is checked
<ReinH>
if it just checks the value in the C struct you can't
<ReinH>
that would be the efficient way to do it
<ReinH>
rather than message dispatch
<ReinH>
after it hashes the obj ofc
<bnagy>
yeah this has gone to an insane place
<ReinH>
:p
<certainty>
hehe
<ReinH>
nope totes sane
<bnagy>
it's not a security mechanism, it can't be used as a security mechanism
<bnagy>
next.
<ReinH>
bnagy: no one was suggesting it could be :p
dhruvasagar has joined #ruby-lang
Bosox20051 has joined #ruby-lang
seoaqua has joined #ruby-lang
canton7 has joined #ruby-lang
mytrile has joined #ruby-lang
solars has joined #ruby-lang
<anannie>
thanks ReinH, bnagy, whitequark
jMCg_ is now known as jMCg
<erikh>
holy crap rein talked in here? and didn't go on endlessly about haskell?
* erikh
ducks
erpuds has quit [Quit: erpuds]
tooky has joined #ruby-lang
Rakko has quit [Quit: Bye]
tooky has quit [Ping timeout: 264 seconds]
seoaqua has quit [Ping timeout: 244 seconds]
crudson has left #ruby-lang [#ruby-lang]
<yorickpeterse>
Morning
justinmcp has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
<ReinH>
erikh: :)
dhruvasagar has quit [Ping timeout: 246 seconds]
<ddfreyne>
ReinH: you doing haskell these days?
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
zenspider has quit [Ping timeout: 260 seconds]
tenderlove has quit [Ping timeout: 248 seconds]
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
Criztian has joined #ruby-lang
gnufied has joined #ruby-lang
Ethan3 has left #ruby-lang [#ruby-lang]
dhruvasagar has joined #ruby-lang
Tearan has quit [Quit: Sleepy Badger....]
ttilley has quit [Quit: ttilley]
toretore has joined #ruby-lang
cndiv has quit []
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
seoaqua has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
tenderlove has joined #ruby-lang
tooky has joined #ruby-lang
postmodern has quit [Quit: Leaving]
diegoviola has joined #ruby-lang
raisingdata has left #ruby-lang [#ruby-lang]
tenderlove has quit [Ping timeout: 256 seconds]
<rue|w>
OMG ReinH and ddfreyne
cantonic_ has joined #ruby-lang
Tearan has joined #ruby-lang
GarethAdams has joined #ruby-lang
cantonic has quit [Ping timeout: 240 seconds]
cantonic_ is now known as cantonic
gnufied has quit [Quit: Leaving.]
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
<masterkorp>
Does OptionParser have the ability to set an option as mandatory ? So if that option was not passed the app would fail
rue|w has quit [Remote host closed the connection]
mksm has joined #ruby-lang
rue|w has joined #ruby-lang
mksm is now known as Guest52560
justinmcp has quit [Remote host closed the connection]
<whitequark>
judofyr: i do that sometimes
sailias has joined #ruby-lang
<andrewvos>
whitequark: Your writing style is great. Keep it up!
lcdhoffman has joined #ruby-lang
<whitequark>
andrewvos: thanks! I will.
<heftig>
whitequark: so the error created by the invalid throw jumps to the finally?
<judofyr>
whitequark: I bought EOPL3 :)
<whitequark>
heftig: nope, I should have updated the article. It turned out that AVM2 pushes the exception object
<whitequark>
that directly violates the spec
<whitequark>
so the throw isn't invalid actually
<whitequark>
judofyr: nice. how long until it arrives?
<judofyr>
whitequark: 27. sep - 1. oct
<whitequark>
somehow amazon managed to deliver it to russia in 2.5 days
<whitequark>
portal gun, probably
<whitequark>
I know no other way, especially if you consider the customs
<judofyr>
well, I used the expensive shipping (from amazon.com to Norway)
<whitequark>
ah, so DHL/FedEx
<whitequark>
I did that, too
<whitequark>
EMS has 20-30 days if you're lucky, and 40 to ∞ if not
<judofyr>
I think they're always using DHL in Norway
xyzodiac has quit [Quit: Computer has gone to sleep.]
<judofyr>
or FedEx
cirenyc has joined #ruby-lang
enebo has joined #ruby-lang
yats has joined #ruby-lang
sush24 has joined #ruby-lang
piyush has quit [Ping timeout: 246 seconds]
ttilley has joined #ruby-lang
<judofyr>
whitequark: too bad it's already "Shipping soon"; I considered adding "Compiling with Continuations" which seems interesting.
chimkan has quit [Quit: chimkan]
<judofyr>
heard about it?
tenderlove has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
jxie has joined #ruby-lang
tenderlove has quit [Ping timeout: 248 seconds]
mistym has quit [Remote host closed the connection]
mwjcomputing has joined #ruby-lang
wyhaines has joined #ruby-lang
outoftime has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
tubbo`work is now known as tubbo
dhruvasagar has quit [Ping timeout: 245 seconds]
imperator has joined #ruby-lang
jtoy has joined #ruby-lang
Criztian has quit [Read error: Connection reset by peer]
Criztian has joined #ruby-lang
Austin__ has joined #ruby-lang
piyush has joined #ruby-lang
elux has joined #ruby-lang
<whitequark>
judofyr: yeah
kith_ has quit [Read error: Connection reset by peer]
<whitequark>
it's a bit... overrated
<judofyr>
whitequark: oh?
<whitequark>
in the sense that SSA and CPS are exactly the same thing from the point of view of different camps
<whitequark>
and SSA concepts are way more comprehensible than CPS ones
<whitequark>
'cause they don't require you to twist your brain inside out :)
kith has joined #ruby-lang
boodle has joined #ruby-lang
yats has quit [Quit: Leaving]
<judofyr>
whitequark: what about the stackless-ness of CPSs?
tRAS has quit [Quit: Mother, did it need to be so high?]
piyush has quit [Ping timeout: 246 seconds]
elux has quit [Read error: Connection reset by peer]
alexkane has quit [Quit: alexkane]
sailias has quit [Quit: Leaving.]
<whitequark>
judofyr: the stack is captured by the concept of continuations
alexkane has joined #ruby-lang
<judofyr>
whitequark: I meant, how do you do something similar in SSA?
<whitequark>
err
gsav has joined #ruby-lang
<judofyr>
if they are exactly the same
gsav_ has joined #ruby-lang
<whitequark>
what exactly do you want to do? I don't understand you here
<judofyr>
whitequark: what I'm actually asking: CPS makes certain control-flow very easy to implement (call/cc, return, throw etc.) and makes it possible to avoid using the stack at all. how is that done in SSA?
imajes has quit [Excess Flood]
<judofyr>
whitequark: maybe I just should wait for EOPL3
Mon_Ouie has quit [Quit: WeeChat 0.3.8]
Mon_Ouie has joined #ruby-lang
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
<whitequark>
judofyr: CPS transform only adds continuation calls in tail position, i.e. none of the k-calls introduced by the transform increases stack size
<whitequark>
so the presence of CPS does not help you to implement call/cc
imajes has joined #ruby-lang
<whitequark>
as per return and throw: return is just an edge to exit node, and throw is an abnormal/exceptional edge in SSA graph
<whitequark>
s,is,produces,g
<whitequark>
continuation call in a tail position is equivalent to a goto instruction
lcdhoffman has joined #ruby-lang
<whitequark>
(the arguments resemble live local variables)
<judofyr>
whitequark: I thought CPS was about turning (a (b)) into (b (lambda (res) (a res))
<whitequark>
judofyr: that's a side effect
<whitequark>
CPS makes control flow explicit
<whitequark>
there is no such thing as "implicit method exit". everything that could pass the control out of the current method is represented as a call
<whitequark>
and calls which do not increase stack size, i.e. pass control between different parts of the current function or pass control upwards, are represented with continuation calls
<whitequark>
see, a function represented as an SSA graph can be turned to a giant (let* ((l1 (lambda ...)) (l2 (lambda ...)))
<whitequark>
where lX is block labels (anything which uniquely identifies the block), and lambdas contain the code in blocks
lcdhoffman has quit [Client Quit]
<whitequark>
then every edge becomes (k lX ...)
Austin__ has quit [Quit: Leaving.]
<whitequark>
*every normal edge
<whitequark>
the return edge becomes (k res ...), the exceptional one (k err ...)
Austin__ has joined #ruby-lang
<whitequark>
er, I forgot to call the enter block in that (let*), but you (hopefully) got the idea
DefV has quit [Ping timeout: 260 seconds]
DefV has joined #ruby-lang
gsav has quit [Quit: Lost terminal]
tenderlove has joined #ruby-lang
Assurbanipal has quit [Quit: Konversation terminated!]
tRAS has joined #ruby-lang
tenderlove has quit [Ping timeout: 244 seconds]
<judofyr>
whitequark: I think I do
<judofyr>
gah, Amazon is too slow
<judofyr>
it's still "Shipping Soon"
<judofyr>
I ordered it yesterday dammit
sush24 has quit [Quit: This computer has gone to sleep]
jtoy has quit [Quit: jtoy]
<zzak>
'merica
alexkane has quit [Quit: alexkane]
sush24 has joined #ruby-lang
jtoy has joined #ruby-lang
xyzodiac has joined #ruby-lang
jtoy has quit [Client Quit]
catmtking has joined #ruby-lang
coryf has joined #ruby-lang
solars has quit [Ping timeout: 248 seconds]
Bosox20051 has quit [Quit: Leaving]
|Vargas| has quit [Quit: ...]
krohrbaugh1 has quit [Ping timeout: 264 seconds]
<whitequark>
judofyr: you've obviously never stared on "Pending customs review" for weeks
vlad_starkov has quit [Remote host closed the connection]
<tsou>
whitequark: i have :P
<judofyr>
whitequark: customs review? haven't seen that here in Norway
<tsou>
judofyr: you should see it every time you order something overseas..
<judofyr>
tsou: it's been along time
sailias has joined #ruby-lang
ryanlecompte has joined #ruby-lang
jarib has quit [Excess Flood]
<judofyr>
… since I've ordered something from Amazon
<tsou>
judofyr: amazon.what?
GarethAdams has quit [Ping timeout: 264 seconds]
<judofyr>
tsou: what?
<tsou>
judofyr: which .tld? .com, .co.uk, .fr, ...
<judofyr>
tsou: oh. .com
<judofyr>
dunno why, but I've always ordered from there
<tsou>
makes 0 sense :P
jarib has joined #ruby-lang
<judofyr>
I know
<tsou>
unless it's unavailable on the european ones
<judofyr>
I know
<tsou>
hehe ok:)
<judofyr>
still, should be here in 2-4 days
<tsou>
since it's coming from the US
<tsou>
it'll go through customs
<ericwood>
.tld should be a TLD
<tsou>
which is something the shipping company (and consequently amazon as well) have no control over..
<tsou>
so it's 2-4 days to reach your country's customs, and there it may lurk for a while
<tsou>
but norway shouldn't be messed up, so i wouldn't worry too much about it
seoaqua has joined #ruby-lang
<tsou>
ericwood: you can think of . as a .tld :P
alexkane has joined #ruby-lang
gnufied1 has quit [Quit: Leaving.]
<judofyr>
tsou: where are you located?
deryl has joined #ruby-lang
ryanlecompte has quit [Remote host closed the connection]
<jperry2_>
Hi everyone, is it best to create a Struct inside an initialize method or outside in the class definition using it?
xyzodiac has quit [Quit: Computer has gone to sleep.]
gsav_ has quit [Read error: Operation timed out]
zmack has quit [Remote host closed the connection]
wallerdev has joined #ruby-lang
jperry2_ has quit [Quit: jperry2_]
rindolf has joined #ruby-lang
<rindolf>
Hi all.
<rindolf>
Hi all. «gem install --verbose ruby-debug19» is stuck on «Building native extensions. This could take a while...» for several good minutes now (on a Core i3 machine!) - what should I do?
<rindolf>
And it does not appear to consume any substantial RAM or CPU or I/O or whatever.
seoaqua has quit [Quit: 离开]
xyzodiac has joined #ruby-lang
mixtli_ has joined #ruby-lang
carloslopes has quit [Quit: Leaving.]
<andrewvos>
rindolf: Upgraded to Mountain Lion recently?
<rindolf>
andrewvos: I'm on Mageia Linux 3/Cauldron.
<andrewvos>
Oh
<andrewvos>
So no then?
<andrewvos>
:)
ryanlecompte has joined #ruby-lang
<rindolf>
andrewvos: I'm not using a Macintosh machine.
<andrewvos>
Yeah I'm joking
<rindolf>
andrewvos: ah.
<andrewvos>
I'm not a very funny man
<rindolf>
andrewvos: yes, it was mildly funny.
<rindolf>
/usr/share/ruby/gems/1.9.1/gems/linecache19-0.5.12/ext/trace_nums/trace_nums.c:39: undefined reference to `ruby_current_thread'
<rindolf>
==> sucks!
<andrewvos>
rindolf: What part is it getting stuck on?
<andrewvos>
Ooh
<andrewvos>
rindolf: I say this a lot, but have you tried pry?
<andrewvos>
rindolf: For debuggin.
<andrewvos>
debugging*
<rindolf>
Holy shit! It tried to install a new ruby distribution (of MRI).
mixtli_ has quit [Ping timeout: 264 seconds]
<rindolf>
WTF?
<rindolf>
andrewvos: I'm not familiar with pry?
<andrewvos>
rindolf: It's an irb replacement, and much much more.
<rindolf>
andrewvos: is it similar in essence to ruby-debug? Does it support 1.8.x?
<rindolf>
andrewvos: is it also a debugger?
<andrewvos>
binding.pry <-- put this in some code, and you're in the most beautifulest debugger in the world.
<andrewvos>
Also, maybe: require "pry"
<andrewvos>
rindolf: Yup it is.
<andrewvos>
rindolf: And I do believe it supports 1.8.
<rindolf>
andrewvos: OK.
<rindolf>
andrewvos: thanks! I'll check it out.
<andrewvos>
rindolf: Pleasure. I'm sure it will make you happy. Also, #pry
<rindolf>
andrewvos: OK, now I'm getting a different error - /usr/share/ruby/site_ruby/rubygems/custom_require.rb:36:in `require': cannot load such file -- binary_puzzle_solver.rb (LoadError)
<rindolf>
andrewvos: that's OK! Solved it with rspec -I. --color t/*.rb
<rindolf>
The -I. flag was missing.
<andrewvos>
:)
<rindolf>
Though it was not necessary in ruby-1.8.c
<rindolf>
Though it was not necessary in ruby-1.8.x.
Criztian has quit [Remote host closed the connection]
krohrbaugh has joined #ruby-lang
dhruvasagar has joined #ruby-lang
tenderlove has joined #ruby-lang
<darix>
rindolf: in the past "." was added to the load path yes. but many think that is a security issue
<rindolf>
darix: how strange.
<darix>
rindolf: just imagine /tmp/binary_puzzle_solver.rb and launching your script in /tmp :)
<rindolf>
darix: OK.
<injekt>
jperry2: what do you mean?
gsav has joined #ruby-lang
<rue|w>
Wow, the bat signal was really slow
<injekt>
wut
<rue|w>
I sent a slop bat signal earlier
<injekt>
haha
<injekt>
I dont have slop as a highlight
<injekt>
believe it or not
tRAS has joined #ruby-lang
<rue|w>
O M A G
GarethAdams has quit [Ping timeout: 272 seconds]
<injekt>
kinda funny as I haven't signed into irc for about 4-5 days
<andrewvos>
What's the A for?
<injekt>
amaginary
xyzodiac has quit [Quit: Computer has gone to sleep.]
<oddmunds>
haha
<andrewvos>
Actual?
<andrewvos>
Oh My Actual God
<andrewvos>
That took me longer than it should have.
<injekt>
you're spending too much time on this, andrewvos
<injekt>
^
<andrewvos>
OMAG
<rindolf>
Oh My Atrocious God.
<andrewvos>
But I learnt something new!
scampbell has joined #ruby-lang
gregmoreno has quit [Remote host closed the connection]
zmack has joined #ruby-lang
piyush has joined #ruby-lang
mcooper has joined #ruby-lang
Austin__ has quit [Quit: Leaving.]
Austin__ has joined #ruby-lang
Austin__ has left #ruby-lang [#ruby-lang]
gnufied has quit [Quit: Leaving.]
zmack has quit [Ping timeout: 248 seconds]
kain has joined #ruby-lang
chimkan_ has joined #ruby-lang
mixtli has joined #ruby-lang
carloslopes has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 244 seconds]
workmad3 has quit [Ping timeout: 244 seconds]
jperry2_ has joined #ruby-lang
dhruvasagar has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
ivanoats has joined #ruby-lang
retro|cz has quit [Remote host closed the connection]
JohnBat26 has joined #ruby-lang
chrismcg is now known as zz_chrismcg
wyhaines has quit [Remote host closed the connection]
itcharlie has joined #ruby-lang
cdt has quit [Quit: Ex-Chat]
sailias1 has joined #ruby-lang
sailias has quit [Ping timeout: 246 seconds]
butchanton has joined #ruby-lang
Carnage\ has joined #ruby-lang
Austin__ has joined #ruby-lang
Austin__ has left #ruby-lang [#ruby-lang]
rue|w has quit [Remote host closed the connection]
sepp2k1 has joined #ruby-lang
sepp2k has quit [Ping timeout: 246 seconds]
diegoviola has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
Mon_Ouie has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby-lang
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
tRAS has quit [Quit: Mother, did it need to be so high?]
boodle has quit [Quit: boodle]
macmartine has joined #ruby-lang
kirin` has quit [Ping timeout: 265 seconds]
mixtli has quit [Quit: mixtli]
sush24 has joined #ruby-lang
sush24 has quit [Client Quit]
dhruvasagar has quit [Ping timeout: 248 seconds]
gmci has quit [Quit: Computer has gone to sleep.]
dhruvasagar has joined #ruby-lang
sush24 has joined #ruby-lang
kirin` has joined #ruby-lang
lcdhoffman has joined #ruby-lang
m3nd3s has joined #ruby-lang
Mon_Ouie has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby-lang
m3nd3s_ has joined #ruby-lang
m3nd3s_ has quit [Client Quit]
sepp2k1 has quit [Read error: Connection reset by peer]
m3nd3s_ has joined #ruby-lang
areil has quit [Remote host closed the connection]
thillux has quit [Remote host closed the connection]
thillux has joined #ruby-lang
thillux has quit [Remote host closed the connection]
slux has joined #ruby-lang
<erikh>
so is the witching hour of my laundry
<erikh>
both of which have similar importance to everyone
gregmoreno has quit [Remote host closed the connection]
jamjam has joined #ruby-lang
<drbrain>
… this is when you lose your socks?
catmtking has quit [Quit: catmtking]
ivanoats has quit [Remote host closed the connection]
justinmcp has quit [Remote host closed the connection]
wyhaines has joined #ruby-lang
justinmcp has joined #ruby-lang
catmtking has joined #ruby-lang
zmack has quit [Remote host closed the connection]
diegoviola has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
<workmad3>
drbrain: it's when witchs steal his socks and cast voodoo curses on them
mcooper has quit [Quit: mcooper]
kain has quit [Quit: exit]
kain has joined #ruby-lang
slux has quit [Remote host closed the connection]
thillux has joined #ruby-lang
A124 has quit [Read error: Connection reset by peer]
sgonyea has joined #ruby-lang
yalue has quit [Read error: Connection reset by peer]
jarib has quit [Excess Flood]
gllmpn has joined #ruby-lang
solars has quit [Ping timeout: 256 seconds]
jarib has joined #ruby-lang
lcdhoffman has joined #ruby-lang
s0ber has quit [Read error: Connection reset by peer]
A124 has joined #ruby-lang
carloslopes has quit [Quit: Leaving.]
s0ber has joined #ruby-lang
imperator has quit [Quit: Leaving]
gllmpn has quit [Ping timeout: 240 seconds]
mixtli___ has joined #ruby-lang
mixtli___ has quit [Client Quit]
<deryl>
that voodoo that you do oh so well
jtoy has joined #ruby-lang
A124 has left #ruby-lang [#ruby-lang]
mixtli_ has quit [Ping timeout: 246 seconds]
outoftime has quit [Ping timeout: 265 seconds]
outoftime has joined #ruby-lang
Tearan has quit [Quit: Sleepy Badger....]
headius has joined #ruby-lang
xyzodiac has joined #ruby-lang
totallymike has joined #ruby-lang
jperry2_ has quit [Quit: jperry2_]
stepnem has quit [Ping timeout: 264 seconds]
wyhaines has quit [Remote host closed the connection]
xyzodiac has quit [Client Quit]
tenderlove has quit [Remote host closed the connection]
urbanmonk has joined #ruby-lang
RegEchse has joined #ruby-lang
totallymike has left #ruby-lang [#ruby-lang]
alvaro_o has joined #ruby-lang
thone_ has joined #ruby-lang
tenderlove has joined #ruby-lang
butchanton has quit [Ping timeout: 264 seconds]
thone has quit [Ping timeout: 240 seconds]
<erikh>
hey, my socks are in high demand
<erikh>
I have a veritable sock bubble
chimkan_ has joined #ruby-lang
gix has quit [Quit: Client exiting]
workmad3 has quit [Ping timeout: 248 seconds]
ricardovaleriano has quit [Remote host closed the connection]
gsav has quit [Ping timeout: 245 seconds]
gix has joined #ruby-lang
cirenyc has quit [Quit: Leaving...]
mistym has quit [Remote host closed the connection]
icooba has quit [Ping timeout: 252 seconds]
tonni has joined #ruby-lang
diegoviola has quit [Read error: Connection reset by peer]
enebo has quit [Quit: enebo]
butchanton has joined #ruby-lang
m3nd3s has quit [Remote host closed the connection]
m3nd3s has joined #ruby-lang
urbanmonk has quit [Quit: Leaving...]
icooba has joined #ruby-lang
m3nd3s has quit [Ping timeout: 256 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
VGoff is now known as VGoff_afk
itcharlie has left #ruby-lang [#ruby-lang]
thillux_ has joined #ruby-lang
chimkan_ has quit [Quit: chimkan_]
lcdhoffman_ has joined #ruby-lang
thillux has quit [Ping timeout: 256 seconds]
jtoy has quit [Quit: jtoy]
headius has quit [Quit: headius]
jamjam has quit [Ping timeout: 256 seconds]
Criztian has quit [Remote host closed the connection]
josh^ has joined #ruby-lang
Madis has quit [Quit: ChatZilla 0.9.89 [Firefox 11.0/20120313180949]]
lcdhoffman_ has quit [Quit: lcdhoffman_]
gregmoreno has joined #ruby-lang
japhb has joined #ruby-lang
<japhb>
How do you unpack an subarrays into arguments cleanly in iterator syntax? In other words, I am currently doing: somehash.sort.each {|p| k = p[0]; v = p[1]; do_something_with_k_and_v } However, I'd rather something that obviated the need for the pointless k and v assignments. What sugar is available for that?
<japhb>
tsou, in which class? I don't see it in the docs for either Array or Hash on ruby-doc.org
urbanmonk has joined #ruby-lang
thillux_ has quit [Remote host closed the connection]
<tsou>
shoudl be in Enumerable
<tsou>
but maybe I misunderstood your question
<tsou>
yeah, i did :)
<tsou>
if i did, then you can do foo.each { |k,v| ... }
sent-hil has quit [Remote host closed the connection]
outoftime has quit [Quit: Leaving]
<japhb>
Ah! Duh, I didn't expect that the iteration syntax was sensitive to block arity in that way
<tsou>
it's the same with assignments
<japhb>
So stupidly I didn't even try it. :-(
<tsou>
you can do x, y = [1,2,4,5]
reefraf has joined #ruby-lang
urbanmonk has quit [Client Quit]
amdprophet has quit [Ping timeout: 260 seconds]
brianpWins has joined #ruby-lang
<tsou>
japhb: or even stuff like: x, y*, z = [1,2,3,4,5] which will set x to 1, y to [2,3,4], and z to 5
anildigital_work has quit [Ping timeout: 240 seconds]
grandy__ has quit [Ping timeout: 240 seconds]
dkannan has quit [Ping timeout: 252 seconds]
beawesomeinstead has quit [Excess Flood]
<japhb>
tsou, interesting. Can you extract more than one level of hierarchy that way?
dkannan has joined #ruby-lang
<tsou>
japhb: you mean if you have your values in something like [[1,2,3],4] ?
<japhb>
tsou, exactly.
<japhb>
Can you get at 2 and 3?
<tsou>
i don't think you can do it directly
<japhb>
too bad
<tsou>
but you can use .flatten on it
<japhb>
Does that flatten all the way down, or just once?
<japhb>
Does that flatten all the way down, or just once?
<japhb>
Gah
<lianj>
flatten(level)
<japhb>
Oh, interesting
<tsou>
(all the way down if level's missing)
heftig has quit [Ping timeout: 240 seconds]
<japhb>
Yeah, I checked the docs after lianj++ mentioned the optional arg. :-)
amdprophet has joined #ruby-lang
<japhb>
tsou++ # Thank you for all the help
m3nd3s has joined #ruby-lang
VGoff_afk is now known as VGoff
dkannan has quit [Remote host closed the connection]
rikkus has quit [Remote host closed the connection]
Spaceghost|cloud has quit [Remote host closed the connection]
wycats has quit [Remote host closed the connection]
mccraig has quit [Remote host closed the connection]
cldwalker_ has quit [Remote host closed the connection]
agib has quit [Remote host closed the connection]
mroth has quit [Remote host closed the connection]
franckverrot has quit [Remote host closed the connection]
akahn has quit [Remote host closed the connection]
L0rdShrek__ has quit [Remote host closed the connection]
amdprophet has quit [Remote host closed the connection]
akamike has quit [Remote host closed the connection]
L0rdShrek__ has joined #ruby-lang
Carnage\ has quit []
petercooper has joined #ruby-lang
wycats has joined #ruby-lang
franckverrot has joined #ruby-lang
<reactormonk>
japhb: ++ doesn't exist in ruby, as integers are immutable
<erikh>
that's not the limitation, as has been argued on r-t numerous times
<erikh>
it's a design decision.
justinmcp has quit [Remote host closed the connection]
mroth has joined #ruby-lang
mroth has quit [Changing host]
mroth has joined #ruby-lang
mroth has quit [Changing host]
mroth has joined #ruby-lang
zenspider has joined #ruby-lang
snorkdude has joined #ruby-lang
zenspider has quit [Client Quit]
zenspider has joined #ruby-lang
<tsou>
japhb: you're welcome
<zenspider>
what'd I miss?
jperry2_ has joined #ruby-lang
coryf has quit [Remote host closed the connection]
<matti>
zenspider: ;]
<erikh>
zenspider: did you know ++ doesn't exist in ruby?
<matti>
zenspider: [22:04:39] < rue> OMG no zenspider
postmodern has joined #ruby-lang
<matti>
erikh: IT DOES NOT?!
<matti>
:<
<erikh>
you can't make awesome star wars ascii art in your code with ++v++
<zenspider>
erikh: omg!
<japhb>
reactormonk, ++ does exist in most karma bots, and I admit I did not check if there actually was a karma bot here. I trust my intent was clear. ;-)
akahn has joined #ruby-lang
<matti>
japhb: We do it like this: zenspider.karma += 1
<matti>
;p
<erikh>
there's no karma bot in here that I know of
wyhaines has joined #ruby-lang
<japhb>
matti, duly noted, thanks!
anildigital_work has joined #ruby-lang
<matti>
japhb: I was joking ;p
<japhb>
matti.karma += 1 # Useful tip instead of (cough) pedantry. ;-)
<japhb>
matti, works for me either way.
<matti>
;D
woollyams has joined #ruby-lang
woollyams has quit [Changing host]
woollyams has joined #ruby-lang
amdprophet has joined #ruby-lang
jperry2_ has quit [Ping timeout: 264 seconds]
beawesomeinstead has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
grandy__ has joined #ruby-lang
felixc has joined #ruby-lang
<masterkorp>
Guys do you recomend any Asynchronous IO library ?
beawesomeinstead has quit [Remote host closed the connection]
jperry2_ has joined #ruby-lang
stardiviner has joined #ruby-lang
xyzodiac has joined #ruby-lang
franckverrot has quit [Remote host closed the connection]
mroth has quit [Remote host closed the connection]
akahn has quit [Remote host closed the connection]
L0rdShrek__ has quit [Remote host closed the connection]
grandy__ has quit [Read error: Connection reset by peer]
wycats has quit [Write error: Broken pipe]
anildigital_work has quit [Write error: Broken pipe]
benanne has quit [Quit: kbai]
justinmcp has joined #ruby-lang
chimkan has joined #ruby-lang
grandy__ has joined #ruby-lang
cldwalker_ has joined #ruby-lang
grandy__ has quit [Remote host closed the connection]
<drbrain>
masterkorp: read_nonblock?
<masterkorp>
lol
<erikh>
for loop with backgrounded copies of nc
<erikh>
ooh! and tcl expect
<drbrain>
masterkorp: IO.select, then
<erikh>
it's event-driven!
mroth has joined #ruby-lang
mroth has quit [Changing host]
mroth has joined #ruby-lang
mroth has joined #ruby-lang
franckverrot has joined #ruby-lang
wycats has joined #ruby-lang
rikkus has joined #ruby-lang
rikkus has quit [Changing host]
rikkus has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]