<< 18-01-2016 >>

00:06:51ldleworkHey Araq_ I don't understand how macro's like mine are supposed to work without immediate mode since they have to refer to identifiers that don't exist yet?
00:12:02*Matthias247 quit (Read error: Connection reset by peer)
00:25:05*derka joined #nim
00:28:54Araq_ldlework: use 'untyped' for lazy parameters
00:50:18dom96https://github.com/dom96/notifications
01:02:00*brson joined #nim
01:14:55*jaco60 quit (Ping timeout: 240 seconds)
01:19:15*pregressive joined #nim
01:19:30*yglukhov joined #nim
01:23:59*yglukhov quit (Ping timeout: 260 seconds)
01:35:41*pregressive quit (Remote host closed the connection)
01:36:43*pregressive joined #nim
01:37:45ldleworkIs it known that you can't use var types in `->` proctypes from the future module?
01:37:52ldleworkError: Incorrect type list in proc type declaration.
01:38:52Araq_no.
01:39:07jsudlowHey Araq_ Were trying to get the key thats currently pressed down in nimsdl2
01:39:22jsudlowhttps://gist.github.com/jsudlow/b23731db908cf1738ab1
01:39:41ldleworkjsudlow: this problem isn't apparent in that snippet though
01:40:12ldleworkAraq_: is there a reason why `evConv` specifies the event as var? https://github.com/nim-lang/sdl2/blob/master/src/sdl2.nim#L591
01:40:42*frewtc4ke joined #nim
01:40:52Araq_it predates unsafeAddr
01:40:55Araq_that's why
01:41:11Araq_fix it
01:41:48ldleworkhuh
01:42:00ldleworkAraq_: by just removing 'var' ?
01:44:35Araq_and using unsafeAddr instead of 'addr'
01:45:16ldleworkAraq_: if I have SDL installed from Nimble, how would I test the changes in a fork?
01:45:43Araq_clone it on your own.
01:45:51Araq_I talked with dom96 about it
01:46:28Araq_he thinks nimble does not have to support that. even though it's a common problem and nimble already uses git for downloading...
01:46:51ldleworkI understand I have to clone it on my own
01:47:01ldleworkBut how do I then get Nim to use my clone
01:47:26Araq_build with --noNimblePath
01:47:46ldleworkfrewtc4ke in this channel is a spam bot
01:48:11Araq_he PM'ed me
01:48:22ldleworkyeah probably pm'ed everyone
01:48:44Araq_maybe he's lonely
01:49:54ldleworklol
01:52:07ldleworkAraq_: hmm, I'm not sure I understand the whole process. I cloned sdl2 somewhere. Now how do I get my project to build against this non-nimble managed clone?
01:52:28def-ldlework: as a quick hack you can just run "nimble install" in the cloned directory
01:52:43ldleworkdef-: can I keep running that as I change the code
01:53:25def-Then you have to "nimble install" again after each change you want to test
01:53:30ldleworkok
01:53:57def-you could run nim with --path and add the sdl2 path
01:54:27ldleworkyeah that fixed it
01:54:29ldleworkI'll submit a PR
01:55:47jsudlownice job ldlework
01:55:55dom96aww, frewtc4ke didn't PM me
01:55:58dom96I feel left out
01:56:07ldleworkhttps://github.com/nim-lang/sdl2/pull/58
01:56:21ldleworkfrewtc4ke | is he still an active chatter?
01:56:22ldlework ldlework | who?
01:56:24ldleworkfrewtc4ke | deeze...DEEZE NUTZ
01:56:30ldleworklol
01:57:17ldleworkdef-: so do I just do "nimble install sdl2" from not inside the clone?
01:57:29*frewtc4ke left #nim (#nim)
01:57:31def-ldlework: to get back the original version?
01:57:32dom96Araq_: I feel like what you think is the "problem" is not actually the problem that ldlework is having.
01:57:42ldleworkdef-: yeah
01:57:50def-yes
01:58:17ldleworkdom96: you mean with regards to individual statements being executed before anything else?
01:58:36ldleworkjsudlow: run "nimble install sdl2"
01:58:40dom96ldlework: what
01:58:56ldleworkdom96: I have a bug out against the VM, I thought you were referring to that.
02:00:41dom96ldlework: No, i'm replying to Araq_'s message from 1:46am (you can probably guess what time that is in your timezone)
02:00:54ldleworkoh lol
02:02:43*derka quit (Quit: derka)
02:03:08dom96Your issue should be fixed once https://github.com/nim-lang/nimble/pull/183 (or something similar) is merged.
02:04:18dom96But yeah, lots of workarounds for this already
02:04:26dom96def- mentioned them all I think
02:28:27*pregressive quit (Remote host closed the connection)
02:28:39*wuehlmaus quit (Quit: Lost terminal)
02:41:33ldleworkAraq_, dom96: Do you think it would be possible to define a `.` override for a type to dynamically restrict what fields can be used on a type at runtime?
02:41:59ldleworkLike lets say the type had a bitset, and depending on the values in the bitset, certain fields would be usable, but any not represented in the bitset would raise an exception?
02:44:13ldleworkSeems like it might work.
02:46:48ldleworkMaybe the unified type approach is the wrong way to go about it hmmm
02:50:36*pregressive joined #nim
02:59:28*brson quit (Quit: leaving)
03:07:21*pregressive quit (Remote host closed the connection)
03:20:50*yglukhov joined #nim
03:25:19*yglukhov quit (Ping timeout: 260 seconds)
03:31:04*xet7 quit (Ping timeout: 265 seconds)
04:12:02*vendethiel quit (Remote host closed the connection)
04:12:13*vendethiel joined #nim
05:14:20*vangroan joined #nim
05:21:21*s4 joined #nim
05:22:22*yglukhov joined #nim
05:27:07*yglukhov quit (Ping timeout: 260 seconds)
06:11:11*mogu joined #nim
06:13:43*mogu quit (Client Quit)
06:39:38*darkf joined #nim
06:42:26*Jesin joined #nim
07:04:33*yglukhov joined #nim
07:09:19*yglukhov quit (Ping timeout: 260 seconds)
07:18:48*xet7 joined #nim
07:35:28*gokr joined #nim
07:45:59*wuehlmaus joined #nim
08:01:38*vendethiel quit (Ping timeout: 272 seconds)
08:02:44*vendethiel joined #nim
08:23:25*yglukhov joined #nim
08:40:27*Trustable joined #nim
08:40:36*Trustable quit (Remote host closed the connection)
08:44:00*Trustable joined #nim
08:46:36*Demon_Fox quit (Quit: Leaving)
08:58:09*vikaton quit (Quit: Connection closed for inactivity)
09:15:25*jaco60 joined #nim
09:33:50*bjz joined #nim
09:45:41*derka joined #nim
09:45:56*bjz quit (Ping timeout: 256 seconds)
09:48:01*bjz joined #nim
10:03:15*derka quit (Quit: derka)
10:14:49*desophos quit (Read error: Connection reset by peer)
10:31:15*vangroan quit (Ping timeout: 240 seconds)
10:46:23*derka joined #nim
11:07:49*derka quit (Ping timeout: 265 seconds)
11:08:39*derka joined #nim
11:20:42*Lea2 is now known as Learath2
11:27:35*vendethiel quit (Ping timeout: 240 seconds)
11:28:59*vendethiel joined #nim
11:37:08*vangroan joined #nim
12:23:20*exebook joined #nim
12:48:47*nchambers joined #nim
12:52:35*vendethiel quit (Ping timeout: 240 seconds)
12:53:48*vendethiel joined #nim
13:40:43*s4 quit (Quit: Konversation terminated!)
13:58:50*nchambers quit (Ping timeout: 260 seconds)
14:08:18*askatasuna joined #nim
14:08:57*yglukhov_ joined #nim
14:11:00*yglukhov quit (Ping timeout: 250 seconds)
14:21:48*yglukhov_ quit (Remote host closed the connection)
14:25:21*yglukhov joined #nim
14:25:24*yglukhov quit (Remote host closed the connection)
14:30:13*yglukhov joined #nim
14:50:25*yglukhov quit (Remote host closed the connection)
14:51:00*yglukhov joined #nim
14:56:04*vangroan quit (Quit: Leaving)
14:58:27*strcmp1 quit (Quit: peace)
15:00:54*derka_ joined #nim
15:03:17*derka quit (Ping timeout: 255 seconds)
15:03:18*derka_ is now known as derka
15:19:45derkaHello Guys, is there any way to have persistent data in Nim ?
15:20:39derkalike an inmemory database inside nim
15:22:02Araq_derka: I uses sqlite for these things.
15:22:21Araq_pure Nim solutions are not hard either with marshal.nim
15:22:52derkaThanks Araq_
15:26:17derkaAraq_ are there a lot of companies using Nim in real time production environement ?
15:26:20derkalike telecom for instance
15:26:42derkaI really love Nim and I think it is gonna enable me to do what i usually do in python and pure C
15:26:43Araq_no, but I expect this to change :-)
15:26:49derkaoh :)
15:26:57derkaWhat is missing? ANd when do you think it will be
15:27:09Araq_0.13 is around the corner and 0.14 will focus on async.
15:27:17derkanice
15:27:39Araq_but I don't make any release predictions anymore. it's too embarrassing.
15:27:45derkaI’ve been searching for a new langage for a long time, I looked at Go, Erlang, Rust, etc
15:27:50derkabut Nim really is the thing
15:28:23derkaI understand, same here,r you expect something to be done in a few month and it take more than a year is usual lol
15:39:23*gokr quit (Quit: Leaving.)
15:40:30derkaAraq_ is there anyway to return diferent type of value in a proc or method
15:43:15dom96hello derka
15:43:24derkaHello dom96
15:43:28dom96derka: can you elaborate your question?
15:43:39derkaI am gonna take an example in python
15:44:12derkaa function for instance could either return an integer value, or a list of integer for instance
15:44:51derkais there anyway to make this work in Nim ?
15:45:50dom96yes, you can use a variant object
15:46:01derkaok thx
15:46:21derkais there an example somewhere ?
15:46:22dom96but you likely shouldn't, if you're thinking dynamically then it sounds like you might doing it incorrectly already :)
15:46:35dom96Question is: what do you want to implement?
15:47:34derkaI want to implement a method for which i dont know in advance the type of result i will have
15:47:54derkathe result could be a string, an integer or a list of string
15:48:06dom96what does this method do?
15:48:16derkaquery a database
15:48:23dom96ahh okay.
15:48:25derkai think i found what i need, you are right variant seems the right stuff
15:48:26derkahttp://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants
15:49:00dom96Well, you may as well use the JsonNode object
15:49:09dom96http://nim-lang.org/docs/json.html#JsonNode
15:49:13dom96instead of defining your own
15:49:27dom96it should support everything you need
15:49:39dom96Hope this helps, sadly I must go!
15:49:44dom96see you later
15:50:05derkathx a lot
15:50:50*vendethiel quit (Ping timeout: 260 seconds)
15:50:51*BitPuffin joined #nim
15:51:16*vendethiel joined #nim
16:05:37*gokr joined #nim
16:17:29derkaGuys, the variant example here http://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants is not working
16:17:40derkaI get following error: pnode.nim(17, 24) Error: undeclared identifier: 'PNode'
16:19:45derkait it should be Node instead of PNode everywhere in the example
16:30:24Araq_good catch
16:36:29*Arrrr joined #nim
16:39:25Arrrrvegansk: Are you alive ?
16:42:10*derka quit (Ping timeout: 260 seconds)
16:50:21*derka joined #nim
16:51:03*vangroan joined #nim
16:52:47wuehlmauswow, tnim with tcc is something that is almost joy :)
16:57:55*yglukhov quit (Ping timeout: 260 seconds)
17:22:10def-wuehlmaus: yeah, tcc is crazy fast at compiling
17:26:06*vangroan quit (Read error: Connection reset by peer)
17:34:35*onionhammer quit (Ping timeout: 240 seconds)
17:35:01*Dmirly132 joined #nim
17:36:04*onionhammer joined #nim
17:43:49*vangroan joined #nim
17:45:22*yglukhov joined #nim
17:47:14*gokr1 joined #nim
17:47:55*gokr quit (Read error: Connection reset by peer)
17:49:59*yglukhov quit (Ping timeout: 264 seconds)
17:50:21*Dmirly132 quit ()
17:51:50*yglukhov joined #nim
17:55:51*yglukhov quit (Remote host closed the connection)
18:04:02*Jesin quit (Quit: Leaving)
18:09:22derkadom96 how do i get nimble to install i get Error: undeclared identifier: 'getModule' when i install it
18:13:09*BitPuffin quit (Ping timeout: 265 seconds)
18:24:40*gokr1 quit (Quit: Leaving.)
18:34:46*satbyy joined #nim
18:35:50*nchambers_ joined #nim
18:36:44*nchambers_ is now known as nchambers
18:45:46*dom96_mobile joined #nim
18:45:57*Jesin joined #nim
18:46:32dom96_mobilederka: you need a newer version of Nim
18:46:50derkaso i need to switch to devel ?
18:47:15dom96_mobileYeah
18:47:19derkaok thx
18:55:02*dom96_mobile quit (Ping timeout: 256 seconds)
18:59:15*askatasuna quit (Ping timeout: 260 seconds)
19:01:17*Salewski joined #nim
19:02:45SalewskiIs there something like signum, sign, sgn or copysign already available for Nim? See http://stackoverflow.com/questions/1903954/is-there-a-standard-sign-function-signum-sgn-in-c-c
19:09:40Salewskiproc sign(i: int): int = (if i < 0: -1 elif i > 0: 1 else: 0) # maybe not the best solution
19:09:48*Salewski quit ()
19:10:47*yglukhov joined #nim
19:15:50*askatasuna joined #nim
19:20:55*superfunc joined #nim
19:29:11*vangroan quit (Quit: Leaving)
19:35:47Araq_salewski: I'd expect it to generate optimal code with a modern C compiler
19:37:56ArrrrToo late for him, he is dead. A question, is this bug going to get fixed before 0.13? https://github.com/nim-lang/Nim/issues/3539
19:50:46*Matthias247 joined #nim
19:51:44*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
19:52:12*bjz joined #nim
19:59:21*kniteli joined #nim
20:01:13*Demon_Fox joined #nim
20:01:14*Salewski joined #nim
20:02:03wuehlmausdef-: crazy talent: he did ffmpeg , qemu and tcc. amazes me every time!
20:03:08wuehlmausplus linux in the browser!
20:07:19SalewskiAraq: CopySign may be more difficult, maybe for Nim we should do that with a var parameter, whle C++ returns the result. And some people seems to try to avoid branching for such expressions...
20:08:46*yglukhov quit (Remote host closed the connection)
20:09:09*Salewski quit ()
20:09:49Araq_Arrrr: sorry, no, I'm building the installers as we speak
20:10:08Araq_but after 0.13 we'll get a testing machine for XP
20:10:41*ephja joined #nim
20:11:14derkaGuys, I am a little lost with error messages provided by Nim
20:11:33derkawhat does it mean: jsontest.nim(7, 22) Error: type mismatch: got (NimNode) but expected one of: json.parseFile(filename: string)
20:12:30*superfunc quit (Quit: WeeChat 1.3)
20:13:15derkai think i know the issue
20:13:41ArrrrThat sounds good.
20:14:00derkalol
20:14:09derkai am trying to make a macro...
20:14:36ArrrrSorry, was a response to araq. Any snippet
20:14:38Arrrr?
20:17:12derkaoh ok lol
20:17:19derkalib/pure/lexbase.nim(155, 13) Error: VM is not allowed to 'cast'
20:17:58Arrrryou cannot cast in compile time
20:18:18derkaso i can not call many things from macro then
20:18:18derkalol
20:18:21derkawas trying to use json
20:22:19*yglukhov joined #nim
20:26:16dom96derka: did you get Nimble working?
20:26:22derkano lol
20:26:24dom96it's fine to ask here btw
20:26:43dom96you don't need to PM me
20:26:49derkaok but you were away
20:27:00derkaso my message would have been lost in the thread
20:27:07derkalol
20:27:15dom96Nah, I look at the IRC logs (http://irclogs.nim-lang.org/)
20:29:44*Arrrr quit (Quit: WeeChat 1.2)
20:32:27dom96in any case, you must have an old Nim in your PATH
20:34:07*brson joined #nim
20:36:51*BitPuffin joined #nim
20:37:01*darkf quit (Quit: Leaving)
20:38:37*BitPuffin quit (Read error: Connection reset by peer)
20:43:46derkaok
20:47:06derkagit branch
20:47:07derka* devel
20:47:17derkaNim Compiler Version 0.10.3 (2015-04-25) [MacOSX: amd64]
20:47:25derkai must be compiling it wrong
20:47:37derkashould i still do sh build.sh in csrouces
20:48:12Araq_0.10.3 ?
20:48:19Araq_that's *old*
20:48:56derka:)
20:50:54dom96derka: run `which nim`
20:51:00derkayeah
20:51:24derkaAbdelkaders-MacBook-Pro:Nim abdelkaderallam$ which nim
20:52:13derkaI am doing some magic with macro
20:52:24derkaand i cant even copy paste into irc
20:52:25derkalol
20:52:52derkawhich nim gives /Users/abdelkaderallam/Code/Nim/bin/nim
20:52:56derkawhich is where i jsut compiled
20:53:10derkaand when i do git log i get
20:53:11derkacommit a121c3f9eb2a348b9d6ae03ffd01aab26a238c30
20:53:12derkaAuthor: Araq <[email protected]>
20:53:13derkaDate: Mon Jan 18 20:16:21 2016 +0100
20:53:14derka updated installer.ini
20:53:15derkawhich means i should be up to date
20:53:51dom96did you './koch boot -d:release' ?
20:54:03derkano
20:54:05derkawhat is it doing
20:54:33dom96bootstrapping the compiler ;)
20:54:43derkainteresting :)
20:54:49derkai have to admit i didnt do it :)
20:54:55dom96the c sources contain an old version of the compiler, which is then used to compile the newest compiler source
20:54:58dom96*sources
20:55:04derkanow i am good
20:55:05derkanim
20:55:06derkaNim Compiler Version 0.13.0 (2016-01-18) [MacOSX: amd64]
20:55:22derkait sounds like pypy rpython complication
20:56:22Araq_except we don't need 10GB of RAM to bootstrap :P
20:56:29derkaloool
21:02:19*desophos joined #nim
21:02:52Xeokay
21:02:53Xeso
21:03:06Xetrying to do https://codegolf.stackexchange.com/questions/69189/build-a-compiler-bomb in nim
21:03:57Xebigbin.nim(4, 3) Error: undeclared identifier: 'a' for the code http://ix.io/nwP
21:07:11Xeif you remove the macro "b", and make the macro recursive, it gets the error "bigbin.nim(4, 5) Error: recursive dependency: 'a'"
21:12:56Araq_guys, please try 0.13.0!!!!
21:19:05XeAraq_: I will!!!!
21:19:09Xetarball link???
21:21:56derkaGuys i just tried to make a redis client in Nim
21:22:04derkafirst code ever done in Nim for me
21:22:05derkahttps://github.com/aallamaa/desirnim
21:23:02derkait is missing some stuff but it is a start that contains all the commands of redis, some redis features like pipelining and subscribing are missing though will do it later
21:23:18*xet7 quit (Read error: Connection reset by peer)
21:23:28derkaI am using macro and variant object
21:23:39def-Xe: http://nim-lang.org/download.html
21:24:56derkaThe way i coded it is similar to the way i did on of the official python redis client : desir which is also using metaclass to self generate functions
21:25:50Araq_derka: we also have a redis client as a nimble package
21:26:03derkayeah i saw it :)
21:28:06derkabut you quoted : "Repetition renders the ridiculous reasonable." -- Norman Wildberger
21:28:42derkaso i tried to make code which generate by it self instead of manually rewriting every possible command in redis
21:32:22derkaNim is really powerful
21:33:11*xet7 joined #nim
21:35:13*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:38:30*askatasuna quit (Ping timeout: 260 seconds)
21:58:52*lagoon_monster joined #nim
22:00:14lagoon_monsterHi, I'm trying to access a PostgreSQL database using db_postgres on Windows 7 with Nim. When I run the program, I get "could not load: libpq.dll". Is there something I can do to correct this?
22:00:46ldleworklagoon_monster: install libpq
22:02:00lagoon_monsterPostgreSQL is installed on this host, and libpq is there. Does nim need to see this in the path, or in an environment variable, etc.?
22:03:17dom96lagoon_monster: it needs to be in the path or beside the .exe
22:06:31lagoon_monsterdom96: Interesting, OK, I copied libpq.dll to exe's folder, and then it said I needed ssleay32.dll. Copied that from postgres, and it said it needed libeay32.dll. Copied that, and I'm back to "could not load: libpq.dll". Will try adding the postgres bin folder to the path and see if that works better.
22:08:47lagoon_monsterdom96: That was from a 9.5-beta1 install. If I just copy all the DLLs from the 9.4 bin folder, it runs.
22:10:13Araq_lagoon_monster: also often DLLs have 32 vs 64 bit issues
22:10:55lagoon_monsterAraq_: That makes sense, 64-bit nim installed, but the 9.5b1 install might be 32
22:13:52Araq_probably
22:16:41lagoon_monsterThanks guys :)
22:22:32*nchambers quit (Ping timeout: 272 seconds)
22:38:02*lankanmon quit (Quit: I have to Go! Bye Guys!)
22:41:58*vendethiel quit (Ping timeout: 272 seconds)
22:44:28*vendethiel joined #nim
22:48:06*pregressive joined #nim
22:50:17*enquora joined #nim
22:54:09ldleworkAre BracketExpr's potentially infinitely recursive?
22:54:30ldleworkA[B[C[D[E[F[G[H ...
22:54:45Araq_why not? ;-)
22:54:45*enquora quit (Client Quit)
22:55:05ldleworkheh makes writing pretty abstractions over the top a bit more finicky :D
22:55:09*enquora joined #nim
22:55:12ldleworkbut ok, thanks
22:56:11*enquora quit (Client Quit)
22:56:36ldleworkI kind of want to treat Ident's and BracketExpr's as just Ident
22:56:51*enquora joined #nim
22:57:00ldleworkSince there are a number places where a BracketExpr can take the place of an Ident
22:57:14ldleworklike in the type-desc for IdentDefs
22:57:46*yglukhov quit (Remote host closed the connection)
22:57:55ldleworkI don't think I actually ever need a BracketExpr, where, it wouldn't be possible for an Ident to appear instead
23:00:35ldleworkAraq_: is there a good way for unit-testing macros?
23:03:13ldleworkdo you just unit test the stuff that macros produce instead?
23:04:20*vendethiel- joined #nim
23:04:46*vendethiel quit (Ping timeout: 272 seconds)
23:05:00Araq_good question
23:07:59*satbyy quit (Ping timeout: 264 seconds)
23:08:35*vendethiel- quit (Ping timeout: 240 seconds)
23:15:01Xei cna't install nimble, it says it needs the library for the compiler
23:15:13Xe/home/xena/prefix/nimble/src/nimblepkg/nimscriptsupport.nim(8, 11) Error: cannot open 'compiler/ast'
23:21:31dom96def-: hrm, I wonder what that caching issue is, any ideas?
23:21:59dom96Xe: how are you installing it?
23:22:19Xedom96: nimble?
23:22:34dom96Xe: yes
23:22:49dom96or do you mean that you using nimble to install it? :P
23:22:55Xegit clone of nimblt to ~/prefix/nimble
23:22:58Xexena@greedo (linux) ~/prefix/nimble
23:23:00Xe➜ nim c -r src/nimble install
23:23:02Xefails
23:23:38*enquora quit (Quit: enquora)
23:24:01def-dom96: not sure, wasn't cached for me
23:24:41Xedom96: nim itself was installed via https://github.com/Xe/rpmspecs/blob/master/nim/nim.spec
23:25:51dom96Xe: My guess is that install.sh does not install the compiler sources.
23:26:21Araq_and where would it install these?
23:26:58dom96no idea
23:27:07dom96definitely a problem
23:27:16Xei see them at /usr/lib/nim
23:28:32dom96Xe: try: nim c --path:/usr/lib/nim src/nimble
23:29:09Xeoh
23:29:11Xethat's odd
23:29:22Xeit put the stdlib sources in /usr/lib/nim
23:29:26Xebut not the compiler source
23:30:08Xeit dumped everything in lib in /usr/lib/nim lol
23:31:14Xebug in my rpmspec likely
23:41:00ldleworkWhat's the best way to have a default arg for a sequence?
23:41:08ldleworkAnd if the sequence isn't provided, to initialize an empty sequence?
23:41:56ldleworkDo you just make the default nil
23:42:10ldleworkand then in the proc, check if the param is nil, and if it is, set it to a new sequence?
23:43:50dom96okay, I think I fixed the caching issue
23:48:36dom96ldlework: proc foo(x: seq[int] = @[])?
23:48:59ldleworkdom96: doing this in Python is a gotcha
23:49:04ldleworkis it a gotcha in Nim too?
23:49:29dom96Don't think so.
23:49:45ldleworkdom96: when is that array initialized?
23:49:55def-ldlework: I would say no, but you could emulate the Python gotcha like this, if I understand it correctly:
23:50:05def-var default = @[]
23:50:13def-proc foo(x: seq[int] = default)
23:50:21ldleworkokay so each time I call it, I get a new sequence
23:50:29ldleworkthanks
23:50:36dom96seq[int] isn't mutable
23:50:49ldleworkhmm?
23:50:51dom96so i don't think the gotcha applies right?
23:51:25ldleworkmaybe not, but in the var case
23:51:57dom96in the var case you can't just set it to @[] in the param list
23:52:01def-ldlework: with var it fails to compile, preventing the gotcha
23:52:12ldleworkwhy would it fail to compile
23:52:29Xeokay so install.sh doesn't copy the compiler sources
23:52:51ldlework`proc foo(x: var seq[int] = @[])` isn't valid Nim?
23:52:57dom96Xe: Well... that's not good :\
23:53:32*askatasuna joined #nim
23:53:32dom96ldlework: nope. You can't pass a literal to a 'var T' type.
23:54:43ldleworkpass?
23:55:07ldleworkI'm confused
23:55:21ldleworkoh because
23:55:29ldleworkyou would have nowhere to access the mutated value?
23:55:34ldleworkbecause you passed a literal?
23:56:31dom96I think so, yeah.