adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.3, 3.0.5, 2.7.7: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ | Logs: https://libera.irclog.whitequark.org/ruby/
<ox1eef_> ah interesting
<ox1eef_> so when you type 'pgdn', you're getting three characters back: \e [ 6
<ox1eef_> three successive calls to STDIN.getch will give you that.
<ox1eef_> and, 6 will match allowed, and exit. so yeah, it needs something smarter.
<ox1eef_> looks like 'getch' will take some options, might be something there that could help. no docs at all though.
dionysus69 has quit [Ping timeout: 264 seconds]
<ox1eef_> interesting problem, but i'm too tired to continue looking into it. let me know if you find a solution isene.
<ox1eef_> i can press pgup, pgdn, end, del, ctrl+c, etc, and they're ignored, then as soon as i type something between a-z, 'getch' returns it.
<ox1eef_> Alhamdulillah[m]: i like your irc nickname!
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
hightower2 has quit [Read error: Connection reset by peer]
perrierjouet has quit [Quit: WeeChat 3.7.1]
Sankalp has quit [Ping timeout: 264 seconds]
Sankalp has joined #ruby
perrierjouet has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.7.1]
perrierjouet has joined #ruby
zoknert has joined #ruby
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 264 seconds]
Y05hito__ has joined #ruby
FullMetalStacker has joined #ruby
crax23 has quit [Ping timeout: 265 seconds]
Vonter has joined #ruby
Rounin has quit [Ping timeout: 264 seconds]
aeris has quit [Ping timeout: 255 seconds]
Y05hito__ has quit [Ping timeout: 264 seconds]
aeris has joined #ruby
moldorcoder7 has quit [Ping timeout: 265 seconds]
cartdrige has joined #ruby
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
zoknert has quit [Ping timeout: 260 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
swaggboi has quit [Quit: C-x C-c]
grokify has quit [Ping timeout: 265 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 265 seconds]
perrierjouet has quit [Quit: WeeChat 3.7.1]
grokify has joined #ruby
crax23 has quit [Ping timeout: 268 seconds]
perrierjouet has joined #ruby
cartdrige has joined #ruby
perrierjouet has quit [Client Quit]
perrierjouet has joined #ruby
perrierjouet has quit [Client Quit]
perrierjouet has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Ping timeout: 264 seconds]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 264 seconds]
Y05hito__ has joined #ruby
<havenwood> isene: Or if you just need to screen for arrow keys, maybe even something like: https://gist.github.com/havenwood/75d9837a7660282a152ed417edcc47b9
crax23 has quit [Ping timeout: 265 seconds]
cartdrige has joined #ruby
Laplace has joined #ruby
Y05hito__ has quit [Ping timeout: 268 seconds]
<Alhamdulillah[m]> <ox1eef_> "Alhamdulillah: i like your irc..." <- idkwtf: uh really ? You know the meaning right ? Btw I'm not sure how it looks for you, is it Alhamdulillah or something else, because I'm using matrix bridge to this irc
<Alhamdulillah[m]> * uh really ? You know the meaning right ? Btw I'm not sure how it looks for you, is it Alhamdulillah or something else, because I'm using matrix bridge to this irc
<havenwood> Updated to show a pattern matching version, for fun.
jhawthorn has quit [Quit: ZNC 1.8.2 - https://znc.in]
jhawthorn has joined #ruby
otisolsen70 has joined #ruby
otisolsen70 has quit [Remote host closed the connection]
otisolsen70 has joined #ruby
moldorcoder7 has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
moldorcoder7 has quit [Read error: Connection reset by peer]
tirnanog has quit [Ping timeout: 256 seconds]
moldorcoder7 has joined #ruby
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
moldorcoder7 has quit [Ping timeout: 264 seconds]
moldorcoder7 has joined #ruby
D_A_N_ has quit [Quit: leaving]
_ht has joined #ruby
teclator has quit [Read error: Connection reset by peer]
grokify has joined #ruby
grokify has quit [Ping timeout: 265 seconds]
cartdrige has quit [Ping timeout: 264 seconds]
<FullMetalStacker> Hi guys, I have a hard time understanding why modifying one variable does influence another.
<FullMetalStacker> If I do this:
<FullMetalStacker> [166] pry(main)> a = 1
<FullMetalStacker> => 1
<FullMetalStacker> [167] pry(main)> b = a
<FullMetalStacker> => 1
<FullMetalStacker> [168] pry(main)> a
<FullMetalStacker> => 1
<FullMetalStacker> [169] pry(main)> b
<FullMetalStacker> => 1
<FullMetalStacker> [170] pry(main)> a = 2
<FullMetalStacker> => 2
<FullMetalStacker> i get this as I would expect it:
<FullMetalStacker> [171] pry(main)> b
<FullMetalStacker> => 1
<FullMetalStacker> [172] pry(main)> a
<FullMetalStacker> => 2
<FullMetalStacker> But when I do this:
<FullMetalStacker> [175] pry(main)> n3 = [2, 2, 1, 2, 1]
<FullMetalStacker> => [2, 2, 1, 2, 1]
<FullMetalStacker> [176] pry(main)> new = n3
<FullMetalStacker> => [2, 2, 1, 2, 1]
<FullMetalStacker> [177] pry(main)> n3
<FullMetalStacker> => [2, 2, 1, 2, 1]
<FullMetalStacker> [178] pry(main)> new
<FullMetalStacker> => [2, 2, 1, 2, 1]
<FullMetalStacker> [179] pry(main)> new.slice!(new.index(new.min))
<FullMetalStacker> => 1
<FullMetalStacker> I get this:
<FullMetalStacker> [180] pry(main)> new
<FullMetalStacker> => [2, 2, 2, 1]
<FullMetalStacker> [181] pry(main)> n3
<FullMetalStacker> => [2, 2, 2, 1]
<FullMetalStacker> Why does my block modify both n3 and new??
<leah2> because it contains the same array
idkwtf has joined #ruby
<leah2> also dont paste long outputs here
hightower2 has joined #ruby
<FullMetalStacker> leah2 so the array is not copied but just linked while the integer in the first example was copied?
hightower2 has quit [Remote host closed the connection]
hightower2 has joined #ruby
hightower2 has quit [Read error: Connection reset by peer]
<leah2> yes
<leah2> use new = n3.dup if you wanna do that
<leah2> integers are immutable and passed by value
hightower2 has joined #ruby
<leah2> most objects are references tho
<FullMetalStacker> great, thank you very much!
hightower2 has quit [Read error: Connection reset by peer]
<FullMetalStacker> learned again something very valuable today, thank you, leah2!
hightower2 has joined #ruby
hightower2 has quit [Ping timeout: 268 seconds]
<leah2> yw :)
alexherbo2 has joined #ruby
Laplace has quit [Quit: Connection closed for inactivity]
<isene> ox1eef_: Thanks a plenty for your help, I simply boiled it all down to a simple flushing mechanism for STDIN to remove remaining garbage from control chars:
<isene> while IO.select([STDIN], [], [], 0) != nil
<isene> STDIN.getch
<isene> end
<leah2> oO
<leah2> ah with timeout 0. require 'io/console'; true while STDIN.getch(timeout: 0)
<leah2> easier maybe
<leah2> or STDIN.read_partial
reset has quit [Quit: reset]
Linux_Kerio has joined #ruby
___nick___ has joined #ruby
alexherbo2 has quit [Remote host closed the connection]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
<isene> There is no lag even without the timeout
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
idkwtf has quit [Ping timeout: 264 seconds]
idkwtf has joined #ruby
_ht has quit [Ping timeout: 260 seconds]
__ht has joined #ruby
__ht is now known as _ht
Aminda has quit [Ping timeout: 255 seconds]
Aminda has joined #ruby
__ht has joined #ruby
_ht has quit [Ping timeout: 264 seconds]
__ht is now known as _ht
balo has quit [Quit: leaving]
supay has quit [Quit: Connection closed for inactivity]
balo has joined #ruby
hightower2 has joined #ruby
kotrcka has joined #ruby
__ht has joined #ruby
_ht has quit [Ping timeout: 260 seconds]
__ht is now known as _ht
<ox1eef_> isene: welcome!
<ox1eef_> Alhamdulillah[m]: yes, of course ! I practice Islam.
__ht has joined #ruby
_ht has quit [Ping timeout: 264 seconds]
__ht is now known as _ht
grokify has joined #ruby
grokify has quit [Ping timeout: 265 seconds]
FullMetalStacker has quit [Ping timeout: 265 seconds]
<idkwtf> Yo check out these windtunnel experiments
<idkwtf> Shoutout to adam12 and havenwood
<idkwtf> Having said that, it's time to check out which clubs are open :D
<idkwtf> Bye y'all
idkwtf has quit [Quit: Lost terminal]
erblack90 has joined #ruby
erblack90 is now known as erblack
erblack is now known as erb
erb has quit [Client Quit]
erb has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
D_A_N_ has joined #ruby
jhass has quit [Quit: Bye]
tirnanog has joined #ruby
jhass has joined #ruby
<_73> With Parslet, can I create a rule that matches text that another rule *cannot* match? For example I have a grammar where a "section" is a "section_tag" followed by a "section_body". A section_tag is an alphabetic sequence surrounded by square brackets. A section_body is any text that cannot be matched as a section_tag. Here is the code I have: http://dpaste.com/BHT6R9VQG
Aminda has quit [Read error: Connection reset by peer]
Aminda has joined #ruby
gordea has joined #ruby
gordea has quit [Client Quit]
reset has joined #ruby
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
aeris has quit [Ping timeout: 255 seconds]
aeris has joined #ruby
gordea has joined #ruby
erb has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)]
kotrcka has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
<jiggawatt> bye idkwtf
ur5us has joined #ruby
<Alhamdulillah[m]> Where r u from?
Sheilong has joined #ruby
grokify has joined #ruby
dionysus69 has joined #ruby
grokify has quit [Ping timeout: 265 seconds]
coderpath has joined #ruby
Linux_Kerio has quit [Ping timeout: 264 seconds]
ur5us has quit [Quit: Leaving]
<_73> Hey, I figured it out. "absent?" is a predicate and doesn't actually parse anything, it just looks ahead. The trick is to say "(section_tag.absent? >> any).repeat.as(:body)"
phenom has quit [Ping timeout: 256 seconds]
phenom has joined #ruby
swaggboi has joined #ruby
___nick___ has quit [Ping timeout: 260 seconds]
otisolsen70 has quit [Quit: Leaving]
_ht has quit [Quit: _ht]
ox1eef_ has quit [Quit: WeeChat 3.7]
ox1eef_ has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
supay has joined #ruby
FetidToot has quit [Ping timeout: 248 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
cartdrige has joined #ruby
Sheilong has quit [Quit: Connection closed for inactivity]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 265 seconds]
FetidToot has joined #ruby
FetidToot has quit [Quit: Ping timeout (120 seconds)]
FetidToot has joined #ruby
FetidToot has quit [Client Quit]
FetidToot has joined #ruby