00:09:51 | FromGitter | <yyyc514> "Hi Jester, Thanks a lot for the tip. Today I started to get name conflicts on autogenerated imports. I have macro that scans all nim files and imports those that have tests in them." |
00:09:55 | FromGitter | <yyyc514> so maybe this is possible? |
00:09:57 | FromGitter | <yyyc514> https://forum.nim-lang.org/t/3154 |
00:12:47 | FromGitter | <yyyc514> ok so now it works, damn why didn’t it work yesterday |
00:13:40 | * | dddddd quit (Remote host closed the connection) |
00:14:17 | FromGitter | <yyyc514> ok if you keep it in the top level with a chain of macros/templates it works, but throw a proc in there and it’s no longer “top-level” which makes sense i guess |
00:21:33 | * | Tortice quit (Remote host closed the connection) |
00:22:00 | * | Tortice joined #nim |
00:30:50 | * | Tyra joined #nim |
00:32:36 | * | vlad1777d__ quit (Ping timeout: 272 seconds) |
00:35:15 | * | Tyra quit (Ping timeout: 256 seconds) |
00:42:26 | * | zachk quit (Quit: Leaving) |
00:51:57 | * | vivus quit (Remote host closed the connection) |
01:24:43 | * | stefanos82 quit (Quit: Quitting for now...) |
01:42:23 | * | craigger joined #nim |
01:43:51 | * | craigger_ quit (Ping timeout: 260 seconds) |
01:45:39 | * | guin joined #nim |
01:50:03 | * | guin quit (Ping timeout: 256 seconds) |
01:56:00 | * | persi_ joined #nim |
02:03:27 | * | krux02 quit (Remote host closed the connection) |
02:04:13 | * | persi_ quit (Ping timeout: 256 seconds) |
02:04:50 | * | banc quit (Quit: ZNC - http://znc.in) |
02:20:49 | * | banc joined #nim |
02:33:19 | * | endragor joined #nim |
02:34:46 | * | craigger quit (Read error: Connection reset by peer) |
02:36:24 | * | craigger joined #nim |
03:08:31 | * | erasi12 joined #nim |
03:08:42 | * | erasi12 left #nim (#nim) |
03:14:51 | * | chemist69 quit (Ping timeout: 260 seconds) |
03:16:31 | * | chemist69 joined #nim |
03:19:52 | FromGitter | <Epictek> Hmm nimble seems to have randomly broke, any ideas? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc558d882893a2f3beac982] |
03:39:52 | FromGitter | <Epictek> fixed it by using choosenim instead |
03:40:01 | * | flaviu quit (Ping timeout: 250 seconds) |
03:44:17 | * | flaviu joined #nim |
04:30:35 | * | darithorn quit () |
04:40:29 | * | tiorock joined #nim |
04:40:29 | * | tiorock quit (Changing host) |
04:40:29 | * | tiorock joined #nim |
04:40:29 | * | rockcavera quit (Killed (leguin.freenode.net (Nickname regained by services))) |
04:40:30 | * | tiorock is now known as rockcavera |
04:49:31 | * | Pisuke joined #nim |
04:50:26 | * | MyMind quit (Ping timeout: 276 seconds) |
05:06:47 | FromGitter | <yyyc514> too bad overloads don’t also consider the return value |
05:35:38 | * | nsf joined #nim |
05:44:45 | * | smt quit (Read error: Connection reset by peer) |
05:54:47 | * | flaviu quit (Ping timeout: 276 seconds) |
06:35:01 | * | rewadz joined #nim |
06:50:55 | copygirl | Mhh it's not possible to mark types as compile time only? |
06:51:21 | FromGitter | <yyyc514> i presume if they werne’t used they’d just be removed by the compiler? |
06:52:54 | copygirl | Also possible, but the same could be true for unused methods, right? It would be nice to enforce and mark such types as such. |
06:53:47 | FromGitter | <yyyc514> sorry don’t know |
06:54:10 | FromGitter | <yyyc514> i think the methods might actually have a reason that you tag them but i’m not sure |
06:55:00 | leorize | copygirl: I think the `static[T]` types are compile time only |
07:00:59 | Araq | types are *always* compile-time, all of them. you cannot "optimize them away" because they don't generate code to begin with. |
07:02:37 | copygirl | I was just thinking of marking them explicitly as such so they can't be used in a non compile-time context. |
07:03:31 | Araq | add a 'field: NimNode' to get that :P but I don't think it's required |
07:15:40 | * | vegai left #nim (#nim) |
07:24:06 | FromGitter | <gogolxdong> Windows compile broke ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc59216ef4afc4f288009b4] |
07:28:24 | FromGitter | <narimiran> @gogolxdong https://github.com/nim-lang/Nim/issues/9375 ? |
07:50:14 | FromGitter | <yyyc514> how does one typicall deal with the need for “nil”? Like if I search the DB for a record it either returns or it’s not found? what’s the right way to model that in Nim? |
07:53:08 | FromGitter | <gogolxdong> probably, I'm using gcc 8.1.0 |
07:57:40 | FromGitter | <alehander42> @yyyc514 I'd use `Option` |
07:57:45 | FromGitter | <alehander42> from the options module |
08:00:17 | FromGitter | <mratsim> @yyyc514 you can write import with macros and templates as long as it puts imports at the top level |
08:00:30 | FromGitter | <yyyc514> yeah i think i got that sorted now |
08:05:06 | FromGitter | <yyyc514> hmmm options is weird/interesting |
08:05:55 | * | benjikun joined #nim |
08:06:12 | * | sagax_ joined #nim |
08:15:58 | * | Reslnqme joined #nim |
08:16:04 | FromGitter | <bpo217> @yyyc514 You could use optional |
08:16:10 | FromGitter | <bpo217> Or Option[T] |
08:16:36 | FromGitter | <bpo217> @yyyc514 Let me rephrase, you could use Option[T] |
08:17:20 | FromGitter | <bpo217> oh we already said this my b |
08:20:29 | * | Reslnqme quit (Ping timeout: 256 seconds) |
08:24:10 | * | redlegion quit (Quit: Ded.) |
08:25:52 | FromGitter | <yyyc514> looks kinda verbose |
08:26:44 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/7dd53e95e1019e0848076bdd0daa51d5 |
08:28:14 | FromGitter | <alehander42> you don't have to always use `()` (you can `tmp.isSome` and `tmp.get`, ofc, it's a matter of taste) |
08:28:27 | FromGitter | <alehander42> well, it's more type-safe |
08:28:39 | FromGitter | <yyyc514> oh sure, but that doesn’t make it shorter :) |
08:28:59 | FromGitter | <alehander42> `tmp.isSome` vs `tmp.isNil` is the same amount of code |
08:29:00 | * | redlegion joined #nim |
08:29:00 | * | redlegion quit (Changing host) |
08:29:00 | * | redlegion joined #nim |
08:29:13 | FromGitter | <alehander42> you do have `tmp.get` for now |
08:29:32 | FromGitter | <yyyc514> how do nils work? just with refs? |
08:29:56 | FromGitter | <alehander42> eventually pattern matching can remove this `.get` too (it does now in my lib and in PMunch's proposal, but none of this is in the stdlib) |
08:30:11 | FromGitter | <alehander42> I guess refs & ptrs |
08:30:20 | FromGitter | <yyyc514> link to your lib? |
08:32:59 | FromGitter | <narimiran> @yyyc514 your code with options looks fine to me. what's the problem? |
08:33:04 | FromGitter | <alehander42> this is an example, but I admit it's not yet optimized for options https://github.com/alehander42/gara/blob/master/tests/test_gara.nim#L174 |
08:33:22 | FromGitter | <alehander42> but indeed, I think even in its current form, your code is fine |
08:33:50 | FromGitter | <mratsim> options are currently being overhaul’ed to allow `?.` for shorter unwrapping |
08:34:47 | FromGitter | <mratsim> but besides assuming that all is always well, there is no way to hide the complexity of null values coming from raw sql queries |
08:35:49 | FromGitter | <yyyc514> like tmp.?() |
08:35:55 | FromGitter | <yyyc514> vs get? |
08:37:15 | FromGitter | <yyyc514> !tmp is interesting too |
08:37:58 | FromGitter | <yyyc514> @miran just i’m coming from ruby, so could be i’m hopign for too much :) |
08:39:13 | FromGitter | <yyyc514> could also just do find! and have it raise when it can’t find |
08:39:43 | FromGitter | <yyyc514> are exceptions slower than normal code that just checks results? |
08:46:43 | leorize | it depends |
08:47:14 | FromGitter | <yyyc514> i mean using exceptions for a common case |
08:47:16 | FromGitter | <yyyc514> like “not found" |
08:47:23 | Araq | that's bad :P |
08:47:25 | leorize | then it's expensive |
08:47:30 | leorize | not to mention looks ugly as hell |
08:48:18 | FromGitter | <yyyc514> thought so |
08:51:33 | * | flaviu joined #nim |
08:52:58 | * | kapil____ joined #nim |
08:54:13 | FromGitter | <alehander42> and it's sometimes harder to reason about |
08:55:46 | * | idlebot_ joined #nim |
09:00:09 | * | idlebot_ quit (Ping timeout: 256 seconds) |
09:00:19 | FromGitter | <yyyc514> anyone familiar with nim-orm? |
09:03:15 | FromGitter | <yyyc514> template ormLoad*{user.field}(user: Model, field: expr{field}): expr = |
09:03:25 | FromGitter | <yyyc514> trying to understand the {} stuff going on there - never seen that syntax before |
09:03:35 | * | gmpreussner joined #nim |
09:04:11 | Araq | it a term-rewrite template. |
09:04:13 | * | gmpreussner_ quit (Ping timeout: 268 seconds) |
09:05:24 | FromGitter | <yyyc514> reading manual now |
09:10:42 | FromGitter | <yyyc514> ok starting to thing tempaltes are a lot cooler than i imaged before :) |
09:15:01 | Araq | it feels like an abuse of a TR template, I can break this code with --patterns:off |
09:15:04 | Araq | I bet :P |
09:15:45 | Araq | maybe try Ormin but sadly I have no time to work on it, contributors welcome |
09:17:29 | FromGitter | <7sDream> How can I generate docstring for a type which defined in a macro? |
09:19:31 | Araq | tough :-) |
09:22:26 | FromGitter | <7sDream> 😛 that’s a bit sad |
09:24:22 | FromGitter | <alehander42> Can't we generate comment nodes? or they are just not picked up by the doc gen ? |
09:25:32 | FromGitter | <alehander42> on the other hand , why would somebody need those docstrings? for IDE intelligence? (as they might be unique for each compiled program) |
09:27:11 | FromGitter | <7sDream> I want to use it to generate document, just like offical document of stdlib |
09:27:21 | FromGitter | <7sDream> For my module |
09:29:30 | FromGitter | <narimiran> yeah somebody asked/tried that few days ago, but with no success |
09:33:26 | * | flaviu quit (Ping timeout: 260 seconds) |
09:33:40 | FromGitter | <7sDream> It’s me (I guess |
09:34:08 | FromGitter | <7sDream> Just ask if there is any progress... |
09:34:30 | FromGitter | <alehander42> I see, I thought the macro is used by users to define their own types(which would be different each time) |
09:34:37 | * | xace quit (Read error: Connection reset by peer) |
09:35:43 | * | flaviu joined #nim |
09:36:39 | * | xace joined #nim |
09:37:47 | FromGitter | <gogolxdong> Windows build failed with gcc 7.3.0 too. |
09:46:08 | Araq | 7sDream: problem is it requires an AST extension/change |
09:46:29 | Araq | gogolxdong: try clang or the GCC that 'finish.exe' would download |
09:51:09 | FromGitter | <gogolxdong> ok |
09:56:57 | FromGitter | <gogolxdong> but what's the problem? |
10:03:49 | FromGitter | <gogolxdong> still broken with finish.exe downloaded mingw-6.3.0 |
10:03:54 | * | freeman_ joined #nim |
10:06:26 | * | platoff joined #nim |
10:08:09 | * | freeman_ quit (Ping timeout: 256 seconds) |
10:10:13 | * | Pisuke quit (Read error: Connection reset by peer) |
10:11:18 | * | Pisuke joined #nim |
10:17:10 | * | zoro joined #nim |
10:21:45 | * | zoro quit (Ping timeout: 256 seconds) |
10:26:32 | * | Vladar joined #nim |
10:32:09 | FromGitter | <narimiran> "You can use `nim c --nep1:on myfile.nim` to get a style check." -> i've just tried this and nothing happens? |
10:34:26 | FromGitter | <narimiran> btw, how to install/use nimpretty? |
10:35:53 | * | Vladar quit (Ping timeout: 245 seconds) |
10:36:35 | Araq | gogolxdong: well appveyor disagrees and so does my PC |
10:40:37 | * | krux02 joined #nim |
10:41:51 | Araq | temp.nim(6, 5) Hint: name should be: 'foo' [Name] |
10:41:51 | * | krux02 quit (Remote host closed the connection) |
10:41:56 | Araq | works for me |
10:42:48 | * | rokups joined #nim |
10:43:24 | FromGitter | <narimiran> oh, it finds capital letter. i was testing it with spaces before :, unnecessary spaces, no spaces where needed, etc. |
10:44:17 | FromGitter | <narimiran> i guess nimpretty catches all of these: where can i find it? how to use it? |
10:44:42 | FromGitter | <narimiran> https://nim-lang.org/docs/tools.html no mention of nimpretty. |
10:48:06 | * | Vladar joined #nim |
10:50:00 | Araq | "koch tools" |
10:50:14 | Araq | it's not documented because its quality is not good enough |
10:50:48 | * | elrood joined #nim |
10:53:11 | * | Vladar quit (Remote host closed the connection) |
10:55:06 | FromGitter | <kaushalmodi> Araq: Is there a plan to allow a global config.nims? |
10:55:30 | FromGitter | <kaushalmodi> I see myself copy pasting the same config.nims tasks to each new project |
10:56:45 | FromGitter | <narimiran> is that a reason why it is in nimpretty folder, and not in tools/nimpretty? |
11:02:05 | * | abm joined #nim |
11:03:26 | * | nc-x joined #nim |
11:04:46 | nc-x | @kaushalmodi: What is the use of global config.nims? Isn't build configuration supposed to be bundled together with the source code so that someone else can also compile the project? |
11:06:22 | * | nc-x quit (Client Quit) |
11:07:06 | FromGitter | <mratsim> one config to rule them all and in the darkness bind them |
11:08:08 | * | Vladar joined #nim |
11:08:51 | FromGitter | <narimiran> ok, choosenim has made this more difficult than it should be, but i got nimpretty running |
11:10:12 | Araq | narimiran: I hate directories with a passion, they are a productivity killer |
11:10:30 | FromGitter | <narimiran> lol, ok :D |
11:14:12 | * | Vladar quit (Remote host closed the connection) |
11:15:49 | FromGitter | <kaushalmodi> nc-x: I have developed test running, doc generating, binary generating tasks without any project-specific hard coding. I simply copy paste those to each new project. They are not needed for the project to be built by anyone else. |
11:16:26 | FromGitter | <kaushalmodi> Also the idea would be that project specific config.nims would append (to the end) of the proposed global config.nims |
11:17:10 | FromGitter | <kaushalmodi> So I can have the global config.nims to hold just my tasks, and the project config.nims for project-specific stuff. Araq? |
11:19:24 | poopBot | hmm do in nim i have to code all my procs infront? Up from call? |
11:20:03 | * | tdc quit (Ping timeout: 245 seconds) |
11:20:16 | FromGitter | <kaushalmodi> poopBot (umm), yes, or you forward declare |
11:20:29 | * | tdc joined #nim |
11:20:31 | poopBot | same for objects i guess |
11:20:34 | Araq | kaushalmodi: I don't know, there was a PR for that, maybe /etc/nim/config.nims works now |
11:21:05 | * | Vladar joined #nim |
11:21:16 | FromGitter | <kaushalmodi> Hmm, I cannot touch the /etc dir (no sudo rights on work machine) |
11:22:05 | FromGitter | <kaushalmodi> But I'll dig into the source. If it is you are say, may be change that to XDG_CONFIG_HOME like for the .cfg files |
11:26:32 | Araq | or it's ~/.config/nim/config.nims |
11:27:07 | * | seni joined #nim |
11:32:03 | * | kapil____ quit (Quit: Connection closed for inactivity) |
11:35:28 | FromGitter | <kaushalmodi> Thanks, I'll try that out soon. |
11:39:05 | * | dddddd joined #nim |
11:42:41 | * | Vladar quit (Remote host closed the connection) |
11:51:52 | FromGitter | <alehander42> i am almost sure ~/.config/nim.cfg works, I use it for quite some time |
11:51:58 | FromGitter | <alehander42> I am not sure about nims |
11:57:24 | poopBot | so my first projet i want to make simple alternative to kodi for rpi3, cuz i need it , kodi is troling me a lot on raspbian :) |
11:58:11 | poopBot | so number 1 question is i dont want to put all code in 1 file like idiot, so i should use moduls right? |
11:59:16 | poopBot | sorry if i offended somone with idiot word xD |
11:59:52 | * | Snircle joined #nim |
12:00:49 | poopBot | turtorial says module so guess will use that |
12:02:37 | * | radioactivity joined #nim |
12:03:16 | * | radioactivity quit (Client Quit) |
12:11:06 | FromGitter | <alehander42> of course, you should split your code in different files |
12:14:12 | * | Vladar joined #nim |
12:17:49 | * | sdfsdvavasdv joined #nim |
12:24:48 | FromGitter | <narimiran> Araq: you assigned https://github.com/nim-lang/Nim/issues/2361 to me, but i have no idea what to do with it. i've never used {.async.} and i even don't know what i need to import to get rid of "Error: invalid pragma: async" so i can test that snippet |
12:25:18 | poopBot | proc Something() {.async.} = |
12:25:40 | poopBot | await somework |
12:26:30 | poopBot | from what i get {.async.} is used to mark that function/proc an async one |
12:26:37 | poopBot | and then you can use await in it |
12:26:43 | Araq | narimiran: you only need to improve the compiler's error message with something like "capturing openArrays would violate memory safety" |
12:27:01 | FromGitter | <narimiran> oh, it is "import asyncdispatch" |
12:27:05 | FromGitter | <narimiran> ok, will try to do that |
12:27:06 | poopBot | tought i am newbie sorry if dident hepl |
12:27:48 | FromGitter | <narimiran> so it is ok that it works for `seq[int]`? |
12:28:17 | * | sdfsdvavasdv quit (Quit: Page closed) |
12:28:19 | Araq | well that's the workaround that needs to be used |
12:28:54 | Araq | the error message could clarify that, ideally it links to some new short "article" in doc/manual/ |
12:29:19 | Araq | it's 2018, error messages can now contain links |
12:29:31 | FromGitter | <narimiran> ok, i'll try to find where the current error is generated and improve on that. but i cannot promise anything |
12:29:47 | Araq | the compiler is grepable |
12:30:17 | Araq | oh btw 'koch temp c foo.nim' produces a stack trace telling you where the error inside of the compiler came from |
12:31:35 | Araq | I thought it's time you start more interesting work than just merging test files :P |
12:31:55 | * | miniminimum joined #nim |
12:32:16 | FromGitter | <narimiran> haha, true true :D those merges are my way of relaxing of the usual job i do ;) |
12:32:16 | * | PMunch joined #nim |
12:32:41 | FromGitter | <narimiran> thanks for the "koch temp" tip — very useful |
12:33:21 | FromGitter | <narimiran> *relaxing from my day-job |
12:34:41 | FromGitter | <kaushalmodi> Araq: ~/.config/nim/config.nims works! Need to now update the nims.rst |
12:35:05 | FromGitter | <kaushalmodi> But now there's a problem.. I don't know how to figure out the nim invocation dir from the config.nims |
12:35:25 | FromGitter | <kaushalmodi> earlier I used `thisDir()`, but now `thisDir()` points to ~/.config/nim/ |
12:35:43 | Araq | projectDir was added to NimScript |
12:35:49 | Araq | check it out |
12:36:37 | * | miniminimum quit (Ping timeout: 256 seconds) |
12:37:32 | * | cei joined #nim |
12:38:06 | * | cei quit (Client Quit) |
12:38:08 | * | smt joined #nim |
12:38:35 | FromGitter | <kaushalmodi> thanks! `projectDir()` works |
12:39:02 | poopBot | hmm newbie question, i got http token working, but now am converting to async , and i have issue , json now complains how http response is of Future , but i awaited first it so, hmm, anyone care to aleborate , if i await for it (wait for it to finish) should it be like normal or do i need to expiclity cast to nonfuture or what |
12:39:53 | Araq | await is what you should use |
12:40:25 | poopBot | i did |
12:40:31 | poopBot | sec i hastebin it |
12:45:22 | poopBot | https://hastebin.com/derameqiku.bash |
12:45:37 | poopBot | sorry it took a wile head to google Nim multyline comments |
12:47:30 | poopBot | Araq, you here? |
12:49:30 | Araq | parseJson(await response.body) |
12:49:38 | Araq | you said it yourself... |
12:50:40 | poopBot | oh but why am i then 2 times awaiting response? |
12:50:48 | poopBot | i await.response |
12:50:55 | poopBot | then await response.body |
12:51:48 | poopBot | hmm thats wierd in my brain, cuz by my logick when i awaited respons , i waited whole respones, duno why i now how to w8 for body when is allready here |
12:52:16 | poopBot | guess thats to fallow sytax |
12:52:21 | poopBot | or duno |
12:55:31 | Araq | the body is a stream of stuff that comes after the response, maybe, I hardly use async |
12:56:50 | poopBot | oh, i thinked response is like box and all gets filled in it body,header,... and when i awiat it it w8ts for whole box to be deliverd , anyway now it works so np :) |
13:00:07 | * | kapil____ joined #nim |
13:01:22 | FromGitter | <narimiran> Araq: i followed your hints and this is what i came up with: https://github.com/narimiran/Nim/commit/481cbe29a687a2d61318f019c356cde4e0051137 haven't sent a PR because i'm not sure this is what is needed or that should be fixed some other way |
13:02:11 | FromGitter | <alehander42> @poopBot in cases like this, look at the docs(e.g. httpclient here) |
13:02:48 | Araq | narimiran: well this code path is not only for openArray |
13:03:00 | Araq | '$1' is of type <$2>, declared here: $3 |
13:03:04 | Araq | I would make that |
13:03:07 | FromGitter | <alehander42> it might be a bit confusing, because the response has a `body` field, but notice it's not public (no `*`), so you have to look at the getter (the proc body ) |
13:03:45 | Araq | '$1' is of type <$2> which cannot be captured as it would violate memory safety, declared here: $3 |
13:05:14 | FromGitter | <narimiran> ok, i'll change the message. i wanted to make sure i'm at the right place and i don't need to have some other if-branch, or stuff like that |
13:05:31 | poopBot | i looked docs ofc , i try to look there before ask questions |
13:06:08 | * | endragor quit (Remote host closed the connection) |
13:07:31 | FromGitter | <narimiran> the best/preferred way to wrap too long strings? |
13:13:58 | * | flaviu quit (Ping timeout: 268 seconds) |
13:14:35 | * | craigger_ joined #nim |
13:16:21 | * | craigger quit (Ping timeout: 250 seconds) |
13:22:41 | * | xyxfnjpps joined #nim |
13:22:55 | * | xyxfnjpps quit (Client Quit) |
13:23:01 | leorize | narimiran: most of the time I use `&` |
13:23:09 | * | stefanos82 joined #nim |
13:23:30 | * | flaviu joined #nim |
13:24:00 | FromGitter | <narimiran> thanks leorize |
13:25:14 | * | endragor joined #nim |
13:25:48 | FromGitter | <narimiran> nah, it doesn't play well with string interpolation |
13:26:02 | FromDiscord | <hotdog> Does anyone have a working example of hot code reloading? I'm looking at the docs here: https://nim-lang.org/docs/nimc.html#additional-features-hot-code-reloading |
13:27:54 | * | endragor quit (Remote host closed the connection) |
13:29:34 | FromGitter | <Vindaar> @narimiran something like this should work (taking the string from the commit above) ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ where I just defined some proc that only takes one string [https://gitter.im/nim-lang/Nim?at=5bc5e7bebbdc0b25054e386b] |
13:29:45 | * | endragor joined #nim |
13:30:35 | * | endragor quit (Remote host closed the connection) |
13:33:49 | FromGitter | <narimiran> @Vindaar nice one! i had `"foo $1" & "bar $2" % [a, b]` |
13:33:59 | FromGitter | <narimiran> that didn't work |
13:34:04 | FromGitter | <Vindaar> yep, good point |
13:37:32 | Araq | () % [] |
13:39:45 | FromGitter | <narimiran> that works too |
13:39:46 | FromGitter | <Vindaar> oh, that works too. Makes sense, nice! |
13:40:46 | FromGitter | <narimiran> i've just submitted @Vindaar's version in the PR. if the second one is preferred, i'll change it |
13:41:34 | FromGitter | <Vindaar> Araq's version saves one call to `%`... :) |
13:41:35 | FromGitter | <kaushalmodi> Araq: I was working on a PR to update docs for nims |
13:41:43 | leorize | efficency! |
13:41:54 | FromGitter | <kaushalmodi> I want to know if the `--skip*` switches apply to config.nims too |
13:42:00 | FromGitter | <Vindaar> Although on an error that stops the compilation that's not *really* important, is it? :P |
13:42:09 | FromGitter | <kaushalmodi> but cannot find out in the source where those switches are defined |
13:42:26 | leorize | kaushalmodi: try it yourself |
13:42:29 | leorize | should be simple :P |
13:42:30 | FromGitter | <kaushalmodi> searching the source just yields refs to their documentation |
13:42:38 | FromGitter | <kaushalmodi> leorize: but I want to submit a PR |
13:42:42 | FromGitter | <kaushalmodi> so want to be sure |
13:42:53 | leorize | look for the PR that implement the entire thing |
13:43:21 | FromGitter | <kaushalmodi> hmm, let me find the commit that added the `--skip*` docs |
13:43:33 | FromGitter | <kaushalmodi> hopefully the same commit added that switch implementation too :P |
13:43:35 | Araq | #!nimpretty toggle |
13:43:39 | Araq | like that? |
13:43:41 | Araq | or |
13:43:47 | Araq | #!nimpretty off |
13:43:54 | Araq | #!nimpretty on |
13:43:59 | Araq | what do you think? |
13:44:13 | leorize | kaushalmodi: https://github.com/nim-lang/Nim/pull/8682 |
13:44:21 | FromGitter | <kaushalmodi> leorize: I assumed this :P ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc5eb346e5a401c2d7ed03c] |
13:45:14 | FromGitter | <kaushalmodi> thanks. I now also know why grep failed.. |
13:45:27 | FromGitter | <kaushalmodi> should have grepped for `skip.*cfg` |
13:45:38 | Araq | clang uses on/off, ok |
13:47:16 | * | krux02 joined #nim |
13:48:55 | FromGitter | <alehander42> I think off/on is much better |
13:49:34 | FromGitter | <alehander42> as otherwise you have to look at the whole file to see how many toggles were before the next one |
13:50:33 | Araq | ok |
13:51:41 | FromGitter | <alehander42> btw is it possible to abuse this |
13:52:08 | FromGitter | <alehander42> e.g. if I add `#!nimpretty off` to the end of a module that people include a lot, would that apply to their files |
13:52:59 | Araq | nimpretty doesn't know shit about modules, it's just a parser over the current file |
13:53:09 | FromGitter | <alehander42> ah ok |
13:57:44 | poopBot | duno if i am blind but how to pass parameter on http get request |
13:58:41 | * | nsf quit (Quit: WeeChat 2.2) |
14:00:36 | poopBot | do i need to manulay build get string? |
14:01:08 | FromGitter | <kaushalmodi> still on the topic of config.nims, is there a way to list all the available tasks? |
14:01:22 | FromGitter | <kaushalmodi> like `nimble tasks` but for .nims files? |
14:02:46 | FromGitter | <kaushalmodi> hmm.. asked too soon, found the answer but is strange .. |
14:02:55 | FromGitter | <kaushalmodi> so `nim help` lists all the available tasks |
14:03:06 | FromGitter | <kaushalmodi> but `nim --help` is the usual nim help |
14:04:02 | leorize | it's not documented in `--fullhelp` so... maybe open a PR to document it? |
14:04:38 | FromGitter | <alehander42> @poopBot I think so, we still need a higher level wrapper |
14:04:38 | FromGitter | <alehander42> https://github.com/nim-lang/needed-libraries/issues/3 |
14:05:44 | FromGitter | <kaushalmodi> leorize: I just added it here: https://github.com/nim-lang/Nim/pull/9388/files#diff-afcb89019b2e348ac1a95d3f024f3f97R93 |
14:05:58 | poopBot | oh, that sux, i thinked that something simple evry lang hes |
14:06:09 | FromGitter | <kaushalmodi> may be fullhelp should also call `nim help`; do you want to send PR for that? |
14:06:28 | poopBot | duno if i can create one by loking how other langs do it |
14:06:55 | FromGitter | <kaushalmodi> leorize: Also I wish `nim tasks` was a thing instead of `nim help` |
14:07:04 | FromGitter | <alehander42> the point is that we do have http lib, it's just not high level enough |
14:07:10 | poopBot | tought this isent high lvl library just parameter wraper to url |
14:07:51 | poopBot | or at least thats what i need atm :) |
14:08:06 | leorize | poopBot: what are you trying to do? I can't really read your English :P |
14:08:18 | leorize | kaushalmodi: ask Araq for that lol |
14:09:21 | FromGitter | <kaushalmodi> leorize: not asking you :) but as we were talking on this topic, I did not want to confuse this discussion with the poopBot discussion in parallel |
14:09:36 | poopBot | leorize, making kodi alternative for rpi3 , am sending get request to TVDB and need to send ?name=Game%20of%20Thrones |
14:10:03 | leorize | isn't that to be concat to the `url`? |
14:10:04 | poopBot | so i need name = Game of Thrones |
14:10:10 | poopBot | yep ofc |
14:10:48 | poopBot | i can manuly do it just asked cuz moste langs have params variable that goes with getReq |
14:11:25 | leorize | I don't think something that simple needs some thing like that... |
14:12:16 | leorize | but I could imagine building the string from a table |
14:12:22 | leorize | should be simple |
14:12:26 | poopBot | it is |
14:12:51 | poopBot | just need to find how to switch spaces with %20 |
14:13:14 | * | noonien joined #nim |
14:13:37 | FromGitter | <narimiran> strutils.replace? |
14:13:44 | leorize | poopBot: see `uri.encodeUri` |
14:13:53 | leorize | `uri.encodeUrl`* |
14:13:57 | poopBot | will try |
14:14:06 | poopBot | ty |
14:14:49 | poopBot | yep think thats what i need |
14:23:16 | * | craigger_ quit (Read error: Connection reset by peer) |
14:24:45 | * | craigger joined #nim |
14:29:57 | * | flaviu quit (Read error: Connection reset by peer) |
14:30:20 | * | flaviu joined #nim |
14:37:18 | * | flaviu quit (Ping timeout: 252 seconds) |
14:38:09 | * | flaviu joined #nim |
14:41:07 | * | YueWang joined #nim |
14:41:19 | * | YueWang quit (Client Quit) |
14:42:50 | * | sagax_ quit (Quit: Konversation terminated!) |
14:44:06 | * | craigger quit (Read error: Connection reset by peer) |
14:47:18 | * | craigger joined #nim |
14:52:00 | * | gangstacat quit (Quit: Ĝis!) |
14:55:27 | PMunch | With my local copy of the Nim repo, is it just to run "build_all.sh" and then use "choosenim <path to repo>" to have in choose that version? |
14:57:56 | copygirl | When using macros, how - if at all - should I deal with documentation comments? |
14:58:20 | PMunch | copygirl, what do you mean? |
14:58:22 | Araq | you shouldn't. the AST for this is still in the works |
14:58:34 | FromGitter | <alehander42> wow, so many request for this these days |
14:58:49 | Araq | yeah it always comes in waves |
14:58:53 | Araq | no idea why. |
14:58:55 | copygirl | I added doc comments to some "properties" and they don't appear in repr or similar, except for one which somehow sticks around. |
15:00:52 | copygirl | https://gist.github.com/copygirl/a22530d76eac5a98f9ca9d0324282af4 |
15:01:37 | copygirl | Output is from `echo repr(result)` in the macro that generates the code. |
15:04:25 | PMunch | Hmm, I'm unable to build devel atm |
15:04:56 | PMunch | http://ix.io/1pix |
15:05:07 | PMunch | Koch was built using current stable |
15:05:18 | * | narimiran joined #nim |
15:06:30 | Araq | PMunch: corrupted system.nim file? |
15:06:47 | PMunch | This is a fresh pull of the devel branc.. |
15:07:10 | PMunch | Trying "choosenim update devel" now |
15:08:40 | Araq | hmm travis is red too, I wonder what happened |
15:10:28 | * | gangstacat joined #nim |
15:12:50 | PMunch | Hmm, choosenim managed to do it somehow |
15:22:03 | * | kapil____ quit (Quit: Connection closed for inactivity) |
15:22:43 | * | shadowbane joined #nim |
15:23:06 | * | craigger_ joined #nim |
15:24:57 | * | craigger quit (Ping timeout: 252 seconds) |
15:25:51 | * | craigger joined #nim |
15:27:33 | * | craigger_ quit (Ping timeout: 244 seconds) |
15:29:50 | xace | https://github.com/dom96/choosenim/blob/master/scripts/choosenim-unix-init.sh#L28 # is there a reason linux_amd64 is not supported by choosenim.sh ? |
15:30:16 | xace | reason why* |
15:31:56 | leorize | xace: it doesn't look like that to me |
15:32:11 | leorize | it's more like nothing but those are supported |
15:33:03 | nolan_d | Is it possible to install a library such that any Nim code can use it without specifying it as a nimble dependency? |
15:33:19 | nolan_d | And yes I realize this is ugly, I'm just asking. |
15:33:29 | leorize | nolan_d: `nimble install`? |
15:33:39 | FromGitter | <kaushalmodi> nolan_d: you can set the path |
15:33:45 | xace | leorize: does that mean its safe to locally remove that test-case and force linux_amd64 to work witn choosenim.sh? |
15:34:22 | leorize | xace: that condition makes it work |
15:34:42 | leorize | that case statement reads |
15:35:00 | xace | leorize: oh, lol, reading the code again, linux_amd64 is fine, the the other case that results in a error... i should get some sleep... |
15:35:25 | FromGitter | <kaushalmodi> nolan_d: For example, if I have REPO/src/foo.nim and REPO/tests/tFoo.nim and I am doing `import foo` in tFoo.nim, I can add `--path:"../src/"` in REPO/tests/nim.cfg |
15:37:17 | FromGitter | <kaushalmodi> nolan_d: Or better.. `switch("path", "../src/")` in REPO/tests/config.nims |
15:37:49 | nolan_d | OK, that would work.And yes I realize this is ugly, I'm just asking. |
15:38:04 | nolan_d | Er, oopse, ignore that last bit. :) |
15:38:16 | leorize | if you like "bundling" then checkout Araq's "nawabs" |
15:38:26 | FromGitter | <kaushalmodi> It's actually not ugly.. how else would you make the tests less ugly? |
15:38:42 | FromGitter | <kaushalmodi> it's better to have simple `import foo` and let the path handling be done in the .nims |
15:53:29 | * | darithorn joined #nim |
16:01:58 | * | rokups quit (Quit: Connection closed for inactivity) |
16:04:44 | * | smt quit (Read error: Connection reset by peer) |
16:10:00 | * | floppydh quit (Quit: WeeChat 2.2) |
16:10:09 | * | Trustable joined #nim |
16:14:50 | * | smt joined #nim |
16:19:01 | * | nsf joined #nim |
16:19:21 | * | kapil____ joined #nim |
16:22:36 | * | SenasOzys joined #nim |
16:23:16 | * | SenasOzys quit (Remote host closed the connection) |
16:28:00 | * | Vladar quit (Remote host closed the connection) |
16:28:45 | * | chemist69 quit (Ping timeout: 250 seconds) |
16:29:10 | * | chemist69 joined #nim |
17:26:51 | krux02 | kaushalmodi: when do you implement dynamic scoping for Nim? :P |
17:28:30 | FromGitter | <kaushalmodi> krux02: ? |
17:28:46 | krux02 | didn't you write the if_let for nim? |
17:28:56 | krux02 | sorry out of context |
17:29:03 | krux02 | I just thought about it |
17:29:22 | FromGitter | <kaushalmodi> technically @Vindaar did, but `if-let` is lexically scoped |
17:29:37 | krux02 | in nim it is |
17:29:42 | krux02 | in emacs lisp you never know |
17:30:17 | FromGitter | <kaushalmodi> you know because you enable lexical bindings |
17:30:20 | FromGitter | <kaushalmodi> that's a norm now |
17:30:54 | FromGitter | <kaushalmodi> you enable that at the very top of your elisp files: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc6204e64cfc273f9d853c6] |
17:30:57 | krux02 | i think there is the file variable that you can set -*- lexical-binding: t -*- |
17:31:21 | FromGitter | <kaushalmodi> yes, slowly and gradually all emacs core files are getting this var set |
17:31:32 | krux02 | but even when that is enabled, I could use let in a dynamically scoped context |
17:31:34 | FromGitter | <kaushalmodi> once it is set everywhere and there are no complaints, the plan is to make that the default |
17:32:11 | FromGitter | <kaushalmodi> krux02: are you sure? i have seen many errors because of dynamic scoping in lexical binding enabled files |
17:33:00 | FromGitter | <kaushalmodi> krux02: ok, you have to go out of your way and declare global vars using `defvar`, `defconst` and such |
17:33:10 | FromGitter | <kaushalmodi> only those are allowed |
17:33:16 | krux02 | https://github.com/krux02/nim-mode/blob/sql-string-literal-highlighting/nim-syntax.el#L419 |
17:33:39 | FromGitter | <kaushalmodi> `case-fold-search` is a global var |
17:33:44 | FromGitter | <kaushalmodi> (what I said above) |
17:34:08 | krux02 | but with let it is not |
17:34:27 | krux02 | it is a local var case-fold-search that shadows the global var |
17:34:33 | krux02 | using dynamic scoping |
17:34:43 | FromGitter | <kaushalmodi> krux02: yes, correct |
17:34:51 | FromGitter | <kaushalmodi> then I am not clear on how that is dynamic scoping |
17:35:38 | krux02 | well, when everything would be lexically bound, a local scase-fold-search would not affect the call into search |
17:35:50 | krux02 | only a setq would affect it |
17:36:10 | FromGitter | <kaushalmodi> got it.. my introduction to lexical-binding is just emacs lisp :) |
17:36:28 | krux02 | mine, too |
17:36:32 | FromGitter | <kaushalmodi> so I thought that the `let` implementations are lexical binding |
17:36:38 | krux02 | but I do know static binding very well |
17:36:57 | krux02 | well I am not so sure what emacs lisp does |
17:37:36 | FromGitter | <kaushalmodi> see `C-h i g (elisp) Lexical Binding` |
17:37:45 | * | nsf quit (Quit: WeeChat 2.2) |
17:37:47 | krux02 | all I know is that I need to be careful how I name my local variables, because they can shadow by accident global variables |
17:38:05 | krux02 | even if lexical-binding is enabled |
17:38:32 | FromGitter | <kaushalmodi> " all I know is that I need to be careful how I name my local variables" hmm, yeah, I have always used that as a feature.. mistaken-shadowing has yet to happen in my use case |
17:38:46 | FromGitter | <kaushalmodi> for example, `case-fold-search` is a well-known global var |
17:39:06 | FromGitter | <kaushalmodi> the shadowing happening in that example is intended |
17:39:19 | krux02 | in that example, yes it is intended |
17:39:47 | krux02 | I still don't feel safe with local variable names |
17:40:19 | FromGitter | <kaushalmodi> the lexical binding enabled compilation is really helpful; look at the warnings (there must be 0) |
17:40:36 | FromGitter | <kaushalmodi> if you declare a lexically bound var in `let` and don't use it, you get a warn |
17:40:49 | FromGitter | <kaushalmodi> if you don't declare a lexically bound var, and try to use it, you get error |
17:41:00 | krux02 | that is not the point |
17:41:05 | FromGitter | <kaushalmodi> so there's very little room where you shadow something unintentionally |
17:41:46 | krux02 | the point is that I declare a local foo, assign (1 2 3) to it for whatever reason, use it, and then call into a function and it breaks because foo is a global variables that I was not aware of that I shadowed accidentally. |
17:41:46 | FromGitter | <kaushalmodi> well, in any case, look at http://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html |
17:42:10 | FromGitter | <kaushalmodi> "because foo is a global variables that I was not aware of that I shadowed accidentally" yes, I understood the problem you faced |
17:42:18 | FromGitter | <kaushalmodi> but I have yet to come across that |
17:42:22 | FromGitter | <kaushalmodi> what var was that? |
17:44:23 | FromGitter | <kaushalmodi> also related: https://www.gnu.org/software/emacs/manual/html_node/elisp/Default-Value.html |
17:44:37 | FromGitter | <kaushalmodi> `default-toplevel-value` |
17:46:17 | * | Sembei joined #nim |
17:46:32 | * | Pisuke quit (Ping timeout: 276 seconds) |
17:54:58 | * | stefanos82 quit (Quit: Quitting for now...) |
17:56:42 | krux02 | thanks for the info |
17:57:03 | * | krux02 quit (Quit: Leaving) |
18:16:21 | * | krux02 joined #nim |
18:26:03 | * | krux02_ joined #nim |
18:26:34 | Calinou | hmm, I have to use libraries from #head to fix clr build with Nim 0.19.0 |
18:26:43 | Calinou | I should ask for tagged releases, I guess :P |
18:26:52 | * | dddddd quit (Ping timeout: 246 seconds) |
18:27:00 | Calinou | I'll just use a commit hash for now |
18:28:39 | * | krux02 quit (Ping timeout: 252 seconds) |
18:36:03 | * | flyx quit (Quit: ZNC - http://znc.in) |
18:36:12 | * | dddddd joined #nim |
18:36:22 | * | flyx joined #nim |
18:42:03 | federico3 | please do |
18:52:16 | * | YueLi joined #nim |
18:57:25 | * | YueLi quit (Ping timeout: 256 seconds) |
19:02:03 | * | kapil____ quit (Quit: Connection closed for inactivity) |
19:25:30 | PMunch | Woop woop, 5 PRs now :) |
19:25:49 | federico3 | PMunch: ? |
19:26:33 | PMunch | federico3, for Hacktoberfest |
19:26:40 | PMunch | 5 PRs and you get a T-shirt :P |
19:28:12 | FromGitter | <kaushalmodi> can we have nested openarrays? |
19:28:31 | FromGitter | <kaushalmodi> example code: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc63bdebbdc0b25055078e7] |
19:28:49 | FromGitter | <kaushalmodi> the commented signature with `openArray[openArray[T]]` does not work |
19:30:04 | * | shadowbane quit (Read error: Connection reset by peer) |
19:30:35 | FromGitter | <kaushalmodi> `openArray[seq[T]]` works too |
19:31:25 | FromGitter | <kaushalmodi> OK, I got my answer: https://nim-lang.org/docs/tut1.html#advanced-types-open-arrays |
19:31:48 | * | shadowbane joined #nim |
20:17:06 | * | Trustable quit (Remote host closed the connection) |
20:26:29 | * | nsf joined #nim |
20:34:53 | poopBot | does "nimble build" build evry file with .nim in src or do i need to tell it explicitly |
20:36:50 | * | narimiran quit (Ping timeout: 276 seconds) |
20:37:25 | poopBot | building with --debug reveled my answer |
20:42:15 | * | zachk joined #nim |
20:44:15 | poopBot | hmm so if i create a modulB and i want to call it from modulA what i need to get autcomplite working |
20:45:01 | * | cozachk joined #nim |
20:45:33 | * | nsf quit (Quit: WeeChat 2.2) |
20:46:40 | * | cozachk quit (Read error: Connection reset by peer) |
20:47:03 | * | cozachk joined #nim |
20:47:13 | * | zachk quit (Ping timeout: 246 seconds) |
21:05:42 | poopBot | hmm i just restarted vscode and it worked |
21:11:14 | * | cozachk quit (Quit: Leaving) |
21:15:31 | * | zachk joined #nim |
21:16:23 | * | zachk quit (Changing host) |
21:16:23 | * | zachk joined #nim |
21:17:21 | * | chemist69 quit (Ping timeout: 250 seconds) |
21:18:23 | * | chemist69 joined #nim |
21:31:57 | * | craigger_ joined #nim |
21:32:58 | * | craigger quit (Ping timeout: 245 seconds) |
21:34:00 | * | rewadz quit (Ping timeout: 252 seconds) |
21:36:23 | * | craigger joined #nim |
21:38:23 | * | craigger_ quit (Ping timeout: 245 seconds) |
21:38:26 | * | craigger- joined #nim |
21:39:17 | * | Jesin quit (Quit: Leaving) |
21:41:11 | * | craigger quit (Ping timeout: 250 seconds) |
21:45:28 | * | craigger joined #nim |
21:46:57 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:48:46 | * | craigger- quit (Ping timeout: 272 seconds) |
21:58:39 | * | vlad1777d__ joined #nim |
22:08:09 | * | krux02_ quit (Remote host closed the connection) |
22:17:45 | poopBot | is it bad if i have request in rows for each request to create new HttpClient |
22:28:21 | FromGitter | <zacharycarter> huh? |
22:28:36 | FromGitter | <zacharycarter> poopBot: I don't understand your last question |
22:31:17 | poopBot | zacharycarter[m], hmm i asked if its bad practice to instatient a new httpClient for each request, if i have more then 1 request in row :) |
22:31:37 | poopBot | probbaly it is :) |
22:32:43 | Araq | iirc you *need* to inst one per request :-) |
22:32:54 | Araq | bad API, but I've complained about it before... |
22:33:11 | Araq | it also violates our guidelines |
22:34:02 | poopBot | sorry i dont get *need* was that ironic or i really need, am reading atm docs about it |
22:34:27 | * | craigger_ joined #nim |
22:34:50 | * | craigger quit (Ping timeout: 244 seconds) |
22:36:03 | FromGitter | <zacharycarter> I think you're right Araq / recalling correctly - I remember reading in a few places that asynchttp and long lived connections don't jive well atm |
22:36:43 | poopBot | ok then for now i will leave it like this |
22:37:23 | Araq | poopBot, no irony, you really need it |
22:43:55 | * | craigger joined #nim |
22:44:23 | * | craigger_ quit (Ping timeout: 268 seconds) |
22:47:32 | * | PMunch quit (Remote host closed the connection) |
22:53:57 | * | PrimHelios joined #nim |
22:54:07 | * | PrimHelios quit (Client Quit) |
23:09:13 | * | craigger_ joined #nim |
23:10:29 | * | craigger quit (Ping timeout: 244 seconds) |
23:21:00 | * | craigger joined #nim |
23:23:51 | * | craigger_ quit (Ping timeout: 268 seconds) |
23:35:31 | * | elrood quit (Quit: Leaving) |