havenwood changed the topic of #ruby to: Ruby 3.3.4 (3.4.0-preview1) https://www.ruby-lang.org | Logs https://libera.irclog.whitequark.org/ruby
<pounce> is using NilClass#=~ reasonable?
<pounce> I thought it was deprecated at one point (but idk if that was just Object#=~)
eddof13 has joined #ruby
peebs has quit [Quit: Konversation terminated!]
eddof13 has quit [Quit: eddof13]
cappy has quit [Quit: Leaving]
Vonter has joined #ruby
peebs has joined #ruby
gastus has joined #ruby
gastus_ has quit [Ping timeout: 255 seconds]
johnjaye has quit [Ping timeout: 272 seconds]
johnjaye has joined #ruby
d0htemsf has joined #ruby
<havenwood> pounce: It's unreasonable to use. It comes from a previous era. Just still around for backwards compatibility but I'd personally get rid of it.
<havenwood> Most #=~ usage has been supplanted by #match? to avoid the magic global overhead.
<havenwood> nil =~ /😬/
peebs has quit [Quit: Konversation terminated!]
Linux_Kerio has joined #ruby
grenierm has joined #ruby
d0htemsf has quit [Quit: Connection closed for inactivity]
Rounin has joined #ruby
xlymian` has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
Linux_Kerio has quit [Ping timeout: 252 seconds]
Linux_Kerio has joined #ruby
rvalue has quit [Ping timeout: 248 seconds]
rvalue has joined #ruby
gastus has quit [Ping timeout: 272 seconds]
gastus has joined #ruby
dza has quit [Quit: Ping timeout (120 seconds)]
dza has joined #ruby
<pounce> havenwood: grumpy
gastus has quit [Ping timeout: 252 seconds]
gastus has joined #ruby
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 272 seconds]
rvalue- is now known as rvalue
dviola has quit [Quit: WeeChat 4.3.6]
otisolsen70 has joined #ruby
dviola has joined #ruby
grenierm has quit [Ping timeout: 256 seconds]
Furai has quit [Quit: WeeChat 4.3.5]
Furai has joined #ruby
<gastus> havenwood: GOt it, but .beginning_of_week I have hard time finding.
user71 has joined #ruby
shiru has joined #ruby
shiru has quit [Remote host closed the connection]
otisolsen70 has quit [Read error: Connection reset by peer]
cappy has joined #ruby
passbe2 has quit [Quit: bye...]
passbe2 has joined #ruby
<havenwood> pounce: snarky
<pounce> im not grumpy at you!;
<pounce> im grumpy at the person who closed my pr fixing a nill check with .match? -> &.match? to =~
<havenwood> Ah, okay! I was confused what I'd said wrong. Haha.
<pounce> they fixed themselves with =~ *
<havenwood> pounce: You're 100% right on that one. `&.match?` is better on multiple fronts.
<havenwood> Setting all the globals is fairly expensive and a shame when you're not using them.
<havenwood> An `&.match?` also makes it explicit that a `nil` is anticipated.
<pounce> yeah
<pounce> oh well 🤷 not my project
<havenwood> Better for the reader. Better for the machine.
<havenwood> ¯\_(ツ)_/¯
<havenwood> It's nice when we can get these thing "soft deprecated" so the docs discourage ill advised usage.
<pounce> i was reading that it was originally Object#=~ which was deprecated
<pounce> but the nil one is a special case
<havenwood> It should have been dropped at the same time. Now it's just around to not be a breaking change.
<havenwood> I cringe at it being used!
<havenwood> It'd be nice for us to adopt a more consistent "soft deprecation" notice. We can keep it around for stability while acknowledging we know it's not good.
<havenwood> Standard language would be nice too. Some docs mention things are "considered deprecated" but others the docs are silent even though it's established as soft deprecated on the bug tracker.
<havenwood> Language like this is awkward too: "DateTime class is considered deprecated. Use Time class."
<havenwood> I think it's fine to say it's just plain deprecated even if there's no concrete date for removal. Also a good thing to start with.
<havenwood> Now I'm seeming grumpy. 😆
<havenwood> DateTime is deprecated. Use Time instead.
<havenwood> `nil =~` is deprecated. Use `nil&.match?` instead.
<havenwood> Class variables need one too.
<havenwood> Then there're "toy" libraries like Prime that we should document as example code not appropriate for use in production.
<havenwood> I'd really rather not ship toy code, since it most often is mistaken for a best practice standard library.
Pixi has quit [Quit: Leaving]
<havenwood> Docs should at the very least mention faster_prime.
<havenwood> The "look, some Ruby" libs could move to an examples/ or something if we want to keep them around.
<pounce> well, best practice is probably through the door with what im doing anyway
<pounce> i think the best solution to my current issue is shelling out to javascript from rails
<pounce> as horrible as that is
<havenwood> The humanity... 🙂
<pounce> ive been putting in a lot of work to use a pure ruby/C solution, but it isn't really working out
Pixi has joined #ruby
Pixi has quit [Ping timeout: 248 seconds]
Pixi has joined #ruby
powersurge360 has quit [Quit: The Lounge - https://thelounge.chat]
powersurge360 has joined #ruby
powersurge360 has quit [Changing host]
powersurge360 has joined #ruby
<adam12> pounce: minitest?
<pounce> yea
<adam12> ENV["TERM"]
<adam12> Thought it was familiar.
<adam12> I'm not sure why =~ was used.... I would have expected it for Ruby backwards compatibility but match? is 2.4 and &. is 2.3!
xlymian` has quit [Ping timeout: 276 seconds]
grenierm has joined #ruby
grenierm has quit [Client Quit]
<pounce> does anybody know of a good (LL(1)) parser library in ruby?
<pounce> i don't know if i want to use racc to generate parsers, since my grammar might change based on the situation
<pounce> so i was hoping for something where i could supply a grammar at runtime
<pounce> doing racc -> eval seems evil
gastus has quit [Ping timeout: 260 seconds]
<weaksauce> pounce you see this? https://github.com/YorickPeterse/ruby-ll
<pounce> weaksauce: this is also a parser generator, no?
<weaksauce> yeah alternative to racc
<weaksauce> but faster
<pounce> well, the eval issue still stands
gastus has joined #ruby
eddof13 has joined #ruby
Linux_Kerio has quit [Ping timeout: 258 seconds]
eddof13 has quit [Quit: eddof13]
user71 has quit [Quit: Leaving]
xlymian` has joined #ruby
xlymian` has quit [Remote host closed the connection]
cappy has quit [Remote host closed the connection]
cappy has joined #ruby
gaussianblue has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
eddof13 has joined #ruby
gaussianblue has quit [Quit: leaving]