<< 08-12-2015 >>

00:01:13*Jesin quit (Quit: Leaving)
00:02:03ephjait has been fixed
00:02:44Araqhrm?
00:02:54Araqwhat's wrong with the code?
00:03:44*joelmo quit (Quit: Connection closed for inactivity)
00:05:23*Demos joined #nim
00:06:52ephjaAraq: "invalid type: expr" on the "let val = val" line in failIf
00:10:41*Trustable quit (Ping timeout: 246 seconds)
00:10:59*jaco60 quit (Ping timeout: 264 seconds)
00:13:33*nicktick joined #nim
00:15:05*girvo joined #nim
00:19:26*girvo quit (Ping timeout: 240 seconds)
00:19:43*aziz quit (Remote host closed the connection)
00:26:38*girvo joined #nim
00:32:09*ephja quit (Ping timeout: 250 seconds)
00:36:34*Matthias247 quit (Read error: Connection reset by peer)
00:45:58*desophos joined #nim
00:57:47*Jesin joined #nim
01:00:18*ephja joined #nim
01:03:13*nicktick quit (Read error: Connection reset by peer)
01:04:21*nicktick joined #nim
01:12:06cryzedWhat exactly is the difference between a template and a macro?
01:12:30cryzedmacros are more powerful?
01:23:03*gmpreussner|work quit (Read error: Connection reset by peer)
01:23:21*desophos_ joined #nim
01:23:37*gmpreussner|work joined #nim
01:23:54Demospretty much
01:24:24Demosmacros work on the AST (using the api in the macros module) and templates do somewhat more primitive substitution
01:24:29Demosmacros are way harder to write
01:25:36cryzedAh ok
01:27:46*desophos_ quit (Ping timeout: 240 seconds)
01:30:39nchambers*typically* a template is a way to use one function in multiple scenarios
01:30:51nchambersa macros is small code that expands into big code
01:32:04cryzednchambers, to use one function in multiple scenarios?
01:32:22nchambersyes
01:32:45nchamberslike if you wanted one function that could add strings and ints
01:36:19*nastavnic joined #nim
01:41:00*nastavnic quit (Ping timeout: 256 seconds)
01:41:37nicktickIs there anybody installed nim.vim under windows? I met a problem on autoload nim.vim at line 12: , E370: Could not load library msys-python2.7.dll , where is msys-python2.7.dll , I installed python2.7,but there is no msys-python2.7.dll, should I install python2.7 from source under msys?
01:43:54nicktickcryzed, thank you for telling me module strutils of converting string into number last time.
01:44:05cryzednicktick, oh no problem
01:44:30cryzednicktick, maybe just google for the DLL and see where you can get it
01:52:24*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
01:55:48*nicktick quit (Ping timeout: 272 seconds)
01:56:51*nicktick joined #nim
02:00:06DemosI'm pretty sure you can just ignore that
02:00:15Demosand still get at least highlighting and syntax checking
02:00:27*brson joined #nim
02:04:20*solidsnack joined #nim
02:06:59nicktickDemos, yes.
02:07:39nicktickthere is no problem with nim.vim under linux.
02:10:03nicktickI want to install nim on both windows and *nix boxes.
02:15:35*nicktick1 joined #nim
02:16:46*nicktick quit (Ping timeout: 240 seconds)
02:22:46*nicktick1 quit (Ping timeout: 240 seconds)
02:23:30*solidsnack quit (Ping timeout: 256 seconds)
02:31:31*pilne left #nim ("Gone.")
02:39:03*ozra quit (Ping timeout: 252 seconds)
02:52:55*brson quit (Quit: leaving)
02:54:43*nicktick joined #nim
02:54:47*Jesin quit (Quit: Leaving)
02:58:08*brson joined #nim
02:58:49*nicktick quit (Read error: Connection reset by peer)
03:03:15*nicktick joined #nim
03:07:42*nicktick quit (Ping timeout: 256 seconds)
03:22:27*ephja quit (Ping timeout: 250 seconds)
03:38:28*nastavnic joined #nim
03:42:46*nastavnic quit (Ping timeout: 240 seconds)
03:43:34*brson quit (Quit: leaving)
03:56:58*desophos quit (Read error: Connection reset by peer)
04:29:57*vendethiel joined #nim
04:39:32*nastavnic joined #nim
04:40:48*zepolen joined #nim
04:44:16*nastavnic quit (Ping timeout: 272 seconds)
04:52:32*vendethiel quit (Ping timeout: 256 seconds)
05:10:03*darkf joined #nim
05:15:16*solidsnack joined #nim
05:28:37*nicktick joined #nim
05:29:48*yglukhov joined #nim
05:34:11*yglukhov quit (Ping timeout: 250 seconds)
05:40:01*Demos quit (Quit: Leaving)
05:41:59*solidsnack quit (Ping timeout: 250 seconds)
05:52:06*nicktick quit (Ping timeout: 240 seconds)
05:58:34*nicktick joined #nim
06:03:10*solidsnack joined #nim
06:03:19*nicktick1 joined #nim
06:03:59*vegansk quit (Remote host closed the connection)
06:04:04*nicktick quit (Ping timeout: 272 seconds)
06:08:46*nicktick1 quit (Ping timeout: 240 seconds)
06:16:13*solidsnack quit (Ping timeout: 250 seconds)
06:16:21*nicktick joined #nim
06:27:06*nicktick quit (Ping timeout: 240 seconds)
06:29:52*solidsnack joined #nim
06:32:51*nicktick joined #nim
06:35:51*nicktick1 joined #nim
06:38:41*vegai left #nim (#nim)
06:38:45*nicktick quit (Ping timeout: 250 seconds)
06:40:06*nicktick1 quit (Ping timeout: 240 seconds)
06:41:16*nastavnic joined #nim
06:43:00*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
06:44:14*nicktick joined #nim
06:45:52*nastavnic quit (Ping timeout: 256 seconds)
06:46:17*nicktick1 joined #nim
06:49:02*nicktick quit (Ping timeout: 272 seconds)
06:50:08*solidsnack joined #nim
07:18:10*kerze joined #nim
07:21:09*zepolen quit (Remote host closed the connection)
07:28:09*girvo quit (Ping timeout: 250 seconds)
07:28:48*girvo joined #nim
07:33:21*girvo quit (Ping timeout: 250 seconds)
07:33:40*yglukhov joined #nim
07:38:00*BitPuffin|osx quit (Ping timeout: 256 seconds)
07:41:27*zepolen joined #nim
07:42:37*zepolen quit (Remote host closed the connection)
07:44:28*zepolen joined #nim
07:49:10*nastavnic joined #nim
08:08:30*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
08:11:02*solidsnack joined #nim
08:13:13*vegansk joined #nim
08:24:57*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
08:28:52*solidsnack joined #nim
08:29:32*girvo joined #nim
08:34:01*girvo quit (Ping timeout: 250 seconds)
08:42:50*Ven joined #nim
08:46:14*zepolen quit (Remote host closed the connection)
08:48:55*jaco60 joined #nim
09:17:15yglukhovdom96: is nimble+nims gonna happen? =)
09:19:34*nicktick1 quit (Quit: Leaving.)
09:23:34*makoLine quit (Ping timeout: 272 seconds)
09:24:39*coffeepot joined #nim
09:53:49*Demon_Fox quit (Quit: Leaving)
09:54:08*jackv quit (Ping timeout: 246 seconds)
09:58:40*jackv joined #nim
09:59:33*zepolen joined #nim
10:07:26*joelmo joined #nim
10:10:07*Trustable joined #nim
10:26:12*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:30:39*girvo joined #nim
10:34:29*kerze quit (Ping timeout: 244 seconds)
10:35:22*girvo quit (Ping timeout: 256 seconds)
10:36:59*ekarlso joined #nim
11:10:23*zepolen quit (Remote host closed the connection)
11:10:30*nastavnic quit (Ping timeout: 256 seconds)
11:17:16*nicktick joined #nim
11:18:36*zepolen joined #nim
11:18:37*zepolen quit (Remote host closed the connection)
11:18:51*zepolen joined #nim
11:23:43*nastavnic joined #nim
11:32:12coffeepotwhen should I be wary of unsigned ints wrapping around in Nim?
11:40:35*sepisoad joined #nim
11:40:51Araqall the time
11:41:07Araqthat's why we discourage unsigned numbers
11:47:13coffeepotthe shl doesn't wrap as far as I can tell
11:47:41veganskHi! How can I make the static library without main function. When I'm linking agains library generated with `--app:staticlib` switch, gcc says: main.c:(.text+0x0): multiple definition of `main'
11:49:15Araq--noMain ?
11:49:36Araqcoffeepot: shl truncates bits
11:50:15veganskAraq, thanks! Missed that switch
11:50:57veganskBut what the need of the main function for --app == lib or staticlib?
11:51:51dom96yglukhov: soon :)
11:52:41yglukhovdom96: oh boy, cant wait =)
11:53:23dom96yglukhov: if you want a preview then you can grab the nimscript-support branch
11:54:22yglukhovno, i'd like to start using it in "production" =)
11:58:00*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:59:01*jaco60 quit (Quit: Leaving)
12:07:12coffeepotwould anyone be interested in a selection of procs to extract int, int16, int64 and string from openarrays?
12:07:41coffeepoti mean it's super simple stuff, just convenient if you're reading from a buffer
12:08:44*sepisoad quit (Read error: Connection reset by peer)
12:08:49coffeepot... or maybe I should just use streams, right? :)
12:09:22veganskAraq, if I need to call nim's static library from c app, I need to initialize the lib with `NimMain` call, right?
12:11:19Araqcoffeepot: I'm not interested in super simple stuff :-)
12:11:36Araqvegansk: yeah something like that, it's all documented
12:12:43Araqhttp://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-c
12:12:44coffeepothaha fair enough, but it's a pain to rewrite basic stuff when you want to just be able to say getInt from an array[byte] or whatnot
12:12:55veganskAraq, thanks!
12:13:21Araqour docs are superb, too bad nobody reads them :P
12:19:50*dv- joined #nim
12:29:28*Arrrr joined #nim
12:31:28*girvo joined #nim
12:35:49*girvo quit (Ping timeout: 250 seconds)
12:38:06cryzedAraq, how does it make sense to differentiate between the 2 different type of number to the end user. One probably already has to write procs or some case somewhere to differentiate between the kinds -- or do you expect them to write accessors?
12:38:27cryzedAraq, while I appreciate you taking the time to answer most issues on Github, a bit more than "no, it wouldn't" would maybe have been more clarifying
12:38:52cryzedSince I'm not raising these to annoy you, but because I honestly think they might be a great addition
12:39:57Araqwell I didn't close it, so you can just continue and ask for specifics.
12:40:16Araqin fact, even if I close it, you can ask to reopen it and ask for clarification.
12:40:46Araqfield lookups based on the surrounding type context is so obviously a bad idea to me that I thought it's not worth going into details
12:41:10Araqecho obj.num # what is meant here? float or int 'num' field?
12:41:32cryzedAraq, isn't that what the differentiatior is for?
12:41:45cryzed*differentiator
12:41:57Araqthe differentiator is not known at compile-time.
12:43:08cryzedBut this structure would be achievable with inheritance? I.e. specify the base class ref as an argument to a proc and then use num for either of them?
12:43:30*sepisoad joined #nim
12:43:33cryzedMaybe I should just try it
12:43:43*ozra_ joined #nim
12:44:14Araqso what does 'echo obj.num' mean?
12:44:33Araqshould it use the float or the int field?
12:45:18Araqor should it produce the type int|float and then we have some magic $ for int|float where | here means a *runtime* union, not Nim's already existing compiletime union.
12:45:22cryzedIt would be based on the type within the current proc, wouldnt it?
12:45:50Araqthe type of 'obj' is the case object, how does that help?
12:46:40*ozra_ quit (Client Quit)
12:47:16cryzedOh right, it's then handled and assumed to automatically "just" be a reference to the base object -- not the "customized" instance.
12:47:28cryzedWell it seems like a nice feature to an end-user, maybe not to the compiler designer
12:47:30*ozra_ joined #nim
12:47:47*ozra_ is now known as ozra
12:48:07Araqno, it's so badly thought-out that I wouldn't even call it a "feature" just yet.
12:48:26Araqit's completely ambiguous.
12:48:56Araq"ok, so here in JSON there is fnum and num and I like to use the same name, make it happen
12:48:58Araq"
12:49:17ArrrrI think crystal had some problems with that https://github.com/manastech/crystal/issues/1824
12:49:38cryzedAraq, do you expect everyone suggesting features to know everything about the Nim compiler internals?
12:49:47cryzedTo me it's just a blackbox, and the issue tracker is for suggestions to the language
12:50:46Araqno, it's not about Nim's internals.
12:51:14cryzedMaybe Python has ruined me, regarding types
12:51:15Araqit's about that you/dom96 do not even know what you want.
12:51:48Araqagain, what does 'echo obj.num' do?
12:52:05Araqyou haven't even answered that question, or maybe I didn't understand
12:52:06cryzedecho the correct type of number depending on the differentiator
12:52:14cryzedMaybe it cant be done at compile time then
12:52:20cryzedyou just answered "no this isnt possible"
12:52:24cryzedI actually did give an answer
12:53:11Araqok, so it uses the discriminator's value which is only known at runtime.
12:53:21Araqso what is its type?
12:53:26Araqint|float ?
12:53:44*joelmo quit (Quit: Connection closed for inactivity)
12:53:53cryzedI suppose, yes
12:54:01*sepisoad quit (Read error: Connection reset by peer)
12:54:31Araqthat already has a meaning in Nim and it's different, so then we introduce '/' as new type constructor.
12:54:49Araqint/float then means 'int or float but we don't know at compile-time'
12:55:02Araqwhich means the implementation looks like:
12:55:11Araqint / float = object
12:55:19Araq case k
12:55:35Araq of floatVal: f: float
12:55:45Araq of intVal: i: int
12:56:24Araqso your case object field produces a hidden case object ...
12:57:20cryzedAraq, you are right -- I didn't think the suggestion was connected with so many internals that I barely know about and thus can't reason about. I'll try to figure out more stuff before asking next time
12:57:32Araqand a whole new '/' type construction which needs to be documented and you can count the seconds until some people ask "what is the difference between / and | ?"
12:59:39Araqno, it's fine to ask questions, but you should have a little more faith that I'm first looking at the resulting *language* and only later at how hard it is to implement.
13:00:02*Ven joined #nim
13:00:54cryzedAlright
13:01:03*t4nk288 joined #nim
13:02:13dom96Araq: I officially understand the issue now, the "so what does 'echo obj.num' mean?" has enlightened me.
13:04:18Araqyay :-)
13:05:19Araqthe first part of the RFC is fine. if the field has the same type in every branch, we can support it.
13:05:30*t4nk288 quit (Ping timeout: 252 seconds)
13:06:19Araqthat improves the expressivity of the language without making it more complex, a really nice addition to the language.
13:07:09Araqand I'm quite sure that has been requested before ;-)
13:07:46*yglukhov quit (Ping timeout: 272 seconds)
13:10:26Araqalternatively we can weaken the disjoint condition for 'case' in 'object'
13:10:33Araqso that this is allowed:
13:10:43Araq case kind: NodeKind
13:11:08Araq of foo, bar, baz: children: seq[Node]
13:11:21Araq of foo: additonalFieldForFoo: int
13:11:30Araq of bar: onlyvalidForBar: float
13:11:55Araqthen it's much more obvious that 'children' is actually a *shared* field
13:12:27Araqhrm, yeah, that's even better.
13:13:33dom96yeah
13:13:41dom96I think that's what I really wanted :P
13:14:48cryzedah, but you are not simply moving children outside the case for foo, bar, baz because there might be other cases?
13:14:57NimBotnim-lang/Nim devel 5545d36 Yuriy Glukhov [+0 ±1 -0]: Fixed getAddrInfo on android
13:14:57NimBotnim-lang/Nim devel 6b3b7ee Dominik Picheta [+0 ±1 -0]: Merge pull request #3631 from yglukhov/getaddrinfo-android... 2 more lines
13:15:40cryzedI don't quite get what the disjoint condition is
13:16:28Araqcryzed: it means you cannot list 'foo' in multiple case branches
13:16:42cryzedah, of course -- thank you
13:17:02cryzedthat seems like a great idea then under those circumstances, at least from what I can foresee
13:20:25ArrrrWhat if i want baz to have more fields? If bar and baz end up being the same, maybe i only need bar
13:21:47AraqArrrr: then add an 'of baz' ? sorry, i don't understand your question
13:22:11Araq'baz' is not special in my example
13:23:42ArrrrAh ok, i saw your example with more detail
13:23:47ArrrrAnd you support that case
13:24:21dv-is there anything like python's beautifulsoup for nim?
13:24:45Araqthe htmlparser in the stdlib is somewhat error correcting
13:25:42dv-i'll check it out
13:25:55*ephja joined #nim
13:36:51*nastavnic quit (Quit: WeeChat 1.3)
13:40:57*nastavnic joined #nim
13:41:01*nastavnic quit (Client Quit)
13:41:19*sepisoad joined #nim
13:42:32*nastavnic joined #nim
13:42:57*nastavnic quit (Client Quit)
13:43:10*nastavnic joined #nim
13:43:34*nastavnic quit (Client Quit)
13:43:50*nastavnic joined #nim
13:44:09*nastavnic quit (Client Quit)
13:44:27*nastavnic joined #nim
13:45:40*Sornaensis quit (Max SendQ exceeded)
13:46:10*Sornaensis joined #nim
13:51:10*brson joined #nim
13:54:56*sepisoad quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
14:05:20*yglukhov joined #nim
14:19:10*sepisoad joined #nim
14:23:20*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
14:23:27*coffeepots joined #nim
14:32:14*girvo joined #nim
14:34:33*sepisoad quit (Ping timeout: 250 seconds)
14:36:26*girvo quit (Ping timeout: 240 seconds)
14:40:56*aziz joined #nim
14:44:26*nastavnic quit (Ping timeout: 240 seconds)
14:45:18*brson quit (Ping timeout: 272 seconds)
14:58:00*nastavnic joined #nim
15:05:41*pregressive joined #nim
15:43:44*jaco60 joined #nim
15:45:11*sepisoad joined #nim
15:51:56ephjaasync swallows exceptions?
15:52:49Araqit massages them
15:52:52*sepisoad quit (Read error: Connection reset by peer)
15:53:06*nastavnic quit (Ping timeout: 240 seconds)
15:55:43ephjanevermind
16:11:13*gokr joined #nim
16:15:42*mindriot101 joined #nim
16:16:45*mindriot101 left #nim (#nim)
16:27:15*gokr quit (Quit: Leaving.)
16:31:52*zepolen_ joined #nim
16:32:58*girvo joined #nim
16:35:12*zepolen quit (Ping timeout: 256 seconds)
16:37:11*girvo quit (Ping timeout: 244 seconds)
16:38:54*Ven quit (Quit: Textual IRC Client: www.textualapp.com)
16:42:19*[CBR]Unspoken quit (Remote host closed the connection)
16:43:51*BitPuffin|osx joined #nim
16:46:02*nastavnic joined #nim
16:53:34cryzedhttps://gist.github.com/cryzed/1e461a987ae7f1f46e71
16:53:54cryzedShouldn't this work in Nim? Let allows me to do tuple unpacking, my stack is a sequence of Node, int tuples
16:54:10cryzedbut in line 12 I get a warning/error that there is no field children
16:54:11cryzed(there is)
16:55:03cryzedmanually unpacking works
16:55:15cryzedOh
16:55:18cryzedI forgot the paranthesis
16:55:35cryzeddamn.
16:55:44*sepisoad joined #nim
16:56:01*gokr joined #nim
17:01:49AraqI'm translating some Go code to Nim ...
17:02:05Araqerror handling is 30% of the code ...
17:02:13cryzednice, that worked beautifully
17:02:16cryzedAraq, ouch
17:02:19*nastavnic quit (Ping timeout: 250 seconds)
17:02:27Araqit all disappears with exceptions ...
17:02:35cryzedAraq, overloading `$` is very cool
17:02:39cryzed:)
17:03:47*Ven joined #nim
17:07:08*sepisoad quit (Read error: Connection reset by peer)
17:15:32*nicktick quit (Quit: Leaving.)
17:15:50*pregressive quit (Remote host closed the connection)
17:18:19cryzedAraq, is there a section in the manual describing all pragmas and their effects? I couldnt find it
17:19:18Araqhttp://nim-lang.org/docs/manual.html#pragmas
17:19:28Araqhttp://nim-lang.org/docs/manual.html#implementation-specific-pragmas
17:20:02Araqhttp://nim-lang.org/docs/manual.html#foreign-function-interface
17:20:24cryzedthank you, I must be going blind
17:25:14*pregressive joined #nim
17:30:11*coffeepots quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
17:51:42*Ven quit (Ping timeout: 256 seconds)
17:52:35*yglukhov quit (Ping timeout: 250 seconds)
18:05:34*gokr quit (Quit: Leaving.)
18:15:43*nastavnic joined #nim
18:23:33*sepisoad joined #nim
18:26:16*nastavnic quit (Ping timeout: 256 seconds)
18:33:46*girvo joined #nim
18:39:00*girvo quit (Ping timeout: 272 seconds)
18:42:06*yglukhov joined #nim
18:42:20dom96We should add this to the learn section of Nim's site: http://nim.community
18:45:10*nastavnic joined #nim
18:46:19*yglukhov quit (Ping timeout: 250 seconds)
18:47:39*m joined #nim
18:47:48*m quit (Client Quit)
18:49:05*m_ joined #nim
18:49:33m_Has anyone here played around with https://github.com/dom96/nimkernel
18:49:42m_Looks pretty cool
18:49:55dom96hello m_
18:49:57dom96I have ;)
18:50:00m_Hey
18:50:03m_Nice
18:50:27dom96It's something to get people started, I haven't done much with it unfortunately.
18:50:47m_It looks pretty neat
18:51:05*m_ quit (Client Quit)
18:53:39*silven quit (Ping timeout: 260 seconds)
18:53:46*aziz quit (Remote host closed the connection)
18:54:01*silven joined #nim
18:58:00*Jesin joined #nim
19:01:09*yglukhov joined #nim
19:04:06*nastavnic quit (Ping timeout: 240 seconds)
19:05:27*yglukhov quit (Read error: Connection reset by peer)
19:07:17*yglukhov joined #nim
19:13:50*sepisoad quit (Ping timeout: 272 seconds)
19:19:15*yglukhov quit (Read error: Connection reset by peer)
19:19:21*Matthias247 joined #nim
19:21:02*yglukhov joined #nim
19:22:36*gour joined #nim
19:26:17*vendethiel joined #nim
19:39:00*nastavnic joined #nim
19:45:31*solidsnack joined #nim
20:04:26*desophos joined #nim
20:06:07*yglukhov quit (Remote host closed the connection)
20:17:48*shodan45 joined #nim
20:17:54*mat4 joined #nim
20:17:59mat4hello
20:20:13*makoLine joined #nim
20:20:48*brson joined #nim
20:33:59*darkf quit (Quit: Leaving)
20:34:30*girvo joined #nim
20:38:17*Arrrr quit (Quit: WeeChat 1.2)
20:38:46*girvo quit (Ping timeout: 240 seconds)
20:40:59*theduke joined #nim
20:42:53*brson quit (Ping timeout: 250 seconds)
20:58:56*theduke left #nim ("Leaving")
21:01:57*solidsnack quit (Ping timeout: 250 seconds)
21:15:52*desophos quit (Remote host closed the connection)
21:16:08*Demon_Fox joined #nim
21:18:16*desophos joined #nim
21:19:21*desophos quit (Remote host closed the connection)
21:19:55*desophos joined #nim
21:25:26*gour quit (Quit: WeeChat 1.3)
21:26:15*solidsnack joined #nim
21:29:33*desophos quit (Remote host closed the connection)
21:30:59*solidsnack quit (Ping timeout: 250 seconds)
21:32:44*Matthias247 quit (Quit: Matthias247)
21:34:45*Matthias247 joined #nim
21:42:52*desophos joined #nim
21:43:37*desophos quit (Remote host closed the connection)
21:44:11*desophos joined #nim
21:48:23federico3a way to write LKM in Nim could be more useful
21:59:06*mat4 quit (Quit: Leaving)
22:00:31*ochkoffein joined #nim
22:09:36*solidsnack joined #nim
22:12:55*linfir joined #nim
22:17:07*Trustable quit (Quit: Leaving)
22:17:46*linfir quit (Quit: rcirc on GNU Emacs 24.5.1)
22:21:39*pregressive quit ()
22:25:44*nastavnic quit (Ping timeout: 272 seconds)
22:31:28*Jesin quit (Quit: Leaving)
22:33:53*zepolen_ quit (Remote host closed the connection)
22:34:09*Matthias247 quit (Read error: Connection reset by peer)
22:35:16*girvo joined #nim
22:37:57cryzedSo is it good style to do away with the ( ) when possible?
22:38:04cryzedSome function calls just look strange to me then
22:40:18*girvo quit (Ping timeout: 272 seconds)
22:44:36ephjano it's not
22:45:42*shodan45 quit (Quit: Konversation terminated!)
22:46:27ephjaI can understand always including the parentheses, but I only omit them when the statement in question resembles a field access
22:48:03cryzedephja, so someObject myField -- that's the only thing you do?
22:50:01ephjathat doesn't look right
22:50:47cryzedwhat resembles a field access for you
22:52:36def-cryzed: someObject.myField
22:53:01cryzedwell yes... but ephja said they would omit in this case
22:53:27ephjathe parentheses yes, and that's the syntax I was referring to
22:53:54cryzedah ok, nevermind
22:53:57cryzedof course
22:55:41ephja"resembles a field access" as in a "get" operation (either an actual field or a proc which takes some object and returns a value)
22:56:37cryzedWell yep, I would have never added a () to a field access, so I suppose I simply misunderstood
22:56:44ephjaI would personally not do "foo.bar" if bar doesn't return a value, but I don't think it's common
22:57:14cryzedI have to say it makes sense though, what you are doing that is
22:57:19cryzed adding () makes the code clearer
22:57:31cryzedeven if you dont neccessarily have to
22:57:48cryzedI'm also tempted to add () to echo, since it's just a function too
22:58:11ephjabut at the same time it's obvious that a value is not returned since if a value was returned, then you would have to either use the value or discard it
22:58:51cryzedtrue too
22:59:06cryzedI just need to find a style and stick with it, but the nim code style guide doesnt say anything
22:59:22ephjabut I would use the "command" syntax then (echo foo), though not always
23:00:36cryzedephja, when not?
23:04:58*girvo joined #nim
23:08:04ephjacryzed: I don't think I use it for functions that return values
23:08:49ephjabecause it's easy to forget that "let x = p 1" will work and "let x = p 1, 2" won't, because of the fact that there's more than one parameter
23:09:00ephja*with functions
23:09:54ephjasuch grammar
23:09:57cryzed:D
23:10:00cryzedgrammar.such
23:10:15cryzedfor example I think I'll add () to file.readAll()
23:10:26cryzedbut for an option I might just check if maybeOption.isNone:
23:10:46cryzedso stuff that sounds like an attribute, not add the (), but for stuff that clearly is worded like an action/verb
23:10:48cryzedI'll add the ()
23:10:50cryzedI suppose
23:11:02cryzedthen there's just the question about adding ( ) to echo etc.
23:14:42*vendethiel quit (Ping timeout: 256 seconds)
23:17:48ephjayes it's fine
23:18:35*M-max quit (Read error: Connection reset by peer)
23:18:35*M-Quora quit (Write error: Connection reset by peer)
23:18:39cryzed:)
23:20:26ephjaI have some code which does "future.read" actually. I dunno if I should keep doing that
23:22:14*xet7 quit (Ping timeout: 245 seconds)
23:22:47cryzedephja, I feel .read() would be clearer -- it also clearly displays intent "read this file" -- there are side effects, for example the file pointer changes etc. On the other hand stuff like isNone might as well be an attribute, since it simply checks a state and returns a boolean
23:22:56cryzedat least that's what I'm rationalizing my decision with now
23:23:53ephjaI agree
23:25:25cryzedand I'll also try to put parantheses around all procs, even those only accepting a single argument -- including echo. These are all procs, not keywords -- so that's what I'm doing. It's unfortunate about the neat little syntax features, but that flexibility can stay for custom DSL with the macro system I suppose. Writing your code the "regular" way, will also ease new Nim developers in understanding it
23:25:38cryzedas in procs that do not mimick attributes
23:32:47*jaco60 quit (Remote host closed the connection)
23:37:45*M-Quora joined #nim
23:39:59*pregressive joined #nim
23:40:25cryzeddamn, I really like Nim after all
23:40:27cryzed:)
23:45:17*jaco60 joined #nim
23:46:26*ozra quit (Ping timeout: 240 seconds)
23:47:34*ozra joined #nim
23:47:52*M-max joined #nim
23:53:14*pregressive quit (Remote host closed the connection)
23:55:22*pregressive joined #nim