bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<xkoncek>
if i pass a block into a function and instance_eval it, providing local functions, how is the caller able to refer to symbol of outer scopes if they need to?
Vonter has quit [Quit: WeeChat 4.1.1]
Vonter has joined #ruby
bambanxx has joined #ruby
schne1der has quit [Read error: Connection reset by peer]
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<KOTP>
Strings can contain newlines, so yes, multi-line strings are definitely doable using even "\n\n" normal quoting. Triple quotes is not a thing in Ruby, that is just concatenating strings. So `""" ... """` has the effect of wasting cpu cycles for the concatenation, while resulting in `" ... "` since the empty strings between the first two and the last two are concatenated to the single string.
<wnd>
xkoncek, probably not the answer you wanted, but you could choose not to override the method. If you don't like the sound of that, you could create an alias for the old with alias_method (or with alias with older Ruby), e.g. "def bar(...); alias_method :foo, :foo_orig" and use that.
Vonter has quit [Ping timeout: 252 seconds]
Vonter has joined #ruby
infinity_fye has joined #ruby
infinityfye has quit [Ping timeout: 256 seconds]
bambanxx has joined #ruby
TomyWork has quit [Remote host closed the connection]
jas-maelstrom has quit [Ping timeout: 256 seconds]
schne1der has quit [Read error: Connection reset by peer]
schne1der has joined #ruby
constellati0n has quit [Ping timeout: 264 seconds]
teclator has quit [Ping timeout: 255 seconds]
edr has joined #ruby
<xkoncek>
i think the best solution for my use case is defining @foo lambdas
<xkoncek>
is one of the [] .() calling syntaxes for lambdas preferred over the other?
<xkoncek>
another question, does `hash[:foo] += 1` do two hash lookups?
<xkoncek>
i was looking for the whole docs of Hash and i could not find a function which transform a single value given a key where i am provided the old value as well, closest thing was .update but you need to have the value already before the block is called
peterbecich has joined #ruby
peterbecich has quit [Ping timeout: 252 seconds]
___nick___ has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
bambanxx has joined #ruby
polishdub has quit [Read error: Connection reset by peer]
constellati0n has quit [Ping timeout: 240 seconds]
ua_ has joined #ruby
constellati0n has joined #ruby
joako has quit [Quit: quit]
caedmon has joined #ruby
joako has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
_ht has quit [Remote host closed the connection]
bambanxx has joined #ruby
John_Ivan has quit [Quit: Disrupting the dragon's slumber one time too often shall eventually bestow upon all an empirical and indiscriminate conflagration that will last for all goddamn eternity.]
John_Ivan has joined #ruby
peterbecich has joined #ruby
Paris has joined #ruby
<leftylink>
well, there are two cases: 1. the value is immutable, in which case there is no way to achieve the desired effect. 2. the value is mutable, in which case use the one lookup to get the object, then mutate it as desired
Vonter has quit [Ping timeout: 276 seconds]
<leftylink>
for example
<leftylink>
pandabot rb h = {a: 'adsfadsfsa'}; h[:a].clear; h