marc_in_space has quit [Ping timeout: 258 seconds]
sleetdrop has quit [Ping timeout: 258 seconds]
weaksauce has quit [Ping timeout: 258 seconds]
havenwood has quit [Ping timeout: 258 seconds]
ih8u has quit [Ping timeout: 258 seconds]
havenwood5 is now known as havenwood
ih8u2 has joined #ruby
marc_in_space has joined #ruby
miah has joined #ruby
ih8u2 is now known as ih8u
msv has joined #ruby
Vonter has quit [Ping timeout: 255 seconds]
grenierm has joined #ruby
sleetdro- has quit [Quit: ZNC 1.8.2+deb2ubuntu0.1 - https://znc.in]
sleetdrop has joined #ruby
gois has joined #ruby
jmcantrell_ has quit [Ping timeout: 252 seconds]
infinityfye has joined #ruby
TomyWork has joined #ruby
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
mjones has quit [Server closed connection]
mjones has joined #ruby
<nakilon>
why do you say '_1 is weird as heck' if you was telling me it's nice and cool and I should use it just as much as you tell me to use 'it' now?
<nakilon>
like when in piton they were saying 'print 1 is good, better than in ruby', and after 15 years they say 'print(1) is good better than it was'
<nakilon>
like dude, your words of whether anything is better or worse are worth nothing if you just say what the HEAD version on git says
<nakilon>
it's not good or bad, better or woirse, it's just a random temporal convention
<nakilon>
that is kind of irrelevant anyway, because ruby isn't hardcoded to stop working
<nakilon>
I can run any version I want, I don't have the 'it'
<nakilon>
it's kind of like saying that everyone should vote that guy from %arbitrary_temporary_ruling_political_party%
<nakilon>
then in your biography you was in all parties possible, never really having your personal opinion
<havenwood>
nakilon: I'm not sure you're following. The original proposal had a _0 for "all the arguments" then _1 for the first, _2 for the second and so on.
<havenwood>
An `it` is like a _0, which was removed.
<havenwood>
The idea was you don't need a "first only" so might as well give _1 double duty. In retrospect, `it` serves the "all arguments" purpose and a _1 could be consistent with the other numbered block arguments.
<havenwood>
#=> [1, 2].then { _1 } #=> [1, 2]
<havenwood>
[1, 2].then { _2; _1 } #=> 1
<havenwood>
The `it` convention is getting adopted more quickly, since it's nicer than `_1` double meaning.
<havenwood>
Even just a nicer name can spur adoption, but this is more than that.
<havenwood>
For example, `yield_self` wasn't used as much until the `then` alias.
<havenwood>
The original proposal has @0, @1, etc to avoid the underscore convention as well.
<havenwood>
I liked Jeremy Evan's original proposal to make `@` what is now `it` so we can have a regular `_1`.
Linux_Kerio has joined #ruby
<o0x1eef>
Makes sense
grenierm has quit [Ping timeout: 250 seconds]
o0x1eef has quit [Ping timeout: 255 seconds]
o0x1eef has joined #ruby
<mikko>
it's slightly annoying that you need to do something like arr.map(&:first) or arr.map{it[0]} instead of just arr.map{_1} but too late to change it now
itaipu has joined #ruby
GreenResponse has joined #ruby
msv has quit [Remote host closed the connection]
GreenResponse has quit [Quit: Leaving]
<nakilon>
of course 'it' it's nicer than '_1' because before that it was '_it' or just '_'
<nakilon>
even '_[1]' is nicer than '_1'
<nakilon>
they just took from Mathematica what does not fit in Ruby
<nakilon>
it was never a good idea to access tuple members by number, and this is why Struct existed
user71 has joined #ruby
<nakilon>
and instead of resisting to introduction of this unneeded feature we've waited enough for people to unfortunately adopt the '_1' syntax so now we make a kludge 'it'
<nakilon>
while we could just cancel the idea and keep doing '_' with '|_|' because there is no much need in this codegolf
<nakilon>
also 'it' reminds me the 'subject' thing from rspec that was also some sort of a cancer, and I've read just a week ago a thread on reddit where everyone stopped using it
<nakilon>
what if I have a higher scope variable named 'it'?
<nakilon>
this all was just an unneeded codegolf from Mathematica
<nakilon>
actually yes, the exact copypasta from Mathematica would be @1, so the mistake was in the underscore
<nakilon>
I am lazy to look up what I was saying about this 5 years ago
<mikko>
i think there are definitely cases where _1 and _2 read nicer than the alternative
<mikko>
like pairs.map{[_2,_1]}
<mikko>
although i have to agree that @1 would've made more sense, _ is commonly used to mean throwaway variable that is not used anywhere
<mikko>
and it would make some sense to think of the block parameters as instance variables for the block
itaipu has quit [Read error: Connection reset by peer]
itaipu has joined #ruby
<havenwood>
nakilon: An |x| or whatever arbitrary value is better than |_| since, like I mentioned the other day, |_| breaks in IRB and |_x| signifies _x is unused.
<havenwood>
mikko: Yeah, I like it where I'd otherwise use |a, b| or |one, two| type positional block vars. I almost always use _1 with _2 and not _3.
<havenwood>
The preview initially went from _0 to _99!
<havenwood>
They landed on _1 to _9.
<o0x1eef>
Hehe
codeDude has joined #ruby
patrick has quit [Ping timeout: 276 seconds]
patrick_ is now known as patrick
patrick_ has joined #ruby
patrick_ has joined #ruby
patrick has quit [Killed (tantalum.libera.chat (Nickname regained by services))]
patrick_ is now known as patrick
patrick_ has joined #ruby
gr33n7007h has quit [Quit: WeeChat 4.7.0]
gr33n7007h has joined #ruby
acosta has quit [Server closed connection]
acosta has joined #ruby
The_Camel has quit [Ping timeout: 244 seconds]
The_Camel has joined #ruby
szkl has joined #ruby
codeDude has quit [Quit: WeeChat 4.7.1]
msv has joined #ruby
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
gr33n7007h has quit [Ping timeout: 255 seconds]
gr33n7007h has joined #ruby
nirix has quit [Server closed connection]
nirix has joined #ruby
itaipu has quit [Ping timeout: 256 seconds]
itaipu has joined #ruby
itaipu has quit [Ping timeout: 258 seconds]
Linux_Kerio has quit [Ping timeout: 258 seconds]
new has quit [Quit: Connection closed for inactivity]
itaipu has joined #ruby
jmcantrell_ has joined #ruby
jmcantrell_ is now known as jmcantrell
codeDude has joined #ruby
The_Camel has quit [Ping timeout: 256 seconds]
user71 has quit [Quit: Leaving]
jmcantrell has quit [Ping timeout: 245 seconds]
jmcantrell_ has joined #ruby
___nick___ has quit [Ping timeout: 256 seconds]
chair1 has joined #ruby
itaipu has quit [Read error: Connection reset by peer]
itaipu has joined #ruby
infinityfye has quit [Read error: Connection reset by peer]
chair95 has joined #ruby
chair1 has quit [Ping timeout: 250 seconds]
jmcantrell_ is now known as jmcantrell
chair95 is now known as chair1
szkl has quit [Quit: Connection closed for inactivity]
chair1 has quit [Ping timeout: 250 seconds]
JSharp has quit [Server closed connection]
JSharp has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
TomyWork has quit [Remote host closed the connection]
eddof13 has joined #ruby
Milos has quit [Server closed connection]
Milos has joined #ruby
patrick has quit [Ping timeout: 258 seconds]
patrick_ is now known as patrick
t1|Mike has joined #ruby
gr33n7007h has quit [Ping timeout: 258 seconds]
mjones has quit [Ping timeout: 258 seconds]
t1|Mike is now known as mjones
patrick_ has joined #ruby
patrick has joined #ruby
patrick has quit [Changing host]
patrick_ is now known as patrick
gr33n7007h has joined #ruby
gr33n7007h has quit [Ping timeout: 248 seconds]
gr33n7007h has joined #ruby
braxas has quit [Server closed connection]
braxas has joined #ruby
brw has quit [Read error: Connection reset by peer]