szkl has quit [Quit: Connection closed for inactivity]
finsternis has joined #ruby
cappy has quit [Quit: Leaving]
msv has quit [Remote host closed the connection]
msv has joined #ruby
msv has quit [Remote host closed the connection]
msv has joined #ruby
TomyLobo has quit [Read error: Connection reset by peer]
CRISPR has joined #ruby
CRISPR has quit [Ping timeout: 252 seconds]
__jmcantrell__ has quit [Quit: WeeChat 4.6.2]
jmcantrell_ has joined #ruby
jmcantrell_ is now known as unterzicht
shiru has joined #ruby
shiru has quit [Client Quit]
shiru` has joined #ruby
shiru` has quit [Remote host closed the connection]
unterzicht has quit [Quit: WeeChat 4.6.2]
jmcantrell_ has joined #ruby
jmcantrell_ has left #ruby [#ruby]
jmcantrell has quit [Killed (NickServ (GHOST command used by unterzicht!~weechat@user/jmcantrell))]
jmcantrell has joined #ruby
jmcantrell has quit [Changing host]
jmcantrell has joined #ruby
jmcantrell has left #ruby [#ruby]
jmcantrell_ has joined #ruby
jmcantrell_ is now known as jmcantrell
ZEN_GURU has joined #ruby
<ZEN_GURU>
hello everyone.. please chat to me... :) now .. right now!
<o0x1eef>
I'm out of practice. I didn't realize keyword args are kind of funky. As a library designer I wouldn't want the caller to write **options all the time. Sure, it adds complexity for the callee | implementation but for the caller I don't see any drawbacks?
<o0x1eef>
I'll definitely use them sparingly from here on out
ZEN_GURU has quit [Ping timeout: 276 seconds]
mahlon has quit [Ping timeout: 272 seconds]
polishdub has quit [Ping timeout: 252 seconds]
polishdub has joined #ruby
mahlon has joined #ruby
dviola has quit [Ping timeout: 265 seconds]
nirix_ has quit [Ping timeout: 248 seconds]
nirix has joined #ruby
deadmarshal_ has quit [Ping timeout: 252 seconds]
diego has joined #ruby
diego has left #ruby [WeeChat 4.6.2]
dviola has joined #ruby
deadmarshal_ has joined #ruby
aesthetikx has quit [Ping timeout: 252 seconds]
jmcantrell has quit [Ping timeout: 252 seconds]
nmollerup has joined #ruby
Rounin has quit [Ping timeout: 252 seconds]
Rounin has joined #ruby
Rounin has joined #ruby
niv has quit [Read error: Connection reset by peer]
niv has joined #ruby
Linux_Kerio has joined #ruby
Linux_Kerio has quit [Read error: Connection reset by peer]
Linux_Kerio has joined #ruby
xenoid has joined #ruby
GreenResponse has joined #ruby
xenoid has quit [Quit: Lost terminal]
o0x1eef has quit [Ping timeout: 248 seconds]
cappy has joined #ruby
CRISPR has joined #ruby
Linux_Kerio has quit [Ping timeout: 260 seconds]
marc_in_space has joined #ruby
user71 has joined #ruby
o0x1eef has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
<adam12>
o0x1eef: I don't follow.
aesthetikx has joined #ruby
jmcantrell_ has joined #ruby
jmcantrell_ is now known as jmcantrell
johnjaye has quit [Ping timeout: 248 seconds]
johnjaye has joined #ruby
johnjaye has quit [Remote host closed the connection]
johnjaye has joined #ruby
cappy has quit [Quit: Leaving]
eddof13 has joined #ruby
johnjaye has quit [Ping timeout: 252 seconds]
johnjaye has joined #ruby
andy-turner has joined #ruby
andy-turner has quit [Client Quit]
graywolf has joined #ruby
johnjaye has quit [Ping timeout: 260 seconds]
johnjaye has joined #ruby
CRISPR has quit [Ping timeout: 276 seconds]
johnjaye has quit [Ping timeout: 260 seconds]
johnjaye has joined #ruby
<o0x1eef>
It might be a bit complicated to explain. In Ruby we usually pass options as a Hash object, and those options can be built via a local variable. You would typically pass it like so: foo(options). And with kw args, we can accept variable options via **options. **options serves the same purpose as an options hash - variable key/value pairs, but your options Hash must become foo(**options). That quickly
<o0x1eef>
becomes funky if you accept variable options often in that way.
<o0x1eef>
So I think variable options should indeed always be a Hash, and kw args should describe a couple of parameters, maybe three or four at most. I'm wary of them to be honest. I think they're too similar to a Hash and yet different. The more I use them the more edge cases I find,
<o0x1eef>
adam12: Any thoughts? ^
<adam12>
o0x1eef: I dont' pass options as a Hash that often. I prefer proper keyword args as they cause me less grief.
<o0x1eef>
I went that route at first, but then I noticed I was using **options quite often (as a caller), and I didn't like it.
<adam12>
o0x1eef: I don't think much about **options, tbh.
<adam12>
I just do it.
<o0x1eef>
Hm fair enough. I don't know though. I don't think the implementation is as solid as other languages. Python has a different syntax,and then dicts for hash-like objects, which are more similar to Ruby. In Ruby they're convulted into the same syntax, and kind of feel like they were pushed through to make them fit.
<o0x1eef>
At least for me I'm going to be more careful when I use them. I'm going to use them more like positional arguments. Few parameters. Not as a replacement for a Hash of options.
johnjaye has quit [Read error: No route to host]
CRISPR has joined #ruby
sam113101 has quit [Quit: WeeChat 4.5.1]
<o0x1eef>
Then again that might just be an uphill battle not worth fighting. I don't know. Need to think about it a bit more.
CRISPR has quit [Ping timeout: 276 seconds]
sam113101 has joined #ruby
schne1der has joined #ruby
schne1der has quit [Client Quit]
schne1der has joined #ruby
<o0x1eef>
Interesting. In Ruby2 you could pass options without the double splat.
Linux_Kerio has joined #ruby
graywolf has quit [Quit: WeeChat 4.6.2]
sandra has quit [Remote host closed the connection]
sandra has joined #ruby
lucerne has joined #ruby
eddof13 has quit [Quit: eddof13]
<o0x1eef>
adam12: Do you use solar or something else for ruby's lsp?
schne1der has quit [Ping timeout: 260 seconds]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
user71 has quit [Quit: Leaving]
<adam12>
o0x1eef: I've been using ruby-lsp, tho I use very little LSP features in Ruby.
<adam12>
o0x1eef: I built ruby-lsp.nvim to make the ruby-lsp experience a bit nicer in neovim.
<adam12>
I do find the solargraph LSP somewhat nicer for stdlib docs.
<o0x1eef>
Alright. Thanks. I probably need to install one of the two (emacs is complaining about typeprof or something similar).
<adam12>
o0x1eef: I didn't have much luck with typeprof, sadly.
<o0x1eef>
Me neither, so far :D
<o0x1eef>
Just a constant error
<adam12>
I'm gradually using more of ruby-lsp. Just recently we shipped code lens support to the neovim plugin, so now I can run independent tests with the codelens feature.
<o0x1eef>
Nice!
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
cappy has joined #ruby
graywolf has joined #ruby
GreenResponse has quit [Quit: Leaving]
Linux_Kerio has quit [Ping timeout: 260 seconds]
ruby[bot] has quit [Remote host closed the connection]