Conversation with #inferno at Tue May 3 18:56:28 2011 on powerman-asdf@irc.freenode.net (irc) (19:11:25) bvalek2 left the room (quit: Quit: Page closed). (19:20:10) powerman-asdf: any ideas how to better emulate ternary operator "?:"? i'm now using this: (19:20:10) powerman-asdf: log(INFO, sprint("cleanup: db %s modified", (array[]of{"was not","was"})[is_modified])); (19:25:04) anth_x: neat trick. (19:25:37) anth_x: honestly, i don't miss the ternary operator. even in C i just construct the string separately, ahead of time. (19:29:19) vsrinivas left the room (quit: Ping timeout: 260 seconds). (19:30:07) powerman-asdf: anth_x: and how you handle cases like above? turn one-line debug/log thing into 4-5 line if/else? (19:30:34) anth_x: yes. i find it much easier to read. (19:31:04) anth_x: every time i see the ? in C my brain dumps stack. it's so unlike everything around it. (19:33:53) mjl-: if the three parts are not complex, they look nice and compact to me (19:34:01) mjl-: i've missed the ?: in limbo... (19:34:20) mjl-: you could make a function with three params... only makes sense if you use it a few times (19:44:52) uriel: 16:16 < powerman-asdf> log(INFO, sprint("cleanup: db %s modified", (array[]of{"was not","was"})[is_modified])); (19:44:58) uriel: I'm sorry, but YUCK (19:45:40) powerman-asdf: uriel: ☺ (19:45:44) powerman-asdf: yep, I agree (19:46:05) uriel: just write "is modified: %d" % is_modified (19:46:06) uriel: done (19:46:48) uriel: if you want to get fancy gramaticaly and whatever, then either use a proper if or use a function if it happens often enough (19:47:22) powerman-asdf: in small script I 100% agree. in production system there are too many things in logs and having many numbers make logs harder to read (19:47:32) uriel: I like :?, but from Go I realized it is best to do away with, when one uses it ends up being in cases when one is trying to be way too smart (19:48:05) uriel: if it is only one place, the extra two lines are worth it, specially because of the improved readiability (19:48:20) uriel: if it is in multiple places, then make it a function (19:51:58) powerman-asdf: to be honest, i somehow overlook idea with function. probably, it's because of too many years spend optimizing perl - "function calls is costly" idea eat my brain ☺ (19:52:26) powerman-asdf: (creating arrays on the fly probably much more costly in this context anyway) (19:57:52) uriel: it is certainly harder to read (20:00:51) vsrinivas [U2FsdGVkX1@batman.acm.jhu.edu] entered the room. (20:36:28) anth_r left the room (quit: Remote host closed the connection). (20:37:29) anth_r [none@adsl-99-40-132-129.dsl.bcvloh.sbcglobal.net] entered the room. (20:49:43) Fish [~Fish@9fans.fr] entered the room. (23:45:20) eno left the room (quit: Ping timeout: 258 seconds). (23:46:56) eno [~eno@adsl-70-137-133-14.dsl.snfc21.sbcglobal.net] entered the room. (23:46:56) eno left the room (quit: Changing host). (23:46:56) eno [~eno@nslu2-linux/eno] entered the room. (00:52:27) Fish left the room (quit: Quit: So Long, and Thanks for All the Fish). (06:12:07) anth_x left the room (quit: Ping timeout: 258 seconds). (06:37:17) anth_x [~a@adsl-99-40-132-132.dsl.bcvloh.sbcglobal.net] entered the room. (06:38:34) anth_x left the room (quit: Read error: Connection reset by peer). (07:07:01) anth_x [~a@adsl-99-40-132-132.dsl.bcvloh.sbcglobal.net] entered the room. (07:12:15) anth_r left the room (quit: Remote host closed the connection). (07:13:23) anth_r [none@adsl-99-40-132-129.dsl.bcvloh.sbcglobal.net] entered the room. (08:33:55) bvalek2 [50bb9f33@gateway/web/freenode/ip.80.187.159.51] entered the room. (11:57:03) acmeuser [~acmeuser@99-152-144-52.lightspeed.dllstx.sbcglobal.net] entered the room. (11:57:03) acmeuser left the room. (12:13:11) powerman-asdf: j123m, robot12: http://habrahabr.ru/blogs/os_inferno/118665/ (12:14:02) powerman-asdf: that's first part of article/tutorial about implementing C modules (12:15:06) powerman-asdf: probably I'll try to translate it to English later (12:20:16) j123m: powerman-asdf: cool, like it (12:48:18) robot12: powerman-asdf: cool ! :) (14:34:11) bvalek2_ [50bb9f33@gateway/web/freenode/ip.80.187.159.51] entered the room. (14:36:10) bvalek2 left the room (quit: Ping timeout: 252 seconds). (14:48:39) bvalek2_ is now known as bvalek2 (14:57:02) robot121 [~kazzhilki@proxy10.ts.fujitsu.com] entered the room. (14:58:51) robot12 left the room (quit: Ping timeout: 252 seconds). (18:18:04) anth_x left the room (quit: Quit: anth_x). (18:24:51) powerman-asdf: j123m, robot121: http://habrahabr.ru/blogs/os_inferno/118696/ (part 2) (18:25:27) powerman-asdf: paragraph about gc probably should be rewritten to be more clear, but I've no more time now - have to continue my work :) (18:37:19) robot121 left the room. (18:49:38) anth_x [~a@99.40.132.132] entered the room. (19:45:39) jeremy_c left the room. (20:08:19) bvalek2 left the room (quit: Ping timeout: 252 seconds). (20:34:40) Fish [~Fish@88.162.170.133] entered the room. (21:56:34) vsrinivas left the room (quit: Read error: Operation timed out). (00:17:11) Fish left the room (quit: Quit: So Long, and Thanks for All the Fish). (04:43:20) KBme left the room (quit: Quit: KBme kthxbye). (04:45:21) KBme [~KBme@2001:470:cabe:666:666:666:666:666] entered the room. (09:07:59) robot12 [~kazzhilki@proxy10.ts.fujitsu.com] entered the room. (09:16:18) sl left the room (quit: Ping timeout: 258 seconds). (09:48:23) bvalek2 [50bbd277@gateway/web/freenode/ip.80.187.210.119] entered the room. (10:37:40) Fish-- left the room (quit: Quit: So Long, and Thanks for All the Fish). (10:37:47) Fish [~Fish@exo3753.pck.nerim.net] entered the room. (14:44:01) sl [none@sp.inri.net] entered the room. (15:08:14) bvalek2 left the room (quit: Quit: Page closed). (17:45:15) bvalek2 [50bb935b@gateway/web/freenode/ip.80.187.147.91] entered the room. (18:02:24) powerman-asdf: send to chan … recv from chan (18:02:36) powerman-asdf: send to buffered chan … recv from buffered chan (18:02:57) powerman-asdf: add high data rate for better taste… (18:03:28) powerman-asdf: … and recv will receive something different from what you've just send (18:03:38) powerman-asdf: wow. really. (18:04:29) powerman-asdf: debugging bug in channels was my dream (18:38:02) robot12 left the room (quit: Quit: Leaving.). (18:47:40) bvalek2 left the room (quit: Quit: Page closed). (19:01:07) powerman-asdf: huh. false alarm. (19:07:12) anth_x: good. that would've been pretty surprising, and pretty fundamental. (19:14:42) powerman-asdf: array slices catched me (19:43:55) vsrinivas [U2FsdGVkX1@batman.acm.jhu.edu] entered the room. (19:51:18) vsrinivas left the room (quit: Quit: leaving). (20:13:29) The account has disconnected and you are no longer in this chat. You will be automatically rejoined in the chat when the account reconnects.