<< 10-06-2016 >>

00:06:04*gokr quit (Ping timeout: 272 seconds)
00:12:25*akaisora_ quit (Read error: Connection reset by peer)
00:13:19*akaisora joined #nim
00:13:42*yglukhov joined #nim
00:17:39*girvo joined #nim
00:18:16*yglukhov quit (Ping timeout: 244 seconds)
00:19:04*zielmicha quit (Ping timeout: 264 seconds)
00:22:12*zielmicha joined #nim
00:22:58*btbytes joined #nim
00:25:00*Amun_Ra quit (Quit: WeeChat 1.0.1)
00:26:41*kulelu88 joined #nim
00:26:41*kulelu88 quit (Changing host)
00:26:41*kulelu88 joined #nim
00:32:36*Jesin quit (Quit: Leaving)
00:41:35*shodan45 quit (Quit: Konversation terminated!)
00:41:38*btbytes quit (Quit: My Mac has gone to sleep. ZZZzzz…)
00:46:05*yglukhov joined #nim
00:49:29*benwbooth quit (Ping timeout: 250 seconds)
00:52:27*yglukhov quit (Ping timeout: 260 seconds)
00:55:39*benwbooth joined #nim
00:59:03*akaisora quit (Ping timeout: 240 seconds)
00:59:31*akaisora joined #nim
01:09:50*Amun_Ra joined #nim
01:13:43*btbytes joined #nim
01:24:08*yglukhov joined #nim
01:28:48*yglukhov quit (Ping timeout: 276 seconds)
01:36:57*btbytes quit (Quit: My Mac has gone to sleep. ZZZzzz…)
01:48:26*yglukhov joined #nim
01:48:54*btbytes joined #nim
01:50:42*btbytes quit (Client Quit)
01:51:03*GangstaCat quit (Quit: Leaving)
01:52:45*yglukhov quit (Ping timeout: 250 seconds)
02:02:16*chemist69 quit (Ping timeout: 264 seconds)
02:12:32*yglukhov joined #nim
02:15:07*chemist69 joined #nim
02:15:57*brson quit (Quit: leaving)
02:16:48*yglukhov quit (Ping timeout: 246 seconds)
02:33:21*kulelu88 quit (Quit: Leaving)
02:36:44*yglukhov joined #nim
02:41:20*yglukhov quit (Ping timeout: 258 seconds)
03:00:58*yglukhov joined #nim
03:04:40*akaisora quit (Ping timeout: 272 seconds)
03:05:52*yglukhov quit (Ping timeout: 264 seconds)
03:25:06*yglukhov joined #nim
03:29:50*yglukhov quit (Ping timeout: 260 seconds)
04:01:25*yglukhov joined #nim
04:03:19*der-landgraf quit (Quit: WeeChat 1.5)
04:04:23*der-landgraf joined #nim
04:05:36*yglukhov quit (Ping timeout: 244 seconds)
04:25:39*yglukhov joined #nim
04:30:02*yglukhov quit (Ping timeout: 260 seconds)
04:49:54*yglukhov joined #nim
04:54:00*yglukhov quit (Ping timeout: 244 seconds)
05:10:39*irrequietus joined #nim
05:15:54*gokr joined #nim
05:26:12*yglukhov joined #nim
05:28:41*s4 joined #nim
05:30:42*yglukhov quit (Ping timeout: 260 seconds)
05:40:53*desophos quit (Read error: Connection reset by peer)
05:41:17*endragor joined #nim
05:48:48*gokr quit (Ping timeout: 276 seconds)
06:02:12*yglukhov joined #nim
06:06:41*yglukhov quit (Ping timeout: 250 seconds)
06:17:20*endragor_ joined #nim
06:20:36*endragor quit (Ping timeout: 258 seconds)
06:26:41*yglukhov joined #nim
06:27:00*endragor_ quit (Remote host closed the connection)
06:27:39*endragor joined #nim
06:31:42*yglukhov quit (Ping timeout: 276 seconds)
06:35:16*chemist69 quit (Ping timeout: 264 seconds)
06:40:42*chemist69 joined #nim
06:43:09*filcuc joined #nim
06:47:54*yglukhov joined #nim
06:48:45*yglukhov quit (Remote host closed the connection)
06:51:06*heretobang joined #nim
06:52:38*gokr joined #nim
06:57:46*girvo_ joined #nim
06:58:01*yglukhov joined #nim
06:59:01*Trustable joined #nim
07:28:59*bjz joined #nim
07:29:42*arnetheduck joined #nim
07:29:49*arnetheduck quit (Client Quit)
07:33:06*arnetheduck_ joined #nim
07:33:52*arnetheduck_ quit (Remote host closed the connection)
07:35:40*girvo quit (Ping timeout: 252 seconds)
07:35:57*girvo_ quit (Ping timeout: 250 seconds)
07:41:33*fastrom joined #nim
07:42:36*PMunch joined #nim
07:45:46*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:00:06*bjz joined #nim
08:00:20*gokr quit (Read error: Connection reset by peer)
08:00:28*gokr joined #nim
08:02:04*heretobang left #nim ("soundcloud.com/wacastle")
08:29:26*der-landgraf quit (Quit: WeeChat 1.5)
08:29:41*der-landgraf joined #nim
08:32:47*der-landgraf quit (Client Quit)
08:33:09*der-landgraf joined #nim
08:49:01*nsf quit (Quit: WeeChat 1.4)
08:49:16*endragor quit (Remote host closed the connection)
08:58:10*themagician joined #nim
09:01:33*endragor joined #nim
09:09:16*sarlalian quit (Ping timeout: 258 seconds)
09:09:33*sarlalian joined #nim
09:20:47*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:47:19*bjz joined #nim
09:51:08*bjz_ joined #nim
09:52:03*bjz quit (Ping timeout: 240 seconds)
10:16:27*xet7 joined #nim
10:31:57*girvo joined #nim
10:31:58*1JTAAB0CK joined #nim
10:36:37*girvo quit (Ping timeout: 252 seconds)
10:36:39*1JTAAB0CK quit (Ping timeout: 250 seconds)
10:42:00cheatfate_dom96, now when i'm trying to implement postgres async module i think your idea with readCB: seq[Callback], and writeCB: seq[Callback] is not so bad
10:44:17cheatfate_but i'm thinking to have not `seq's` there, but `arrays`
10:44:34cheatfate_just to omit memory alloc/dealloc code there
10:44:39*vktec joined #nim
10:46:38*wuehlmaus is now known as foosball
10:54:14*irrequietus quit ()
11:19:06*chemist69 quit (Ping timeout: 250 seconds)
11:25:20*chemist69 joined #nim
11:30:31*Demon_Fox quit (Quit: Leaving)
11:32:46*girvo joined #nim
11:32:46*girvo_ joined #nim
11:33:50*Sembei joined #nim
11:37:40*girvo_ quit (Ping timeout: 264 seconds)
11:37:40*girvo quit (Ping timeout: 264 seconds)
11:44:16*endragor quit (Remote host closed the connection)
11:48:43vktecWhat is the most idiomatic way to read a file in Nim? Should I use AsyncFile or is there another, easier solution?
11:51:55*resuna joined #nim
11:52:32dom96vktec: system.readFile
11:52:50dom96use AsyncFile only if you need to read the file asynchronously
11:52:53vktecAh, thanks dom96
11:53:00*resuna left #nim (#nim)
11:53:05vktecI searched the docs, but didn't find that
11:54:26vktecI should've looked on rosettacode :D
12:23:10*gokr quit (Read error: Connection reset by peer)
12:23:11*gokr1 joined #nim
12:29:13*elrood joined #nim
12:33:40*girvo joined #nim
12:33:41*girvo_ joined #nim
12:38:10*girvo quit (Ping timeout: 260 seconds)
12:38:45*girvo_ quit (Ping timeout: 260 seconds)
12:46:15*yglukhov quit (Read error: Connection reset by peer)
12:46:57*endragor joined #nim
12:48:22*der-landgraf quit (Quit: WeeChat 1.5)
12:49:00cheatfate_looks like `tests/async/tasynceverror.nim` broken
12:49:37cheatfate_it has `outputsub: "Error: unhandled exception: "` inside
12:50:01cheatfate_so this test just hiding exceptions
12:50:07cheatfate_because on linux it got EPIPE
12:50:17cheatfate_but in BSD EBADF for other reason
12:51:15*arnetheduck joined #nim
12:51:15cheatfate_it called raises EBADF not because you writing to already closed socket, but because it has double delete from kqueue
12:51:46*endragor quit (Ping timeout: 272 seconds)
12:53:01*xet7 quit (Ping timeout: 240 seconds)
12:54:29Araqit's not broken, it's underspecified
12:54:45Araqbecause OSErrors can differ
12:56:33*der-landgraf joined #nim
12:56:33*der-landgraf quit (Changing host)
12:56:34*der-landgraf joined #nim
12:57:10*der-landgraf quit (Client Quit)
12:57:39*der-landgraf joined #nim
12:57:39*der-landgraf quit (Changing host)
12:57:40*der-landgraf joined #nim
13:05:03*yglukhov joined #nim
13:05:57*xet7 joined #nim
13:11:00cheatfate_Araq, its broken, just because OSes has different approach on handling send(to just closed socket), i have already tested FreeBSD, Solaris and Linux
13:11:25cheatfate_only on Linux send() returns ECONNRESET (104)
13:11:44cheatfate_Solaris and FreeBSD made successful write to socket
13:11:53cheatfate_i'm loading macos to test it
13:13:36cheatfate_as expected macosx also made successful send(to just closed) socket
13:14:48cheatfate_this test generates EBADF for other reason
13:15:17cheatfate_as i said before because asyncdispatch -> selectors -> make 2 calls to delete socket form kqueue
13:15:42cheatfate_so it generates EBADF and causes this test to pass successfully
13:17:00*akaisora joined #nim
13:22:22*s4 quit (Quit: Konversation terminated!)
13:23:26*akaisora quit (Ping timeout: 244 seconds)
13:23:43*akaisora_ joined #nim
13:31:13yglukhovcan i pass a pointer to a proc expecting openarray?
13:32:25Araqnot sure if casting from pointer to openarray is supported.
13:32:28Araqbut it should.
13:33:23*PMunch quit (Ping timeout: 258 seconds)
13:34:38*girvo joined #nim
13:34:39*girvo_ joined #nim
13:39:03*girvo_ quit (Ping timeout: 240 seconds)
13:39:03*girvo quit (Ping timeout: 240 seconds)
13:41:30*gokr joined #nim
13:42:20*gokr1 quit (Ping timeout: 260 seconds)
13:43:15vktecWhat is the best way to append a value to a sequence? Should I do sequence += @[newvalue]?
13:44:12nivvktec: what about system.append? theres both mutable and immutable variants for it
13:44:39nivif memory serves .. actually
13:45:24vktecniv: Hmmm... I can't seem to find any docs on that..
13:45:31vktecCould you give me a link?
13:45:45vktecI can't find it on here: http://nim-lang.org/docs/system.html
13:46:09nivit's called add, not append, sorry
13:46:19nivproc add[T](x: var seq[T]; y: openArray[T]) {.noSideEffect.}
13:46:24*PMunch joined #nim
13:46:27vktecniv: Ahh, thanks
13:46:41nivshould be better to use for mutable stack stuff because it doesnt make a copy
13:47:01vktecYeah
13:47:04vktecThanks niv
13:47:08nivyw :)
13:47:46*endragor joined #nim
13:49:36nivquestion of my own to the channel - what's the preferred way to check if we're running posix? when defined(linux) or defined(macosx)?
13:49:41nivthat doesnt seem sane to me
13:50:00nivi want to find out if a importc header .. call resolves/works
13:51:29Araqwhen defined(posix)
13:51:51nivty
13:52:08Araqto know if the importc works, you have to call it, unless it's a dynlib call then it will tell you at program startup
13:52:22*endragor quit (Ping timeout: 244 seconds)
13:52:51nivi'll just leave it off then and put it in the docs
13:54:38vktecI thought templates could access variables from the calling scope, but I'm getting an error that seems to suggest otherwise. Any way I can change that or should I do something differently?
13:58:12vktecAlso, I'm a little confused about the difference between templates and macros, could someone clarify?
13:58:57Araquse a .dirty template
13:59:49Araqthere is no real difference, templates originally were Lisp's quoting operator and evolved into the simple substitution macros they are today
14:00:01vktecAraq: Thanks, that worked perfectly
14:00:08vktecAraq: Okay
14:00:14Araqso in other words, use a template unless you cannot
14:00:19vktecSo how come both exist?
14:00:27vktecAnd why would I use a macro over a template?
14:01:17*saml quit (Remote host closed the connection)
14:01:43AraqI believe in the Principle of Least Power.
14:02:26Araqmacros have to exist because lots of things are otherwise not expressable in Nim
14:02:48Araqbut due to their power they are hard to use
14:02:52vktecOkay
14:03:01vktecSo what can they do that templates can't?
14:03:25vktecThe docs say they "enable advanced compile-time code transformations" but what kind of transformations?
14:03:40Araqlook strscans.scanf
14:04:33*saml joined #nim
14:05:45Araqwhenever you need to process some string at compile-time, or need to inspect the involved types
14:06:01Araqor need to build 2 ASTs at the same time
14:06:26Araq(like building an object type and at the same time code that uses the object's fields)
14:06:31Araqyou have to use macros.
14:06:52vktecOkay
14:07:08*vktec will probably never use them :]
14:08:24Araqeven if not, you benefit from the libraries that make good use of them
14:08:28vktecYeah
14:09:06vktecSo basically, templates are blocks of code that are substituted by the compiler, macros build code which is then substituted by the compiler. Or am I wrong?
14:09:42vktec(ie. a template call is replaced by the template, a macro call is replaced by the code generated by the macro)
14:12:40PMunchvktec, https://hookrace.net/blog/introduction-to-metaprogramming-in-nim/
14:12:44vktecHmmm... can I get a variable definition inside a template to be visible in the calling scope?
14:12:46PMunchPretty much right
14:13:06vktecPMunch: Cheers, I'll take a look at that
14:13:23arnetheduckAraq, let me know when you have a moment to explain that GC
14:13:28PMunchTemplates are as you say just substitutions so I think that should work, but it could make your code look messy.
14:13:56PMunchvktec, I read it just the other day and it describes all this stuff really nicely
14:14:22vktecPMunch: Yeah, it looks good.
14:14:35vktecPMunch: It doesn't seem to have worked :-/
14:14:48*endragor joined #nim
14:16:01vktecOh, maybe it has
14:16:26Araqarnetheduck: what do you need to know?
14:16:44arnetheducker. everything from the start? ;)
14:16:46vktecWait, no, it hasn't
14:17:12arnetheduckit looks like the c compiler makes a big deal out of things being on heap or stack
14:17:24arnetheduckideally, I'd like to not care about that right now
14:17:59arnetheduckyou mentioned traversal procs at some point, then I found a comment in the code saying that they're basically performance optimizations
14:18:31Araqyeah
14:19:32arnetheduckso I guess what I'm after is the absolute minimum needed by the compiler to make gc work - don't care at all about it being fast
14:19:35arnetheduckbut there
14:19:39vktecAha! It wasn't working because I was defining inside an if statement.
14:20:17vktecI replaced it with when and everything works as expected :)
14:21:22arnetheduckI tried just doing nothing beyond not defining nogc, but that causes crashes :/
14:21:54vktec0.o What does "could not resolve" mean in an error?
14:22:20Araqit means there is [] accessor available for your datatypes
14:22:24Araq*is no
14:22:36vktecThere.... is.
14:22:41vktecBut then....
14:22:43vktec0_o
14:22:46*vktec debugs
14:22:59Araquse a 'var T' in the proc if you need to modify stuff
14:23:06Araqas parameter.
14:23:26vktecAraq: It's a template
14:23:47Araqit gets expanded
14:23:55Araqlook at where it is expanded.
14:24:09Araqarnetheduck: marker procs are actually required now for the GC to work
14:24:32Araqit depends on the marker proc though, 'nimRegisterGlobal' iirc is really important
14:24:45vktecAraq: What, in the generated sourcecode?
14:25:09*gokr quit (Ping timeout: 246 seconds)
14:25:22arnetheduckdo I need to care at all about the *RC1 stuff?
14:25:48Araqproc foo(x: Table[string, string]) = x["foo"] = "bar" # cannot resolve
14:26:07Araqproc foo(x: var Table[string, string]) = x["foo"] = "bar" # yummy
14:26:29Araqarnetheduck: the RC1 stuff is indeed only for optimizations
14:26:34vktecAraq: Okay, but what about when I'm using a {.dirty.} template?
14:26:58Araqtemplate parameters are not subject to mutability checking
14:27:25vktecAraq: It's not a parameter, it's a variable in the calling scope
14:27:35arnetheducknimGCunrefNoCycle too?
14:28:13Araqthe *NoCycle variant is an optimization, but nimGCunref needs to be called
14:28:40Araqvktec: so gist your code
14:28:46vktecOkay
14:30:06arnetheduckis it enough to call nimgcref/nimgcunref when the ast tells me to, through magics, or are there other places?
14:30:12*Sembei quit (Ping timeout: 250 seconds)
14:30:56arnetheduckI can mostly find calls to with related to OnHeap.. but would it be enough to always do the OnUnknown variations?
14:32:14vktechttps://gist.github.com/vktec/a0e2b21accf28ff30cc707e1c9a9dc95
14:32:27vktec^ The relevant code
14:33:36Araqno, you left out the essential parts
14:33:49Araqhowever you need to use declared instead of defined
14:34:04Araqarnetheduck: the OnUnkown variants should be good enough
14:34:06vktecAraq: What other parts should I add in?
14:34:11vktecAraq: Okay, I'll change that
14:34:55Araqand maybe moustachu.Context has no [] accessor
14:35:13vktechttps://github.com/fenekku/moustachu
14:35:23*girvo joined #nim
14:35:26*girvo_ joined #nim
14:36:49arnetheduckso basically.. implement markers, do whatever c compiler does with OnUnknown..
14:38:22arnetheduckbtw, in the generated code, stack bottom is set several times, even though it should be sort of enough to set it once.. and it's set to a pointer to NimMain/PreNimMain, why is that?
14:39:33*girvo quit (Ping timeout: 240 seconds)
14:40:30*girvo_ quit (Ping timeout: 276 seconds)
14:43:21AraqI think it's because of DLL support
14:43:31Araqwe need to generate it differently for DLls
14:43:38Araqand then it ended up being always emitted
14:47:14*endragor quit (Remote host closed the connection)
14:48:09vktecAha! I fixed the issue by generating a JObject and then creating the context from that
14:48:38vktecThat's what it's doing internally anyway, so it shouldn't affect performance much
14:51:18arnetheduckok, cool, thanks.. should be enough to get started..
14:52:18arnetheduckendb, if it's dead, is there a plan to remove it from system?
14:55:06Araqno, it still has the best watchpoints
15:08:14*Jesin joined #nim
15:13:07*pregressive joined #nim
15:13:32*chemist69 quit (Ping timeout: 250 seconds)
15:19:57*chemist69 joined #nim
15:23:54*Parashurama joined #nim
15:24:51*BitPuffin joined #nim
15:25:19ParashuramaHi, I can't seem to use the --listFullPaths cmdline arg for a project. It has no effect on displayed error messages filenames. (using latest devel)
15:25:50vktecI have a string and I want to create a template with that name from within another template. Is this possible? Is there a better way to do what I want? (example: https://gist.github.com/vktec/a162ad8850c70a4aa1b38ef809c55252)
15:26:01ParashuramaAraq: Hey, see message above.
15:26:59ParashuramaI think you can use the `name` notation for the template name nested inside your first template.
15:28:15vktecParashurama: I think that does something else (see first example here http://nim-lang.org/docs/tut2.html#templates)
15:29:32ParashuramaTry it I remember using some time ago exactly for that purpose
15:30:21ParashuramaIt evaluate the expression and use it as an ident (or something like that)
15:30:39vktecOkay, I'll give it a go
15:33:08vktecThat doesn't seem to be working
15:33:14vktec Error: identifier expected, but found '"myTemplate"'
15:35:08ParashuramaOkay, let me find the old code.
15:35:19vktecThanks Parashurama
15:36:08vktecWhat I'm looking for is kinda similar to Python's decorators, but for templates rather than procs
15:36:27*miere joined #nim
15:37:41PMunchI think you'll have to use macros for that vktec
15:37:47PMunchRemember templates are only for compiletime
15:38:02PMunchSo you can't create new ones on runtime
15:38:53*namnguyen quit (Quit: Leaving)
15:39:11vktecPMunch: I'm not, I'm creating templates from other templates at compile time
15:41:29PMunchStatically?
15:42:38vktecWell, I'm using a template to define another template, so it's all done at compile-time
15:42:42vktecIt's for a DSL
15:42:56miereIs link broken or it's just me? http://i.imgur.com/23ydDqk.png
15:43:11PMunchmiere, works for me
15:43:11miereIn channel about message
15:43:20PMunchOh
15:43:24PMunchThe channel message :P
15:43:25vktecmiere: Just you
15:43:28miere:/
15:43:30PMunchI thought you meant the image
15:43:32miereLol
15:43:33miereNo
15:43:59vktecmiere: Here's the actual link https://github.com/Araq/Nim/wiki/IRC-guidelines
15:44:09miereThanks
15:44:23vktecNp
15:44:36*namnguyen joined #nim
15:45:47ParashuramaFound the code: https://gist.github.com/Parashurama/ccb71422b641c2426e6b2eeea60450ae
15:45:49ParashuramaI didn't quite remember correctly. It is part of a much large proc and called inside a macro.
15:47:06ParashuramaIt may not be the code I remembered it was the closest I could find at the moment.
15:47:25vktecOkay, thanks Parashurama
15:47:41vktecI'll take a look at that and see what I can figure out
15:47:57*endragor joined #nim
15:49:28vktecParashurama: Do you have an example usage for that?
15:50:29*BlaXpirit quit (Quit: Bye)
15:50:53*BlaXpirit joined #nim
15:52:32*endragor quit (Ping timeout: 250 seconds)
15:54:16*benwbooth quit (Ping timeout: 250 seconds)
15:56:36*PMunch quit (Quit: leaving)
15:57:43*benwbooth joined #nim
15:59:42ParashuramaThe code it self is quite complicated if you don't know nim macros. I update the gist with some code that compile and show how to use it.
15:59:43ParashuramaBut the code is quite old, and I build the AST manually now when I need macros.
15:59:49*benwboot_ joined #nim
16:00:25*nsf joined #nim
16:01:08Araqvktec: just pass the identifier as identifier around, the parameter's type needs to be 'untyped' for this to work
16:01:08vktecOkay
16:01:25AraqParashurama: no idea, report it, I shall have a look.
16:01:43vktecAraq: Can you provide an example?
16:02:48*benwbooth quit (Ping timeout: 246 seconds)
16:07:28*arnetheduck quit (Ping timeout: 272 seconds)
16:07:46Araqtemplate constructProc(name: untyped) =
16:07:58Araq proc name(a, b: int) = discard
16:08:08vktecCool, I'll try that
16:08:09AraqconstructProc(awesomeName)
16:08:48*Matthias247 joined #nim
16:09:59vktecAraq: Awesome! That worked perfectly!
16:10:03vktecThank you so much!
16:14:32ParashuramaAraq: Maybe i just misunderstood the --listFullPaths flag. In my example, it works on compile time errors but not on runtime errors (exceptions).
16:15:57Araqoh, ok
16:16:10Araqit's only for compiler error messages indeed
16:17:21ParashuramaAraq: It would be very useful for compile time errors. Especially for IDE integration as a goto error line.
16:17:36Parashurama*for runtime errors, obviously
16:20:48*filcuc quit (Read error: Connection reset by peer)
16:22:40*arnetheduck joined #nim
16:23:44vktecSorry guys, yet another template-related question :) What am I doing wrong here: https://gist.github.com/vktec/781838f11115d18ad98829030b0a8adf
16:25:02*arnetheduck quit (Remote host closed the connection)
16:25:21vktecOops, I forgot {.dirty.}
16:27:40vktecOkay, I added {.dirty.} and removed var from the template and it works, but what about this: https://gist.github.com/vktec/781838f11115d18ad98829030b0a8adf
16:29:18ParashuramaYou are defining a new proc, not calling it and anyway you are modifying a new var x not the global one.
16:29:59ParashuramaMy mistake, you are calling it, but as before
16:30:30vktecYeah, that's the point, but it's not working. I want to define a new local variable called x with value 10, but it reads the global one (which I put in to prevent errors).
16:32:08ParashuramaI'm not sure I understand what you are trying to do.
16:32:19miereMaybe this will work: https://gist.github.com/miere43/0aa807dd360126a8b293e0a01e6b76f8
16:33:15vktecmiere: That's not what I'm trying to do. I'm trying to create a _new_ local variable.
16:33:22*vktec removes the global variable
16:35:30vktecPerhaps this is a little clearer: https://gist.github.com/vktec/781838f11115d18ad98829030b0a8adf
16:36:15*girvo joined #nim
16:36:17*girvo_ joined #nim
16:36:50Parashuramawe have a {.global.} pragma but it means C static variable.
16:37:31vktecI don't want a global variable, I want a local variable.
16:39:45ParashuramaI'm pretty sure it can be done with some combination of mixin, gensym and things like that (see manual) but I can't help you tonight any further.
16:39:51Parashuramasee yah.
16:40:50*girvo_ quit (Ping timeout: 260 seconds)
16:40:50*girvo quit (Ping timeout: 260 seconds)
16:40:50*akaisora_ quit (Ping timeout: 260 seconds)
16:41:03vktecOkay, thanks for the help Parashurama
16:41:32*akaisora_ joined #nim
16:44:23*Matthias247 quit (Read error: Connection reset by peer)
16:53:19*Parashurama quit (Quit: ChatZilla 0.9.92 [Firefox 46.0.1/20160511224154])
17:02:33*gokr joined #nim
17:16:25*akaisora_ is now known as akaisora
17:21:36*brson joined #nim
17:24:09*Trustable quit (Remote host closed the connection)
17:46:23*gokr quit (Ping timeout: 258 seconds)
17:55:31*fastrom quit (Quit: Leaving.)
17:57:05*chrisheller joined #nim
17:59:29chrishellervktec: mark your template as {.dirty,immediate.}
18:01:14Araqvktec: no, mark the body as 'untyped'
18:03:13vktecchrisheller: Thanks that worked
18:03:19vktecAraq: That worked too, with {.dirty.}
18:03:58vktecNow the question is.... which is better? ;)
18:04:19chrishellervktec: Prefer Araq's advice over mine. He knows a bit more about Nim :)
18:04:49vktecOkay
18:05:02vktecI'll go with body: untyped and {.dirty.}
18:05:04vktec:)
18:05:08vktecThanks so much guys!
18:06:39vktecAraq: Why does that work? Is stmt in it's own scope or something?
18:07:24Araqstmt is an alias for 'typed'. for 'typed' the argument needs to be typed.
18:07:38Araqto be typed, the compiler needs to check its semantics
18:07:52Araqit tries that and fails because of the unknown identifier in the body
18:08:07Araqfor 'untyped' the compiler is lazy and doesn't type check it.
18:08:14vktecAhh
18:08:17vktecThat makes sense
18:08:27*foosball quit (Quit: Lost terminal)
18:08:35vktecShould I use `typed` instead of `stmt` then?
18:08:40vktecTo be clearer?
18:08:44Araqyes.
18:08:48vktecOkay
18:08:56Araqexpr/stmt will be deprecated soon.
18:09:05Araqand so will .immediate templates.
18:09:08*vktec does :%s/stmt/typed/g
18:10:22vktecIs expr an alias for untyped?
18:13:52Araqyes
18:14:20vktecOkay
18:14:29vktecI'll bear that in mind, thanks again Araq
18:15:51*vqrs_ quit (Ping timeout: 244 seconds)
18:16:12*vqrs joined #nim
18:23:36*foosball joined #nim
18:26:50*shodan45 joined #nim
18:53:38*akaisora_ joined #nim
18:53:52*akaisora quit (Ping timeout: 264 seconds)
19:20:49vktecIs it possible to do something like `export module.proc as newProcName` or do I have to do it manually?
19:21:16vktecie. define a proc that calls the other proc
19:25:53*samdoran joined #nim
19:26:49Araqmanually
19:26:56vktecOkay
19:27:41vktecShame that, it seems like quite an obvious thing to implement, given you have import as
19:28:33Araqit's just a macro away
19:28:45Araqevery unimplemented feature is just a macro away.
19:28:52vktecTrue
19:29:08Araqthey claim Nim is big, but it's actually rather slim. ymmv.
19:29:33namnguyenthere should preferably be one way to do it.
19:29:47namnguyeninstead of there are at least two ways to do it.
19:30:12Araqthat doesn't mean anything to me.
19:30:24AraqPython has dict() and {}
19:31:17*BitPuffin quit (Ping timeout: 260 seconds)
19:31:23vktecYeah, I quite like flexibility
19:31:39vktecIt means you can write code that doesn't just work well, it also looks good
19:32:15namnguyendict() and { } are two different things though.
19:32:45vktecnamnguyen: They can both be used to initialize a dict
19:32:55vktecdict1 = {}
19:32:59vktecdict2 = dict()
19:33:04vktecdict1 == dict2
19:34:02namnguyen{1} is valid, while dict(1) is not.
19:34:48vktecnamnguyen: I never said they weren't different
19:35:01vktecI just said they could both be used to create an empty dict
19:35:35namnguyenyes, there is one preferable way to create an empty dict, though.
19:35:55vktecYes
19:42:18*Demon_Fox joined #nim
20:01:43*gokr joined #nim
20:02:03vktecDoes Nim have associative arrays?
20:02:24namnguyenthey're called "tables".
20:03:12vktecThanks namnguyen
20:03:22namnguyenyw
20:04:56*pregressive quit (Remote host closed the connection)
20:07:01*Matthias247 joined #nim
20:08:08chrishellerAnyone done anything like Python's cmd module in Nim? https://pymotw.com/2/cmd/
20:08:45chrishellerThere are lots of command line parsers, but I didn't see anything yet that does a shell around that
20:20:56Araqthere is the rdstdin stdlib module
20:21:14Araqwhich gives you the readline feature and nothing else ;-)
20:27:02*miere quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/)
20:28:08*chemist69 quit (Ping timeout: 250 seconds)
20:28:57chrishellerThanks. Will take a look and see what can be done with that
20:29:36namnguyenis the IUP binding only applicable to shared lib IUP?
20:35:49Araqnamnguyen: ususally you can use --dynlibOverride:iup and then link statically against iup
20:38:03*girvo joined #nim
20:38:03*girvo_ joined #nim
20:38:51*akaisora__ joined #nim
20:39:18*akaisora_ quit (Ping timeout: 276 seconds)
20:43:04*girvo_ quit (Ping timeout: 264 seconds)
20:43:04*girvo quit (Ping timeout: 264 seconds)
20:47:12*chemist69 joined #nim
21:00:56*pregressive joined #nim
21:07:38*vendethiel joined #nim
21:11:39*samdoran quit (Quit: Page closed)
21:11:56*xet7 quit (Quit: Leaving)
21:19:08*pregressive quit (Remote host closed the connection)
21:34:25*shodan45 quit (Quit: Konversation terminated!)
21:48:36*benwboot_ quit (Ping timeout: 246 seconds)
21:50:09*kulelu88 joined #nim
21:51:37*benwbooth joined #nim
21:52:18*benwbooth quit (Max SendQ exceeded)
21:52:56*benwbooth joined #nim
21:53:48*saml quit (Quit: Leaving)
21:57:47*desophos joined #nim
22:08:28*benwbooth quit (Ping timeout: 272 seconds)
22:10:49*irrequietus joined #nim
22:16:14*benwbooth joined #nim
22:24:01*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:25:26*Trustable joined #nim
22:27:46*elrood quit (Quit: Leaving)
22:29:25*jjido joined #nim
22:38:52*girvo joined #nim
22:38:53*girvo_ joined #nim
22:39:32*gokr quit (Ping timeout: 244 seconds)
22:43:43*girvo_ quit (Ping timeout: 252 seconds)
22:43:43*girvo quit (Ping timeout: 252 seconds)
22:45:09*bjz joined #nim
22:52:28*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:52:37*Trustable quit (Remote host closed the connection)
23:00:18*bjz joined #nim
23:18:09*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:26:29*PMunch joined #nim
23:26:41*Demos joined #nim
23:27:38*jjido quit (Read error: Connection reset by peer)
23:40:52*irrequietus quit ()
23:43:24*Demos quit (Remote host closed the connection)
23:45:23*Matthias247 quit (Read error: Connection reset by peer)
23:47:16*yglukhov quit (Remote host closed the connection)
23:59:06*yglukhov joined #nim