havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.2.2, 3.1.4, 3.0.6, 3.3.0-preview1: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://t.ly/9ua4 | Logs: https://libera.irclog.whitequark.org/ruby/
haxalot has joined #ruby
caedmon has quit [Ping timeout: 252 seconds]
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 258 seconds]
desnudopenguino1 is now known as desnudopenguino
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 258 seconds]
desnudopenguino1 is now known as desnudopenguino
markong has quit [Ping timeout: 258 seconds]
desnudopenguino has quit [Remote host closed the connection]
desnudopenguino has joined #ruby
grenierm has quit [Ping timeout: 246 seconds]
cuppajoeman has quit [Server closed connection]
cuppajoeman has joined #ruby
sympt has joined #ruby
subdue has quit [Ping timeout: 240 seconds]
haxalot has quit [Quit: Leaving]
mags has quit [Remote host closed the connection]
caedmon has joined #ruby
crankharder has joined #ruby
lena64t has joined #ruby
moldorcoder7 has quit [Ping timeout: 258 seconds]
crankharder has quit [Read error: Connection reset by peer]
JayDoubleu__ has quit [Server closed connection]
JayDoubleu__ has joined #ruby
caedmon has quit [Ping timeout: 258 seconds]
reset has quit [Quit: reset]
lucartc has quit [Remote host closed the connection]
tomtmym has joined #ruby
tomtmym has joined #ruby
grenierm has joined #ruby
lena64t has quit [Remote host closed the connection]
lena64t has joined #ruby
mbarbar has quit [Server closed connection]
mbarbar has joined #ruby
zaben has quit [Server closed connection]
zaben has joined #ruby
Linux_Kerio has joined #ruby
caedmon has joined #ruby
caedmon has quit [Ping timeout: 258 seconds]
jhass has quit [Ping timeout: 258 seconds]
jhass has joined #ruby
roadie has joined #ruby
ringo__ has quit [Server closed connection]
ringo__ has joined #ruby
foxxx0 has quit [Server closed connection]
foxxx0 has joined #ruby
integral has quit [Server closed connection]
integral has joined #ruby
teclator has joined #ruby
_ht has joined #ruby
grenierm has quit [Ping timeout: 246 seconds]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
friendlypunk has quit [Remote host closed the connection]
MalusVulgaris has joined #ruby
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 260 seconds]
desnudopenguino1 is now known as desnudopenguino
sympt has quit [Ping timeout: 252 seconds]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
lena64t has quit [Ping timeout: 240 seconds]
lena64t has joined #ruby
TomyLobo has joined #ruby
sympt has joined #ruby
infinityfye has joined #ruby
<sarna> EvanR, leftylink: late binding means deferring the lookup until runtime, so you don't really know what code will run just by looking at source code - you need to actually run it
<sarna> methods in ruby are an example of late binding - you don't know what it will do until you run it, because in the meantime somebody could've monkey-patched it
<sarna> functions are generally early-bound, even in dynamic languages. you can override them but only in the local context. so you can definitely tell what code will run just by looking at the source
MalusVulgaris has quit [Ping timeout: 258 seconds]
MalusVulgaris has joined #ruby
roadie has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.0.91)]
markong has joined #ruby
havenwood has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
sts has quit [Ping timeout: 240 seconds]
CrazyEddy has quit [Ping timeout: 240 seconds]
cata has quit [Ping timeout: 248 seconds]
rubin55_ has quit [Ping timeout: 240 seconds]
sts has joined #ruby
rubin55_ has joined #ruby
roadie has joined #ruby
cata has joined #ruby
Teagueland has joined #ruby
miah has quit [Server closed connection]
miah has joined #ruby
<johnjaye> how do i do printf interpolation in ruby
<johnjaye> like if i want to print string of 2 but have 3 leading zeroes
<johnjaye> oh it's just sprintf... i think
quintasan has quit [Server closed connection]
quintasan has joined #ruby
reset has joined #ruby
roadie` has joined #ruby
roadie` has quit [Remote host closed the connection]
roadie has quit [Ping timeout: 240 seconds]
donofrio has joined #ruby
desnudopenguino1 has joined #ruby
donofrio has quit [Remote host closed the connection]
desnudopenguino has quit [Ping timeout: 240 seconds]
desnudopenguino1 is now known as desnudopenguino
gfawcett has joined #ruby
moldorcoder7 has joined #ruby
mags has joined #ruby
mags has quit [Client Quit]
Sankalp has quit [Ping timeout: 240 seconds]
Sankalp has joined #ruby
mags has joined #ruby
MalusVulgaris has quit [Quit: MalusVulgaris]
ralu1 has quit [Server closed connection]
ralu1 has joined #ruby
lena64t has quit [Remote host closed the connection]
lena64t has joined #ruby
miah has quit [Ping timeout: 240 seconds]
miah has joined #ruby
splud has quit [Ping timeout: 240 seconds]
splud has joined #ruby
<EvanR> johnjaye, or "%03d" % two
Pixi__ has joined #ruby
Pixi` has quit [Ping timeout: 258 seconds]
Cork has quit [Ping timeout: 246 seconds]
gr33n7007h has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
fowl has quit [Server closed connection]
fowl has joined #ruby
roadie has joined #ruby
friendlypunk has joined #ruby
moldorcoder7 has quit [Ping timeout: 240 seconds]
r3m has quit [Quit: WeeChat 4.0.0-rc1]
naltun has joined #ruby
r3m has joined #ruby
<naltun> hello
naltun has quit [Ping timeout: 260 seconds]
hd1 has joined #ruby
hd1 has left #ruby [#ruby]
Jordan has quit [Server closed connection]
Jordan has joined #ruby
grenierm has joined #ruby
gfawcett has quit [Ping timeout: 252 seconds]
r3m has quit [Quit: WeeChat 4.0.0-rc1]
r3m has joined #ruby
Mikael75 has joined #ruby
Mikael75 has quit [Client Quit]
<johnjaye> does ruby allow strings inside strings inside strings?
<johnjaye> I took an expression sprintf("%02d",2) and put it inside a string interpolation "#{...}". and ruby accepted it
markong has quit [Ping timeout: 252 seconds]
mexen has quit []
r3m has quit [Quit: WeeChat 4.0.0-rc1]
grenierm has quit [Quit: Client closed]
r3m has joined #ruby
<leftylink> it sounds like you already experimented and confirmed the answer, so you have no need of any further confirmatin from others
Milos has quit [Server closed connection]
Milos has joined #ruby
<leftylink> pandabot: rb eval(100.times.reduce('') { |a, _| '"#{' + a + '}"' })
<johnjaye> sure. the implication of my question is is this normal and how far does it go
<johnjaye> normally you would backslash escape " in any other context
<leftylink> well the above is your answer
<leftylink> the number coud be increased too
<leftylink> pandabot: rb eval(10000.times.reduce('') { |a, _| '"#{' + a + '}"' })
<pandabot> stderr: -e:2:in `eval': (eval):1: memory exhausted (SyntaxError) - exit 1 - https://carc.in/#/r/f8p9
<leftylink> okay fine
<leftylink> pandabot rb eval(1200.times.reduce('') { |a, _| '"#{' + a + '}"' })
<johnjaye> well i'm not sure how to use enumerators with reduce in ruby.
<johnjaye> but i guess what you mean is, you can nest them as much as is allowed
Cork has joined #ruby
<leftylink> another way we can answer this question is to look at https://docs.ruby-lang.org/en/3.2/syntax/literals_rdoc.html#label-String+Literals
<leftylink> > Any expression may be placed inside the interpolated section
<leftylink> it doesn't say "any expression except for ....."
<leftylink> it says any expression
<johnjaye> I mean when you say any, for all, or every there's usually some implicit extent you're referring to.
<johnjaye> how long have you been using ruby for
<leftylink> I can't deny that! my reading is since this is the syntax document, "any" actually refers to "anything that is valid according to Ruby syntax"
<leftylink> I see that I've been using Ruby since September of 2010. hard to believe it's been almost 13 years
<johnjaye> that doesn't surprise me. when i talk to experts in various areas they sometimes have trouble understanding what a non-expert or beginner is even asking about their area.
<leftylink> I think there's a name for that
<leftylink> dunning krueger?
<johnjaye> there is. but i didn't want to drag it out any further.
<leftylink> oh I was wrong, dunning krueger is talking about overestimating
<leftylink> it's actually the curse of knowledge
<johnjaye> ruby often surprises me by the conveniences it gives
<johnjaye> but to you i guess it's just the norm, esp after a decade!
keypresser86_ has joined #ruby
keypresser86 has quit [Ping timeout: 260 seconds]
infinityfye has quit [Quit: Leaving]
rubin55_ has quit []
rubin55 has joined #ruby
tomtmym has quit [Quit: Gone.]
roadie has quit [Ping timeout: 240 seconds]
mretka has quit [Server closed connection]
mretka has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
_ht has quit [Remote host closed the connection]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
Linux_Kerio has quit [Ping timeout: 258 seconds]
moldorcoder7 has joined #ruby
markong has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
<ox1eef_> But wisdom is bleak, and that's a word from the wise
<ox1eef_> Not my words, credit to Lil Wayne.
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
marahin has quit [Server closed connection]
marahin has joined #ruby
adam124 has joined #ruby
kaivai has quit [Quit: ZNC - https://znc.in]
kaivai has joined #ruby
adam12 has quit [Ping timeout: 246 seconds]
adam124 is now known as adam12
markong has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
markong has joined #ruby