sh7d has quit [Read error: Connection reset by peer]
sh7d has joined #ruby
fanta1 has quit [Quit: fanta1]
Cra2yZer0 has quit [Ping timeout: 258 seconds]
Cra2yZer0 has joined #ruby
Swyper has joined #ruby
itarato_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
DaRock has quit [Ping timeout: 240 seconds]
donofrio has joined #ruby
yann-kaelig has quit [Quit: yann-kaelig]
Swyper has quit [Remote host closed the connection]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cra2yZer0 has quit [Ping timeout: 258 seconds]
Cra2yZer0 has joined #ruby
dionysus69 has quit [Quit: dionysus69]
impermanence has joined #ruby
dionysus69 has joined #ruby
impermanence has quit [Remote host closed the connection]
chalkmon1 has quit [Quit: WeeChat 2.7]
impermanence has joined #ruby
Technodrome has joined #ruby
sh7d has quit [Read error: Connection reset by peer]
sh7d has joined #ruby
TCZ has quit [Quit: Bye Bye]
_whitelogger has joined #ruby
phaul has joined #ruby
ellcs has joined #ruby
ellcs has quit [Remote host closed the connection]
Swyper has joined #ruby
chalkmonster has joined #ruby
akemhp_ has joined #ruby
HighMemoryDaemon has joined #ruby
<HighMemoryDaemon>
When not using sudo with the 'gem install', gems are installed locally in my home directory which is awesome. Is this a configuration done by Ubuntu or a new ruby/gem feature?
akemhp has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
brool has joined #ruby
akemhp_ has quit [Ping timeout: 268 seconds]
ajsharma has joined #ruby
wallace_mu has quit [Ping timeout: 265 seconds]
greenhat has joined #ruby
wallace_mu has joined #ruby
ajsharma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
djellemah has joined #ruby
djellemah has quit [Client Quit]
Cra2yZer0 has quit [Ping timeout: 265 seconds]
Cra2yZer0 has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7]
s2013 has joined #ruby
sh7d has quit [Read error: Connection reset by peer]
sh7d has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
skyikot has quit [Ping timeout: 240 seconds]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
TvL2386 has quit [Ping timeout: 258 seconds]
TvL2386 has joined #ruby
william1 has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
Nicmavr has quit [Read error: Connection reset by peer]
kosh has joined #ruby
kosh has left #ruby [#ruby]
Nicmavr has joined #ruby
skx86 has joined #ruby
BTRE has joined #ruby
subfj has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
evdubs has quit [Remote host closed the connection]
evdubs has joined #ruby
GodFather has joined #ruby
nfsnobody has quit [Ping timeout: 245 seconds]
Technodrome has joined #ruby
nfsnobody has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
erikh has quit [Ping timeout: 240 seconds]
houhoulis has joined #ruby
leitz has joined #ruby
Fernando-Basso has joined #ruby
jerry_jerry has joined #ruby
<jerry_jerry>
what does pattern matching do?
<sh7d>
matching patterns
<jerry_jerry>
great, ... is this pulp fiction?
<uplime>
jerry_jerry: it comes in a variety of forms, and i haven't looked at the 2.7 implementation yet, but pattern matching could look something like: x, 4 = [3, 4]
<jerry_jerry>
so the x becomes either 3 or 4?
<jerry_jerry>
or just 3
<uplime>
3
<uplime>
then in: x, 4 = some_arr # its only successful if some_arr[1] is 4
Nahra has joined #ruby
<jerry_jerry>
so x, 4 = [3, 6] #=> false?
<uplime>
it depends on the language. it might evaluate to false, or it could throw an error
<jerry_jerry>
so just that I understand the concept: this wouldn't work ? [1, 2, x, 3, 4] = [2, 3, 4, 5, 6]
<uplime>
right
<uplime>
ruby's impl might be used differently, but thats the basic idea behind it
<jerry_jerry>
okay, and forgive: why do I need that?
<uplime>
just another way to do a thing
<uplime>
it can be more convenient in some cases
<uplime>
continuing with my pseudo pattern matching, you'd have to do: x = if arr.second == 4 then arr.first end
<uplime>
as an equivalent
<jerry_jerry>
I see
<jerry_jerry>
still ... wondering about a real world example
wildtrees has joined #ruby
<jerry_jerry>
been doing the Numo::NArray examples and the hard part was finding real-world cases that match the functions
<uplime>
google elixir pattern matching, im sure that will come up with a lot of good (perhaps real-world) examples
<jerry_jerry>
elixir
<jerry_jerry>
aha
wildtrees has quit [Max SendQ exceeded]
<uplime>
elixir isn't ruby, but some people in here really like it, so i wouldn't be suprised if ruby's borrowed from that
<uplime>
and it uses pattern matching quite often anyways
wildtrees has joined #ruby
<jerry_jerry>
yeah, I heard a podcast with JEG and he said, wow it's like Ruby first, and after a while "wow, it's not anything like Ruby at all"
<jerry_jerry>
okay, wait can you do this in Elixir out of the box: [ 1, 2, 3, 4] * [[1], [2], [3], [4]] #=> 30
impermanence has joined #ruby
greenhat has quit [Ping timeout: 265 seconds]
<uplime>
I don't recall. i haven't written elixir in a while
<jerry_jerry>
the above in Ruby goes like this: Numo::DFloat[1,2,3,4].dot(Numo::DFloat[[1],[2],[3],[4]]) #=> 30
<jerry_jerry>
apparently, it's ugly
<jerry_jerry>
they should have called it assignment by pattern, not pattern matching
<uplime>
it goes beyond assignments. assignments are just one use case
<jerry_jerry>
I wonder how the matching works, because we have in mathematics a calculation for [1, 2, 3, 4] – [ 1, 2, 3, 4] where 1–1, 2–2, 3–3, and 4–4 is the distance
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
r3m has quit [Quit: WeeChat 2.8-dev]
<jerry_jerry>
that distance is the basis for comparing a spam mail with a spam pattern