« Back to channel list

#ruby - 07 July 2019

« Back 1 day Forward 1 day »
[00:04:52] Exuma: has joined #ruby
[00:09:38] emptyfl4sk: has joined #ruby
[00:11:07] Technodrome: has joined #ruby
[00:19:39] Azure: has joined #ruby
[00:24:14] garyserj: when you pass a key-value pair as an argument to a parameter where the parameter is of the form blah not blah: then is it still called a keyword argument, or just a hash?
[00:29:02] _falsebay_: has joined #ruby
[00:30:52] hightower2: has joined #ruby
[00:31:55] CCDelivery: has joined #ruby
[00:40:22] fphilipe_: has joined #ruby
[00:43:10] akem_lnvo: has joined #ruby
[00:45:21] akemot: has joined #ruby
[00:47:35] lepepe: has joined #ruby
[00:48:06] lepepe_: has joined #ruby
[00:49:20] lepepe__: has joined #ruby
[01:00:20] Azure: has joined #ruby
[01:02:31] Azure|dc: has joined #ruby
[01:04:50] brool: has joined #ruby
[01:09:07] Megamos: has joined #ruby
[01:30:21] Azure: has joined #ruby
[01:35:07] Azure|dc: has joined #ruby
[01:43:15] Azure: has joined #ruby
[01:44:58] queip: has joined #ruby
[01:45:47] Azure|dc: has joined #ruby
[01:54:55] jaequery: has joined #ruby
[02:06:32] exmortus: has joined #ruby
[02:06:36] staticx: has joined #ruby
[02:08:44] staticx: has joined #ruby
[02:10:35] emptyfl4sk: has joined #ruby
[02:10:42] Azure: has joined #ruby
[02:27:53] Exuma: has joined #ruby
[02:28:40] chalkmonster: has joined #ruby
[02:29:40] facest: has joined #ruby
[02:33:37] kent\n: has joined #ruby
[02:36:03] chalkmonster: has joined #ruby
[02:37:35] leftylink: wow, well I had not thought about this working before, but it does. if using colons on the definition site and => on the call site
[02:38:15] leftylink: &>> def f(a, b: :bd, c: :cd) [a, b, c] end; f(:aa, :b => :ba, :c => :ca)
[02:38:17] rubydoc: # => [:aa, :ba, :ca] (https://carc.in/#/r/76wa)
[02:38:40] leftylink: I guess that demystifies how all this handling must go on behind the scenes if you're allowed to use => at call site
[02:41:22] fphilipe_: has joined #ruby
[02:41:48] chalkmonster: has joined #ruby
[02:43:36] haxx0r: has joined #ruby
[02:46:44] garyserj: leftylink: well, if it converts hash to keyword argument, how are we meant to know if it's passing a hash or a keyword argument, when curly braces are omitted?
[02:52:19] ascarter: has joined #ruby
[02:59:28] leftylink: that question boils down to "I don't know what this function I'm calling will do with the arguments I'm passing it". that is fundamentally a true statement, we just don't know
[03:00:02] leftylink: unless we have read its code or we believe any contract it professes to adhere to
[03:00:28] orbyt_: has joined #ruby
[03:00:48] garyserj: we are talking about functions with empty bodies here
[03:00:53] akem-lnvo: has joined #ruby
[03:01:39] leftylink: my answer doesn't mention or care what the bodies of the functions are
[03:01:40] leftylink: we don't know
[03:08:14] garyserj: i'm not asking what the function is doing with the arguments though
[03:09:13] leftylink: I see. I must have misunderstood your question then. I apologise for my misunderstanding.
[03:09:26] garyserj: to rephrase. If Ruby is converting hash to keyword argument, how are we meatn to know if Ruby i passsing a hash or a keyword argument to a function when curly braces are omitted?
[03:11:31] leftylink: well then we should try it and see what happens, and then come to an understanding. what are some potential pieces of code that would disprove a hypothesis
[03:11:38] braincrash: has joined #ruby
[03:11:50] Azure: has joined #ruby
[03:12:03] leftylink: &>> def f(a, b: :bd) [a, b] end; f(:aa, :b => :ba, :c => :ca)
[03:12:05] rubydoc: stderr: -e:2:in `f': unknown keyword: c (ArgumentError) (https://carc.in/#/r/76wb)
[03:12:10] leftylink: that is interesting
[03:12:14] leftylink: &>> def f(a, b: :bd) [a, b] end; f(:aa, :b => :ba, ?c => :ca)
[03:12:15] rubydoc: stderr: -e:2:in `<main>': non-symbol key in keyword arguments: "c" (ArgumentError) (https://carc.in/#/r/76wc)
[03:12:38] leftylink: that is even more interesting
[03:16:40] leftylink: ... should I be worried that I cannot get the exact same result on my computer...
[03:17:21] leftylink: well, it is true that I am running 2.6.3 instead of 2.6.0 like carc.in is. I wouldn't have thought that would change that though
[03:17:36] leftylink: with that exact same code, I actually get `wrong number of arguments (given 2, expected 1) (ArgumentError)`
[03:17:59] leftylink: they're doing with ruby -e
[03:18:26] leftylink: eh, no, I still get the same even if I ruby with ruby -e
[03:19:47] leftylink: I wonder if I can find a computer with ruby 2.6.0
[03:20:54] KramerC: has joined #ruby
[03:21:07] Prira: has joined #ruby
[03:32:24] leftylink: &>> def f(a, b: :bd) [a, b] end; p f(:b => :ba, 'asdf' => :ca)
[03:32:28] rubydoc: # => [{:b=>:ba, "asdf"=>:ca}, :bd] (https://carc.in/#/r/76wd)
[03:32:35] leftylink: okay, at least that produces the same result
[03:32:51] leftylink: I would have found it unfortunate if it didn't
[03:33:00] leftylink: ... not that I ever hope anyone will ever rely on this behaviour
[03:36:10] leftylink: the rule for that one seems obvious though since that was a required positional param
[03:37:37] leftylink: &>> def f(a = :adef, b: :bdef) [a, b] end; p f(:b => :bact, 'asdf' => :asdf)
[03:37:43] rubydoc: stderr: playpen: timeout triggered! (https://carc.in/#/r/76wg)
[03:37:47] leftylink: are you serious
[03:38:07] leftylink: &>> def f(a = :adef, b: :bdef) [a, b] end; p f(:b => :bact, 'asdf' => :asdf)
[03:38:10] rubydoc: stderr: -e:2:in `<main>': non-symbol key in keyword arguments: "asdf" (ArgumentError) (https://carc.in/#/r/76wi)
[03:38:33] leftylink: okay, that is actually pretty unfortunate, since it gives a different result on my computer
[03:38:53] leftylink: that being [{"asdf"=>:asdf}, :bact]
[03:39:01] leftylink: which is pretty unintuitive if you think about it
[03:39:49] orbyt_: has joined #ruby
[03:42:01] gix-: has joined #ruby
[03:47:58] Technodrome: has joined #ruby
[04:08:30] Freshnuts: has joined #ruby
[04:11:28] emptyfl4sk: has joined #ruby
[04:15:11] _whitelogger: has joined #ruby
[04:20:01] Exuma: has joined #ruby
[04:27:10] _whitelogger: has joined #ruby
[04:43:30] fphilipe_: has joined #ruby
[04:44:45] kyrylo: has joined #ruby
[04:46:39] emptyfl4sk: has joined #ruby
[04:47:59] ruby[bot]: has joined #ruby
[04:47:59] ChanServ: +o ruby[bot]
[04:48:00] [rg]: has joined #ruby
[05:02:01] ascarter: has joined #ruby
[05:08:25] lepepe: has joined #ruby
[05:12:51] za1b1tsu: has joined #ruby
[05:15:18] Exuma: has joined #ruby
[05:18:08] absolutejam1: has joined #ruby
[05:19:27] emptyfl4sk: has joined #ruby
[05:28:21] dellavg_: has joined #ruby
[05:33:40] lepepe: has joined #ruby
[05:42:11] _whitelogger: has joined #ruby
[06:06:11] _whitelogger_: has joined #ruby
[06:08:54] Giorgio: has joined #ruby
[06:11:35] mattwc: has joined #ruby
[06:12:10] _whitelogger: has joined #ruby
[06:12:17] sparch: has joined #ruby
[06:13:19] ChrisBr: has joined #ruby
[06:16:24] woodruffw: has joined #ruby
[06:16:25] woodruffw: has joined #ruby
[06:17:32] lepepe: has joined #ruby
[06:18:07] sparch: has joined #ruby
[06:18:08] Fusl: has joined #ruby
[06:18:08] twe4ked: has joined #ruby
[06:18:08] claw: has joined #ruby
[06:18:08] Nightmare: has joined #ruby
[06:18:08] evdubs: has joined #ruby
[06:18:08] infernix: has joined #ruby
[06:18:08] victorqueiroz: has joined #ruby
[06:18:08] afisher: has joined #ruby
[06:18:08] lol768_: has joined #ruby
[06:18:08] mcspud: has joined #ruby
[06:18:08] spectra: has joined #ruby
[06:18:08] marahin: has joined #ruby
[06:18:08] Pillus: has joined #ruby
[06:18:08] mnemon: has joined #ruby
[06:18:08] lupine: has joined #ruby
[06:18:08] tpendragon: has joined #ruby
[06:18:08] shansen: has joined #ruby
[06:18:30] emptyflask: has joined #ruby
[06:18:30] TomyLobo: has joined #ruby
[06:18:30] voker57: has joined #ruby
[06:18:30] yxhuvud: has joined #ruby
[06:18:30] keden: has joined #ruby
[06:18:30] SegFaultAX: has joined #ruby
[06:18:30] G: has joined #ruby
[06:18:30] giraffe: has joined #ruby
[06:18:30] goez: has joined #ruby
[06:18:30] turt2live: has joined #ruby
[06:18:30] Furai: has joined #ruby
[06:18:30] znz_jp: has joined #ruby
[06:18:30] Vircung: has joined #ruby
[06:18:30] hahuang65: has joined #ruby
[06:18:30] bathtub_shark: has joined #ruby
[06:18:30] haylon: has joined #ruby
[06:18:30] guardian: has joined #ruby
[06:18:30] uplime: has joined #ruby
[06:18:30] Net: has joined #ruby
[06:19:11] sparch: has joined #ruby
[06:22:26] victorqueiroz: has joined #ruby
[06:32:59] sarink: has joined #ruby
[06:33:05] za1b1tsu: has joined #ruby
[06:37:08] exmortus: has joined #ruby
[06:41:30] sarink_: has joined #ruby
[06:44:28] fphilipe_: has joined #ruby
[06:55:12] chalkmonster: has joined #ruby
[06:57:15] sandstrom: has joined #ruby
[07:14:51] orbyt_: has joined #ruby
[07:20:12] emptyfl4sk: has joined #ruby
[07:22:44] sparch: has joined #ruby
[07:22:44] sparch: has joined #ruby
[07:26:16] mniip: has joined #ruby
[07:48:52] reber: has joined #ruby
[07:49:06] sarink: has joined #ruby
[07:57:09] nowhereman: has joined #ruby
[08:09:30] yield: has joined #ruby
[08:11:24] Dbugger: has joined #ruby
[08:14:55] abaiste^: has joined #ruby
[08:15:18] irdr: has joined #ruby
[08:15:45] akem-lnvo: has joined #ruby
[08:16:35] Mutsuhito: has joined #ruby
[08:19:09] Yuyu0: has joined #ruby
[08:20:44] aecepoglu[m]: has joined #ruby
[08:23:40] gmcintire: has joined #ruby
[08:23:47] hahuang65: has joined #ruby
[08:24:11] sparch: has joined #ruby
[08:24:23] hahuang65: has joined #ruby
[08:24:34] CJKinni: has joined #ruby
[08:24:43] coffeejunk: has joined #ruby
[08:24:50] mcspud: has joined #ruby
[08:24:56] afisher: has joined #ruby
[08:24:59] dumptruckman: has joined #ruby
[08:25:50] uranoss: has joined #ruby
[08:26:29] victorqueiroz: has joined #ruby
[08:26:35] twe4ked: has joined #ruby
[08:28:07] lepepe: has joined #ruby
[08:30:22] JoL1hAHN: has joined #ruby
[08:31:14] pwillard: has joined #ruby
[08:32:17] lipoqil: has joined #ruby
[08:33:09] spectra: has joined #ruby
[08:34:37] strmpnk: has joined #ruby
[08:35:34] Yuyu0: has joined #ruby
[08:38:14] emptyflask: has joined #ruby
[08:44:49] lepepe: has joined #ruby
[08:47:44] akem_lnvo: has joined #ruby
[08:49:19] akem_lnvo: has joined #ruby
[08:55:02] turt2live: has joined #ruby
[08:55:13] Seance[m]: has joined #ruby
[08:59:50] schne1der: has joined #ruby
[09:00:26] fphilipe_: has joined #ruby
[09:04:13] lepepe: has joined #ruby
[09:07:36] Josse: has joined #ruby
[09:07:45] Josse: has left #ruby: ()
[09:13:30] gix: has joined #ruby
[09:27:14] fphilipe_: has joined #ruby
[09:28:53] CJKinni: has joined #ruby
[09:30:49] stooj: has joined #ruby
[09:34:12] akem_lnvo: has joined #ruby
[09:37:21] Omnilord: has joined #ruby
[09:37:31] emptyfl4sk: has joined #ruby
[09:47:51] stooj: has joined #ruby
[09:50:45] sandstrom: has joined #ruby
[10:03:33] Megamos: has joined #ruby
[10:10:46] emptyfl4sk: has joined #ruby
[10:11:46] sarink: has joined #ruby
[10:26:30] sandstrom: has joined #ruby
[10:38:58] clemens3: has joined #ruby
[10:43:21] Megamos: has joined #ruby
[10:53:31] Fernando-Basso: has joined #ruby
[10:54:12] tpanarch1st: has joined #ruby
[10:58:33] DEac-: has joined #ruby
[11:09:46] conta: has joined #ruby
[11:16:50] sarink: has joined #ruby
[11:24:23] queip: has joined #ruby
[11:26:43] sarink: has joined #ruby
[11:36:39] fphilipe: has joined #ruby
[11:52:26] fphilipe: has joined #ruby
[12:03:50] sandstrom: has joined #ruby
[12:11:51] fphilipe: has joined #ruby
[12:17:55] fphilipe: has joined #ruby
[12:26:44] henninb: has joined #ruby
[12:30:52] emptyfl4sk: has joined #ruby
[12:31:35] garyserj: &>> puts "asdf"
[12:31:37] rubydoc: # => asdf (https://carc.in/#/r/76xb)
[12:33:29] garyserj: leftylink: your line works in ruby 2.4.1 https://carc.in/#/r/76xc
[12:34:07] henninb: has joined #ruby
[12:34:38] havenwood: leftylink: There's some good discussion of where keyword arguments are heading here: https://bugs.ruby-lang.org/issues/14183
[12:34:49] henninb: has joined #ruby
[12:35:15] havenwood: leftylink: The change was introduced as part of that ^ initiative, then backed out because it introduced incompatibilities: https://bugs.ruby-lang.org/issues/15658
[12:36:01] henninb: has joined #ruby
[12:37:04] leftylink: ah so 2.6.0 and 2.6.1. good knowledge of relevant ruby issues, thank you
[12:39:31] hightower2: has joined #ruby
[12:40:00] sarink: has joined #ruby
[12:41:28] sarink: has joined #ruby
[12:41:45] matheusmoreira: has joined #ruby
[12:44:01] garyserj: &>> def abc(x:, y); end
[12:44:02] rubydoc: stderr: -e:2: syntax error, unexpected tIDENTIFIER (https://carc.in/#/r/76xd)
[12:44:10] garyserj: &>> def abc(x, y:); end
[12:44:11] rubydoc: # => :abc (https://carc.in/#/r/76xe)
[12:44:20] garyserj: Why does the first one fail?
[12:45:38] leftylink: by the rules of https://docs.ruby-lang.org/en/trunk/syntax/methods_rdoc.html , "When mixing keyword arguments and positional arguments, all positional arguments must appear before any keyword arguments."
[12:46:22] henninb: has joined #ruby
[12:46:27] AJA4350: has joined #ruby
[12:47:51] garyserj: does https://docs.ruby-lang.org/ have a table of contents by which i'd find that methods_rdoc.html ?
[12:49:09] garyserj: looks like the 'pages' section is about as close to a table of contents as it gets, ok i guess.
[12:49:23] fphilipe: has joined #ruby
[12:50:57] garyserj: ah the syntax page is pretty much it and that links to others.
[13:07:40] emptyfl4sk: has joined #ruby
[13:08:20] henninb: has joined #ruby
[13:10:39] henninb: has joined #ruby
[13:13:25] Inline_: has joined #ruby
[13:13:42] henninb: has joined #ruby
[13:25:07] fphilipe: has joined #ruby
[13:25:52] henninb_: has joined #ruby
[13:26:59] lepepe: has joined #ruby
[13:28:22] Inline: has joined #ruby
[13:35:59] henninb: has joined #ruby
[13:41:09] yo-wan: has joined #ruby
[13:51:10] _whitelogger: has joined #ruby
[13:53:22] fphilipe: has joined #ruby
[13:58:23] kyrylo: has joined #ruby
[14:03:52] ellcs: has joined #ruby
[14:33:35] fphilipe: has joined #ruby
[14:40:59] kilk: has joined #ruby
[14:48:39] cd: has joined #ruby
[14:55:28] kilk: has joined #ruby
[14:55:35] Azure: has joined #ruby
[14:59:32] sandstrom: has joined #ruby
[15:05:13] nowhereman: has joined #ruby
[15:05:55] kilk: has left #ruby: ("bye")
[15:06:22] kilk: has joined #ruby
[15:08:22] emptyfl4sk: has joined #ruby
[15:12:17] ddffg: has joined #ruby
[15:15:27] emptyfl4sk: has joined #ruby
[15:17:28] fphilipe: has joined #ruby
[15:22:53] nowhere_man: has joined #ruby
[15:23:59] Azure: has joined #ruby
[15:49:05] nowhere_man: has joined #ruby
[15:50:17] Azure: has joined #ruby
[15:50:20] Technodrome: has joined #ruby
[15:53:20] Swyper: has joined #ruby
[16:02:13] Technodrome: has joined #ruby
[16:19:15] hiroaki: has joined #ruby
[16:23:28] fphilipe: has joined #ruby
[16:24:36] johnny56: has joined #ruby
[16:30:26] orbyt_: has joined #ruby
[16:34:51] hiroaki: has joined #ruby
[16:34:56] Azure: has joined #ruby
[16:39:24] snickers: has joined #ruby
[16:43:53] shenghi: has joined #ruby
[16:53:02] xco: has joined #ruby
[16:58:06] chalkmonster: has joined #ruby
[17:02:42] queip: has joined #ruby
[17:05:31] hiroaki: has joined #ruby
[17:06:56] ngw: has joined #ruby
[17:10:22] ngw: I can't solve this exercise https://gist.github.com/ngw/9814e04ac4cc1de08b0b10bf2742eca9
[17:10:34] ngw: I got that far, but I'm stuck on the neighbours...
[17:11:30] ngw: it's already > 1 hour I'm messing around but I guess I'm stuck :(
[17:11:38] ngw: can someone give me a hand?
[17:12:13] ngw: the problem is in calculate_neighbours(x:, y:)
[17:13:08] ngw: best result I got till now is that it miscalculates the borders
[17:18:18] ngw: just pasted the "almost correct" version
[17:21:55] Swyper: has joined #ruby
[17:22:29] ngw: omg, I got it... when index is 0 and I do -1 it goes to the last line on the other side
[17:26:51] Exuma: has joined #ruby
[17:28:37] Nicmavr: has joined #ruby
[17:30:08] cow[moo]: has joined #ruby
[17:38:29] wald0: has joined #ruby
[17:52:50] lucasb: has joined #ruby
[17:53:25] Inline_: has joined #ruby
[17:54:03] hightower2: Hey what's the simplest way to do glob matching on strings?
[17:54:04] Azure: has joined #ruby
[17:54:15] tdy3: has joined #ruby
[17:54:20] rippa: has joined #ruby
[17:55:55] Inline_: has joined #ruby
[17:58:11] fphilipe: has joined #ruby
[18:01:08] Inline: has joined #ruby
[18:02:52] hiroaki: has joined #ruby
[18:08:29] queip: has joined #ruby
[18:12:16] unreal: has joined #ruby
[18:14:15] Swyper: has joined #ruby
[18:15:35] emptyfl4sk: has joined #ruby
[18:20:46] Swyper: has joined #ruby
[18:25:25] akemot: has joined #ruby
[18:26:50] Azure: has joined #ruby
[18:30:45] Swyper: has joined #ruby
[18:31:12] livcd: has joined #ruby
[18:31:57] kujira: has joined #ruby
[18:35:06] ellcs: has joined #ruby
[18:35:59] ellcs: has joined #ruby
[18:36:32] fphilipe: has joined #ruby
[18:36:59] ellcs: has joined #ruby
[18:37:12] Swyper: has joined #ruby
[18:37:35] ellcs: has joined #ruby
[18:38:17] ellcs: has joined #ruby
[18:39:51] Swyper: has joined #ruby
[18:54:46] LordPython: has joined #ruby
[18:55:04] Swyper: has joined #ruby
[18:57:17] kyrylo: has joined #ruby
[18:58:51] Megamos: has joined #ruby
[19:06:15] orbyt_: has joined #ruby
[19:08:02] fphilipe: has joined #ruby
[19:14:02] queip: has joined #ruby
[19:15:36] emptyfl4sk: has joined #ruby
[19:17:35] fphilipe_: has joined #ruby
[19:26:18] absolutejam1: has joined #ruby
[19:27:44] orbyt_: has joined #ruby
[19:30:34] snuz: has joined #ruby
[19:33:36] havenwood: hightower2: File.fnmatch?
[19:33:49] havenwood: &ri File.fnmatch?
[19:33:49] rubydoc: https://ruby-doc.org/core-2.6/File.html#method-c-fnmatch-3F
[19:33:53] hightower2: yeah, could abuse that, thanks
[19:34:53] monika: has joined #ruby
[19:46:10] monika: has left #ruby: ("sd")
[19:51:56] sarink: has joined #ruby
[19:57:01] havenwood: &>> 1.step.lazy.map { |n| (2 ** n % 125).chr }.drop(25).first(2).join
[19:57:03] rubydoc: # => "rg" (https://carc.in/#/r/76y8)
[20:00:39] fphilipe_: has joined #ruby
[20:01:11] SeepingN: has joined #ruby
[20:08:30] fphilipe_: has joined #ruby
[20:13:57] emptyfl4sk: has joined #ruby
[20:13:59] fphilipe: has joined #ruby
[20:20:40] stooj: has joined #ruby
[20:26:06] jinie: has joined #ruby
[20:42:31] rippa: has joined #ruby
[21:23:53] ur5us: has joined #ruby
[21:24:56] Exuma: has joined #ruby
[21:28:08] orbyt_: has joined #ruby
[21:31:47] orbyt_: has joined #ruby
[21:33:55] sagax: has joined #ruby
[21:36:11] sarink: has joined #ruby
[21:36:51] seaef: has joined #ruby
[21:41:56] exmortus: has joined #ruby
[21:52:38] fphilipe: has joined #ruby
[21:57:59] Omnilord: has joined #ruby
[22:14:54] emptyfl4sk: has joined #ruby
[22:15:20] fphilipe_: has joined #ruby
[22:22:00] Azure: has joined #ruby
[22:35:45] Omnilord: has joined #ruby
[22:38:21] nowhere_man: has joined #ruby
[22:45:33] cd: has joined #ruby
[22:52:36] cd: has joined #ruby
[22:52:59] emptyfl4sk: has joined #ruby
[23:43:23] emptyfl4sk: has joined #ruby
[23:49:35] involans: has joined #ruby