#ruby - 16 October 2017
« Back 1 day Forward 1 day »
[07:51:20] baweaver: Also this - https://medium.com/@baweaver/abusing-hash-constructors-65d59c0a5b27
[13:38:48] matthewd: skotchpine: The claimed intention is that it will be "3x" faster [than 2.0], by mechanisms to be determined, under a specific benchmark
[13:43:36] skotchpine: matthewd: wow. I've heard of this specific benchmark. Does it ship with the source?
[14:40:38] Guest41826: the plugin is very speed-oriented, which is the reason I'm creating a parser from scratch
[14:43:03] Guest41826: would be very glad if there are people on this channel to give me feedback on it
[14:51:43] Guest41826: anyway, I've collected what I've found as of now in https://github.com/icefapper/ruby-ast
[17:38:10] baweaver_away: https://medium.com/@baweaver/reducing-enumerable-no-op-and-boolean-b2ce4ef8bd79
[17:40:13] elomatreb: baweaver: I really did enjoy the one about === and the one about Hash constructors, good work
[17:43:13] bitemyapp: baweaver: yeah I recognized your name. Book's been done'ish but needing final editing/proofing for awhile now.
[17:43:33] bitemyapp: been working on https://lorepub.com and trying to ramp up ecommerce side stuff so that we can sell a print version
[17:43:49] bitemyapp: once that's settled I'll go back to focusing on editing/finishing the book, but it's been pretty much content complete for awhile.
[17:45:02] baweaver: For those of you who don't know, bitemyapp is a huge Haskell buff and wrote a pretty amazing book: http://haskellbook.com/
[17:45:44] bitemyapp: I was on it for a few months before she came on board, she didn't know how to program before she started working with me. Learned Haskell as her first language while writing the book with me.
[17:54:33] baweaver: elomatreb: Think of all the articles as a brain-dump a few years in the making. Still have a nice backlog I'd been meaning to finish off
[17:55:17] elomatreb: I'm impressed enough with the ability to focus the thoughts into a coherent article already :)
[18:30:53] DearVolt: Hello everyone. I'm trying to override a method of a single object. This object is stored in an array with other objects of the same class but when calling a method on each of the objects I want this one to behave differently. I have tried myObj.define_method, myObj.define_singleton_method and just a def myObj.overridenMethod but the behavior doesn't change.
[18:35:49] baweaver: DearVolt: what exactly are you trying to do? Why are you using singleton methods for it?
[18:47:52] DearVolt: baweaver: I'm just trying to alter the behavior of a method. I have a hierarchy containing Employee -> TeamMember -> JuniorProgrammer. Employee has a payEmployee() method. I create a JuniorProgrammer instance called intern and wish to change the behaviour of the payEmployee() method.
[18:48:58] DearVolt: baweaver: This is my code: https://gist.github.com/DewaldDeJager/6af5cc1bd5946f9a1577a90365afca22
[18:49:27] DearVolt: The original method is defined on line 16 and my attempts at overriding it start at line 144.
[18:50:01] DearVolt: This is part of an assignment and I have to do it this way. I have left the code that I have tried in there so you can see I have tried. Just not sure why it's not overriding the method.
[18:52:43] DearVolt: Yeah, I mix the notation a little. I'll make it more consistent once I get this sorted out.
[18:54:27] DearVolt: baweaver: Just following the spec of the assignment. I also find it silly. I tried that way on line 144 but it doesn't work.
[18:57:12] DearVolt: baweaver: Yes, I have. It works fine when I call the method right below where I override it (In the "main" area) but when I call the team.payTeam method it still uses the intern objects old implementation.
[18:57:46] nofxx: bitemyapp, and gems you can install to system or add --user-install to your .gemrc, which will install under ~/.gem (you'll need to add bin to $PATH)
[18:59:37] DearVolt: baweaver: So basically line 166 works as expected - The method is overriden. But line 144 which uses the method doesn't use the new behaviour.
[18:59:38] bitemyapp: I asked on behalf of someone else and an explicit ruby version manager was definitely needed for their work
[19:17:32] DearVolt: baweaver: Do you see what I mean with the payEmployee method not working as expected in the payTeam method?
[19:23:00] DearVolt: baweaver: I figured it out. I'm being an idiot :| On line 162 I add junior to the team and not intern.
[20:05:29] baweaver: @dminuoso - That means you could _technically_ use case like a cond statement because === hackery :D
[21:33:32] eprojekt: It's something to do with the value of limit but I'm not sure how to handle it.