Activity Graph

Page 1 of 1


[19:25:20] cttttt: *.net *.split


[00:07:05] cttttt: *.net *.split
[00:15:42] cttttt: has joined #ruby


[06:01:21] cttttt: Ping timeout: 240 seconds
[06:14:45] cttttt: has joined #ruby


[16:09:44] cttttt: *.net *.split
[16:14:17] cttttt: has joined #ruby


[03:50:30] cttttt: Ping timeout: 276 seconds
[06:56:09] cttttt: has joined #ruby


[03:44:47] cttttt: *.net *.split
[07:47:36] cttttt: has joined #ruby


[02:47:14] cttttt: *.net *.split
[02:48:01] cttttt: has joined #ruby


[15:33:51] cttttt: Remote host closed the connection
[15:37:48] cttttt: has joined #ruby


[11:26:10] cttttt: has joined #ruby


[12:25:59] cttttt: *.net *.split
[12:27:27] cttttt: has joined #ruby
[15:01:29] cttttt: *.net *.split
[15:03:11] cttttt: has joined #ruby


[04:50:34] cttttt: has joined #ruby


[23:15:58] cttttt: Read error: Connection reset by peer
[23:16:33] cttttt: has joined #ruby
[23:16:48] cttttt: Max SendQ exceeded
[23:20:47] cttttt: has joined #ruby


[22:32:09] cttttt: has joined #ruby


[19:26:23] cttttt: Ping timeout: 255 seconds
[19:30:52] cttttt: has joined #ruby


[22:05:46] cttttt: *.net *.split
[22:06:08] cttttt: has joined #ruby


[00:16:44] cttttt: Ping timeout: 252 seconds
[00:19:53] cttttt: has joined #ruby


[19:13:35] cttttt: Ping timeout: 255 seconds
[19:44:34] cttttt: has joined #ruby


[06:26:10] cttttt: *.net *.split
[06:31:48] cttttt: has joined #ruby
[06:48:30] cttttt: *.net *.split
[07:24:42] cttttt: has joined #ruby


[23:56:51] cttttt: Ping timeout: 258 seconds
[23:59:31] cttttt: has joined #ruby


[14:48:12] cttttt: *.net *.split
[14:54:18] cttttt: has joined #ruby


[11:53:27] cttttt: Ping timeout: 240 seconds
[11:54:31] cttttt: has joined #ruby


[02:12:37] cttttt: Read error: Connection reset by peer


[03:59:37] cttttt: Ping timeout: 255 seconds
[04:19:58] cttttt: has joined #ruby
[22:14:29] cttttt: Remote host closed the connection
[22:20:02] cttttt: has joined #ruby


[14:04:11] cttttt: Just wondering. Is it possible to perform an early return from a block in Ruby? I'm noticing that if I use `return` from a block is jumps out of the containing method instead of the block. I guess if returns aren't possible, the alternative would be to just fully describe the logic in blocks and make sure the result is evaluated last on all codepaths...right?
[14:08:37] cttttt: ljarvis: True. Are early `return` 's just seldom used in Ruby because of the last-statement-is-the-return-value behavior?
[14:10:35] cttttt: ljarvis: Cool. I think Javascript scrambled my brain. It's actually easier to reason with when branches fully describe control flow. But in Javascript, early return is life.
[14:16:26] cttttt: elomatreb: Yeah...this is a thing in JS as well. But it's more because in earlier iterations of the language, folks couldn't decide how to handle background tasks, so some slow operations take a callback which is called with an optional error argument. So, first thing u do is inspect the error, and return immediately if something's wrong...then process the result of the slow operation.
[14:16:45] cttttt: elomatreb: Since this happens *a lot* folks just do an early return, and avoid the indenting.
[14:17:09] cttttt: elomatreb: And, not garbled enough to be unreadable :) thx for the insights.
[14:18:07] cttttt: So, `next` in blocks (but avoid early return) and `return` in actual functions. I guess blocks !== functions in Ruby, eh?
[14:19:42] cttttt: https://www.irccloud.com/pastebin/rpJ8DaHd/
[14:20:20] cttttt: ljarvis: Re: Early return, was just thinking about literally returning early from a call to a block.
[14:20:51] cttttt: ljarvis: Completely academic example...was literally expecting the events to be turned to `nil` here.
[14:20:59] cttttt: events --> evens
[14:21:35] cttttt: ljarvis: Just popped into a blank file to figure out why return was weird. Makes sense though...these aren't really first class functions being passed around.
[14:22:23] cttttt: ljarvis: Yup. Makes senses. I'll try to reprogram myself to embrace the branch in Ruby :)
[14:23:24] cttttt: elomatreb: Just reading ur responses. So, yield is like calling a subroutine in some languages. Yikes. So, blocks are in no way functions at all. Interesting.
[14:23:56] cttttt: ljarvis: Interesting. So, not even lamdas?
[14:24:13] cttttt: ljarvis: touche
[14:24:34] cttttt: Okay. I guess under the strict definition, yeah...ur right...
[14:26:01] cttttt: elomatreb: Makes sense. Because they can mutate data outside of converting args to a result.
[14:29:29] cttttt: ropeney: It's a thing in pure functional programming circles. Technically, they're right that the term is misused in a lot of cases.
[14:30:08] cttttt: ropeney: From a computer science/math standpoint, ...a function produces the same result from the same inputs. So, mutating those inputs or anything else could break that contract.
[14:33:12] cttttt: ropeney: Whatever calls out to the db wouldn't be a function.
[14:33:38] cttttt: ropeney: If you talk to a hardcore functional programmer, you'll notice anger if you say that a routine the mutates data is a function.


[15:48:52] cttttt: Just sort of filling in some gaps in Ruby from a long time ago. I'm trying to use `system()` to run an external command, but want to (1) pass in an array of arguments...bypassing the shell and (2) hide all of the output. Based on the documentation, there are options for redirection, but how do I redirect to the bit-bucket in a platform neutral way?
[15:58:02] cttttt: Oh.... system(command, args ..., :out => :close) . I'm a dumb.
[16:04:39] cttttt: havenwood: Yeah...I, for some reason, thought that this literally closed the file descriptor. If it did, the process would be hitting some issues trying to write to it. Ruby must be doing some sort of magic.


[00:17:32] cttttt: *.net *.split
[00:23:05] cttttt: has joined #ruby


[14:02:23] cttttt: has joined #ruby