Aminda has quit [Read error: Connection reset by peer]
Aminda has joined #ruby
henninb has quit [Client Quit]
henninb has joined #ruby
jl- has quit [Ping timeout: 240 seconds]
henninb has quit [Client Quit]
henninb has joined #ruby
henninb has quit [Quit: leaving]
PedroG1 has joined #ruby
henninb has joined #ruby
henninb has quit [Client Quit]
henninb has joined #ruby
<PedroG1>
How to test for strings like :'if ', 'if ', etc. s.start_with('if') says s='iffier'. This is a way to test for the token 'if'. The condition is that there are going to be whitespaces after 'if': space, tab, etc
henninb has quit [Client Quit]
keb has joined #ruby
henninb has joined #ruby
henninb has quit [Client Quit]
henninb has joined #ruby
henninb has quit [Client Quit]
henninb has joined #ruby
henninb has quit [Client Quit]
keb has quit [Ping timeout: 268 seconds]
matoro has quit [Ping timeout: 255 seconds]
markong has quit [Ping timeout: 244 seconds]
matoro has joined #ruby
matoro has joined #ruby
matoro has quit [Changing host]
jpn has joined #ruby
jpn has quit [Ping timeout: 244 seconds]
moldorcoder7 has quit [Ping timeout: 272 seconds]
Aminda has quit [Write error: Connection reset by peer]
<Na_Klar>
seems so .. these ! methods are some special kind ..
jpn has quit [Ping timeout: 244 seconds]
taiju has joined #ruby
jpn has joined #ruby
<Na_Klar>
so, what do I do if I need a "not dependant copy" of a variable, I will alter with a ! method somewhere else, and my copy should be unaltered?
jpn has quit [Ping timeout: 268 seconds]
Rounin has joined #ruby
moldorcoder7_ has joined #ruby
moldorcoder7 has quit [Ping timeout: 268 seconds]
jpn has joined #ruby
jl- has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
jpn has joined #ruby
<Zerock>
Na_Klar: arr[0] = $glob.clone
jl- has quit [Ping timeout: 268 seconds]
<Na_Klar>
Zerock: ah well, good to know. thanks
<Zerock>
but yes, all ! methods do something dangerous
<Zerock>
most of the time they modify contents in place, but sometimes it's something else unexpected. I recommend carefully reading documentation before ever using one
keb has quit [Ping timeout: 268 seconds]
jpn has quit [Ping timeout: 268 seconds]
dionysus69 has joined #ruby
jpn has joined #ruby
fef has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
jpn has joined #ruby
nmollerup has quit [Quit: Leaving]
<ccooke>
! is added to a method to warn you it does something dangerous, often side effects or self modifying. Most ! methods do have non-! versions. so for instance, what it looks like you wanted to do is $glob.slice() instead of $glob.slice!()
jpn has quit [Ping timeout: 240 seconds]
Ziyan has joined #ruby
<Zerock>
ccooke: actually slice and slice! do the opposites of each other.
<Zerock>
I have an unrelated question: why does this line throw syntax error at the end: return command if name == key || command.aliases.include? name
<Zerock>
when this line does not: return command if name == key || command.aliases.include?(name)
<Zerock>
the only change is using parens or not
<ccooke>
Zerock: ... That is not the case. Both slice!(2) and slice(2) return the same thing. the difference is that they modify the caller
<ccooke>
(or not)
<Zerock>
ccooke: not according to the official documentation...
<Zerock>
slice! *deletes* the selected characters, while slice is just an index lookup
fef has quit [Ping timeout: 268 seconds]
<Zerock>
I guess it depends on how you feel about "opposite" but to me, deleting is quite opposite from selecting
<Zerock>
anyway that's not important
fef has joined #ruby
Ziyan_ has joined #ruby
Rounin has quit [Ping timeout: 268 seconds]
Ziyan has quit [Ping timeout: 272 seconds]
mbrndtgn has quit [Quit: Bye!]
mbrndtgn has joined #ruby
<Na_Klar>
ccooke: good to know as well. I thought it just implies a self-modification. using .slice instead of .slice! is just half an option, since .slice returns the removed index and not the altered string. but one can workaround that ofc.
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
weaksauce has quit [Ping timeout: 255 seconds]
jl- has joined #ruby
markong has quit [Ping timeout: 268 seconds]
Mikaela has quit [Ping timeout: 268 seconds]
Michaela has joined #ruby
Fridtjof has joined #ruby
Fridtjof has quit [Ping timeout: 268 seconds]
jl- has quit [Ping timeout: 272 seconds]
Fridtjof has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
jl- has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
nirvdrum has joined #ruby
Michaela has quit [Remote host closed the connection]
Michaela has joined #ruby
Michaela is now known as Aminda
<arfy>
Hi. I'd like some thoughts on the following. I've coded a little script that goes through midi files, and removes and modifies certain events. Part of the code uses reject! a couple of times to go through and filter out the events I don't want. Should I be too worried about speed of the code? Most of the time I'm only dealing with lists of maybe a thousand, maybe a couple of thousand items at worst.
<Zerock>
arfy: I wouldn't worry about the speed unless you are dissatisfied with the performance
<Zerock>
oftentimes the time spent thinking about optimizations outweighs the time saved by optimizing
ahayworth has joined #ruby
rhe has quit [Quit: Ping timeout (120 seconds)]
rhe has joined #ruby
ahayworth has quit [Remote host closed the connection]
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
jl- has quit [Ping timeout: 268 seconds]
jl- has joined #ruby
jl- has quit [Ping timeout: 272 seconds]
dionysus69 has joined #ruby
_ht has quit [Remote host closed the connection]
White_Lotus_24 has joined #ruby
White_Lotus_24 has quit [Client Quit]
jl- has joined #ruby
weaksauce has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
dionysus69 has joined #ruby
gr33n7007h has joined #ruby
nirvdrum_ has joined #ruby
nirvdrum has quit [Ping timeout: 240 seconds]
markong has joined #ruby
jpn has joined #ruby
maroloccio has joined #ruby
<John_Ivan>
anyone here an ocaml programmer?
nirvdrum_ has quit [Quit: nirvdrum_]
jpn has quit [Ping timeout: 240 seconds]
<leftylink>
well although I know ocaml, it would be too presumptuous for me to call myself an ocaml programmer, so I will not do that
<John_Ivan>
leftylink, I'm having an issue with not having modules detected.
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
<John_Ivan>
leftylink, sorry, had to step out. yes so, I'm basically not getting modules/packages detected, despite having used "opam" to initialize and install them. for example
<John_Ivan>
leftylink, "opam init", "opam install piaf" is what I've done, for a http client
<John_Ivan>
leftylink, but running a main.ml which has "open Piaf" complains that the module is unbound
<John_Ivan>
any ideas?
Sankalp has quit [Ping timeout: 268 seconds]
jpn has joined #ruby
Sankalp has joined #ruby
jpn has quit [Ping timeout: 272 seconds]
dionysus69 has quit [Ping timeout: 268 seconds]
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
jpn has joined #ruby
nirvdrum has joined #ruby
Sankalp has quit [Ping timeout: 268 seconds]
jl- has quit [Ping timeout: 276 seconds]
Sankalp has joined #ruby
<leah2>
ask in #ocaml not #ruby
jpn has quit [Ping timeout: 272 seconds]
<John_Ivan>
I did. they just two 2 hours to reply.