00:01:59 | polkm | how to do "addr array[0]" but for seq instead? |
00:02:12 | * | TEttinger joined #nim |
00:02:34 | polkm | can I get the internal array of a seq? |
00:02:48 | flaviu | .eval echo(repr(addr((@[])[0]))) |
00:02:57 | * | brson quit (Quit: leaving) |
00:02:57 | polkm | like .c_ptr |
00:03:18 | * | brson joined #nim |
00:03:32 | polkm | what does repr do? |
00:04:47 | * | Mimbus joined #nim |
00:05:03 | flaviu | It prints things in a form where they are useful for debugging. |
00:05:24 | flaviu | .eval echo(repr(addr((@[])[0]))) |
00:05:25 | Mimbus | flaviu: eval.nim(3, 10) Error: expression has no address |
00:05:41 | flaviu | .eval var a: seq[int] = @[]; echo(repr(addr(a[0]))) |
00:05:44 | Mimbus | flaviu: Error: unhandled exception: index out of bounds [IndexError] |
00:06:13 | * | gsingh93 quit (Ping timeout: 248 seconds) |
00:06:16 | polkm | hmm, opengl doesn't like that |
00:06:59 | flaviu | .eval var a: seq[int] = @[1]; echo(repr(addr(a[0]))) |
00:07:00 | Mimbus | flaviu: ref 0x7f9463383060 --> 1 |
00:07:01 | flaviu | there we go. |
00:07:28 | flaviu | That's an address to an int, and 0x7f9463383060++ is the next element in the seq. |
00:07:45 | polkm | shit that should work |
00:07:51 | polkm | but it doesn't |
00:07:53 | polkm | one sec |
00:07:58 | flaviu | well, I suppose that ++ is only valid in C, and only for char* |
00:09:28 | polkm | does anythign in this look wrong? http://pastebin.com/AixiLhN9 |
00:10:33 | polkm | disregard, sizeof(seq) is borked or something |
00:11:14 | polkm | disregard, sizeof(seq) is borked or something, got it to work by replacing it with "sizeof(uint32).int32 * indices.len.int32" |
00:11:45 | polkm | oops |
00:13:06 | * | askatasuna joined #nim |
00:15:18 | polkm | is repr the same as $? |
00:17:34 | flaviu | No, totally different. |
00:17:35 | fowlmouth | polkm, i fixed it last night |
00:17:45 | fowlmouth | check my fork of nim-assimp |
00:18:04 | flaviu | .eval var a: seq[int] = @[1]; echo(a, ", ", repr(a[0])) |
00:18:06 | Mimbus | flaviu: @[1], 1 |
00:18:22 | flaviu | err, that was a bad example. |
00:19:05 | flaviu | .eval echo("asd", ", ", repr("asd")) |
00:19:06 | Mimbus | flaviu: asd, 0x43c970"asd" |
00:25:03 | * | brson quit (Quit: leaving) |
00:38:48 | * | gokr_ quit (Quit: IRC for Sailfish 0.9) |
00:41:04 | * | TEttinger quit (Ping timeout: 245 seconds) |
00:48:26 | * | BitPuffin quit (Ping timeout: 246 seconds) |
00:50:42 | * | HakanD quit (Quit: Be back later ...) |
01:11:36 | * | milosn quit (Ping timeout: 240 seconds) |
01:21:27 | * | endragor joined #nim |
01:43:45 | polkm | fowlmouth, thanks man thats super helpful! |
01:44:02 | polkm | flaviu, thanks too |
02:02:21 | * | drs- quit (Quit: leaving) |
02:19:10 | * | endragor quit (Remote host closed the connection) |
02:20:41 | * | darkf joined #nim |
02:25:29 | * | ChrisMAN quit (Ping timeout: 264 seconds) |
02:26:27 | * | EXetoC quit (Ping timeout: 246 seconds) |
02:29:05 | * | endragor joined #nim |
02:33:24 | * | endragor quit (Remote host closed the connection) |
02:33:59 | * | johnsoft quit (Ping timeout: 245 seconds) |
02:34:35 | * | johnsoft joined #nim |
02:45:03 | * | Senketsu joined #nim |
02:49:41 | * | endragor joined #nim |
02:52:47 | * | elbow_jason quit (Remote host closed the connection) |
02:53:09 | * | endragor quit (Remote host closed the connection) |
02:55:06 | * | elbow_jason joined #nim |
02:55:21 | * | TEttinger joined #nim |
02:56:32 | * | transfuturist joined #nim |
02:59:58 | * | saml_ quit (Remote host closed the connection) |
03:22:04 | * | endragor joined #nim |
03:29:29 | * | elbow_jason quit (Remote host closed the connection) |
03:37:05 | transfuturist | https://github.com/transfuturist/outlet |
03:38:14 | polkm | wow thats fucking dank |
03:40:54 | transfuturist | foretwennyblazblue |
03:51:02 | dtscode | omfg i love this |
03:53:45 | dtscode | i wonder how hard it would be to make this a compiler option... |
03:54:16 | transfuturist | that was my first tack, but it turned out swapping was already supported |
03:54:39 | dtscode | hotswapping is already supported in nim? |
03:54:44 | dtscode | like with -i? |
03:54:56 | transfuturist | no, with the dynlib package |
03:55:03 | transfuturist | this is a wrapper over that |
03:55:06 | transfuturist | http://forum.nim-lang.org/t/627/1#7038 |
03:55:21 | transfuturist | er, look at reactormonk's comment |
03:55:33 | dtscode | ah |
03:56:57 | dtscode | so its essentially dlopen for nim |
03:57:29 | transfuturist | yeah |
03:57:49 | transfuturist | concise definitions of apis that you statically link, and can unload and reload at will |
03:58:02 | transfuturist | like handmade hero |
03:58:05 | dtscode | hmmmm |
04:13:12 | reactormonk | transfuturist, you still need a parameter to exportc to denote the name you wanna export it as |
04:14:43 | transfuturist | it works without that, though... |
04:15:06 | transfuturist | would that maybe be part of the symbol conflict problem? |
04:17:00 | * | transfuturist crosses fingers |
04:17:54 | transfuturist | no, if the parameter to exportc is missing the exact identifier is what is exported |
04:20:05 | transfuturist | i need to make a test that breaks on the symbol conflict. |
04:56:18 | * | gsingh93 joined #nim |
05:12:27 | * | johnsoft quit (Ping timeout: 250 seconds) |
05:19:45 | * | dtscode is now known as squirtle |
05:22:08 | * | BlaXpirit joined #nim |
05:22:49 | * | squirtle is now known as dtsologist |
05:24:05 | * | dtsologist is now known as PaulMaudib |
05:29:11 | * | PaulMaudib is now known as EdwardElric |
05:34:13 | * | milosn joined #nim |
05:37:38 | * | Flaise quit (Quit: Leaving.) |
05:39:33 | * | askatasuna quit (Ping timeout: 248 seconds) |
05:40:10 | * | johnsoft joined #nim |
05:53:17 | * | a5i quit (Quit: Connection closed for inactivity) |
05:55:27 | * | Senketsu quit (Ping timeout: 276 seconds) |
06:04:04 | * | gokr_ joined #nim |
06:17:02 | * | TEttinger quit (Quit: Leaving) |
06:27:25 | * | gsingh93 quit (Ping timeout: 264 seconds) |
06:28:13 | * | zahary joined #nim |
06:39:44 | * | transfuturist quit (Quit: Zzzzz...) |
06:55:41 | * | Ven joined #nim |
07:05:20 | * | endragor_ joined #nim |
07:08:31 | * | endragor quit (Ping timeout: 255 seconds) |
07:15:09 | * | endragor_ quit (Remote host closed the connection) |
07:19:51 | * | Matthias247 joined #nim |
07:20:34 | * | TEttinger joined #nim |
07:33:03 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:36:13 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
07:36:54 | * | Ven joined #nim |
07:36:54 | * | Ven quit (Client Quit) |
07:46:33 | * | Matthias247 quit (Read error: Connection reset by peer) |
07:50:52 | * | Ven joined #nim |
08:08:00 | * | coffeepot joined #nim |
08:11:32 | * | HakanD joined #nim |
08:15:13 | * | endragor joined #nim |
08:24:23 | * | HakanD quit (Quit: Be back later ...) |
08:28:06 | * | zahary quit (Read error: Connection reset by peer) |
08:38:16 | * | Ven quit (Read error: Connection reset by peer) |
08:38:33 | * | Ven joined #nim |
08:39:42 | * | bjz joined #nim |
08:41:23 | * | bjz quit (Client Quit) |
08:43:23 | * | bjz joined #nim |
08:44:27 | * | HakanD joined #nim |
08:46:04 | * | OnO joined #nim |
08:47:09 | * | akiradeveloper joined #nim |
08:48:13 | coffeepot | Good morning everyone :) |
08:48:22 | BlaXpirit | hi |
08:51:13 | * | HakanD quit (Quit: Be back later ...) |
08:52:50 | * | bjz quit (Ping timeout: 246 seconds) |
08:58:52 | coffeepot | when using var s:cstring do I need to call new(s) on it? |
09:00:03 | coffeepot | also, not sure how I allocate a fixed length cstring if anyone knows? |
09:00:31 | BlaXpirit | coffeepot, why not use var s: string |
09:00:50 | * | milosn quit (Ping timeout: 272 seconds) |
09:01:28 | coffeepot | I'm not sure I can, trying to call a c func that takes PSQLCHAR, which is a cstring |
09:01:42 | coffeepot | the function writes to the string as a buffer |
09:02:17 | BlaXpirit | coffeepot, i dunno, maybe it should be array of char |
09:03:15 | coffeepot | I thought the same, but not sure if I can just cast a char array to a cstring safely |
09:03:23 | fowlmouth | coffeepot, you can use string |
09:03:45 | coffeepot | I can? That's great :D |
09:05:48 | coffeepot | ahhh I know where I was going wrong! Declaring a string (or a cstring) doesn't initialise it, so it starts off as nil until I put = "" :) |
09:05:59 | coffeepot | lesson learned :) |
09:06:34 | * | pafmaf joined #nim |
09:06:42 | fowlmouth | coffeepot, you want newStringOfCap() |
09:07:00 | coffeepot | fowlmouth: brilliant, just what I need, cheers :) |
09:11:54 | * | HakanD joined #nim |
09:18:17 | * | bjz joined #nim |
09:20:49 | * | Ven quit (Ping timeout: 264 seconds) |
09:23:49 | * | pafmaf quit (Ping timeout: 264 seconds) |
09:30:06 | * | TEttinger quit (Ping timeout: 250 seconds) |
09:43:32 | * | TEttinger joined #nim |
09:50:49 | * | EXetoC joined #nim |
09:51:57 | * | pafmaf joined #nim |
09:56:16 | * | EdwardElric is now known as dtscode |
09:56:49 | * | milosn joined #nim |
09:57:50 | * | milosn quit (Read error: Connection reset by peer) |
10:01:54 | * | milosn joined #nim |
10:02:53 | * | akiradeveloper quit (Remote host closed the connection) |
10:02:58 | * | Tennis joined #nim |
10:07:44 | * | gokr_ quit (Ping timeout: 245 seconds) |
10:08:35 | * | milosn quit (Read error: Connection reset by peer) |
10:09:08 | * | milosn joined #nim |
10:11:46 | * | polkm quit (Ping timeout: 246 seconds) |
10:14:08 | * | milosn quit (Ping timeout: 245 seconds) |
10:17:02 | * | BitPuffin joined #nim |
10:25:57 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
10:28:33 | * | coffeepot joined #nim |
10:29:09 | * | milosn joined #nim |
10:32:56 | * | milosn quit (Read error: Connection reset by peer) |
10:34:08 | * | milosn joined #nim |
10:49:01 | * | milosn quit (Read error: Connection reset by peer) |
10:49:33 | * | milosn joined #nim |
10:51:16 | * | pafmaf quit (Quit: This computer has gone to sleep) |
10:57:13 | * | akiradeveloper joined #nim |
10:57:22 | * | milosn quit (Ping timeout: 272 seconds) |
10:58:31 | * | akiradeveloper quit (Remote host closed the connection) |
11:01:40 | * | akiradeveloper joined #nim |
11:10:30 | * | Kingsquee quit (Quit: Konversation terminated!) |
11:11:17 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
11:15:07 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
11:15:20 | * | BitPuffin quit (Ping timeout: 265 seconds) |
11:15:44 | * | milosn joined #nim |
11:19:04 | * | OnO joined #nim |
11:25:32 | * | Ven joined #nim |
11:27:35 | * | milosn quit (Read error: Connection reset by peer) |
11:28:33 | * | milosn joined #nim |
11:31:17 | * | TEttinger quit (Ping timeout: 265 seconds) |
11:34:57 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
11:35:31 | * | pafmaf joined #nim |
11:36:45 | * | a5i joined #nim |
11:40:50 | * | milosn quit (Ping timeout: 246 seconds) |
11:58:24 | * | akiradeveloper quit (Remote host closed the connection) |
12:01:46 | * | akiradeveloper joined #nim |
12:06:52 | * | akiradev_ joined #nim |
12:06:56 | * | HakanD quit (Quit: Be back later ...) |
12:10:11 | * | akiradeveloper quit (Ping timeout: 250 seconds) |
12:10:39 | * | milosn joined #nim |
12:11:52 | * | HakanD joined #nim |
12:22:05 | * | akiradev_ quit (Ping timeout: 244 seconds) |
12:25:29 | endragor | is it possible to get size (length) of a Slice? |
12:25:41 | endragor | in generic way |
12:27:29 | endragor | `ord(s.b) - ord(s.a) + 1` I guess |
12:28:04 | * | BitPuffin joined #nim |
12:29:09 | * | itPuffinB joined #nim |
12:30:17 | * | tPuffinBi joined #nim |
12:32:03 | * | PuffinBit joined #nim |
12:32:28 | * | BitPuffin quit (Ping timeout: 245 seconds) |
12:32:57 | * | uffinBitP joined #nim |
12:33:18 | * | itPuffinB quit (Ping timeout: 245 seconds) |
12:33:43 | * | ffinBitPu joined #nim |
12:34:33 | * | tPuffinBi quit (Ping timeout: 245 seconds) |
12:34:45 | * | finBitPuf joined #nim |
12:36:38 | * | PuffinBit quit (Ping timeout: 245 seconds) |
12:37:19 | * | uffinBitP quit (Ping timeout: 245 seconds) |
12:37:44 | * | ffinBitPu quit (Ping timeout: 245 seconds) |
12:38:28 | * | milosn quit (Read error: Connection reset by peer) |
12:39:35 | * | milosn joined #nim |
12:43:34 | * | inBitPuff joined #nim |
12:44:16 | * | nBitPuffi joined #nim |
12:45:19 | * | BitPuffin joined #nim |
12:45:28 | * | milosn quit (Read error: Connection reset by peer) |
12:46:00 | * | itPuffinB joined #nim |
12:46:29 | * | finBitPuf quit (Ping timeout: 245 seconds) |
12:47:39 | * | uffinBitP joined #nim |
12:47:44 | * | inBitPuff quit (Ping timeout: 245 seconds) |
12:48:34 | * | nBitPuffi quit (Ping timeout: 245 seconds) |
12:49:49 | * | BitPuffin quit (Ping timeout: 245 seconds) |
12:50:14 | * | itPuffinB quit (Ping timeout: 245 seconds) |
12:51:54 | * | uffinBitP quit (Ping timeout: 245 seconds) |
12:53:30 | * | HakanD quit (Quit: Be back later ...) |
12:54:02 | * | milosn joined #nim |
12:56:12 | * | mpthrapp joined #nim |
13:03:57 | * | OnO joined #nim |
13:05:28 | * | milosn quit (Ping timeout: 250 seconds) |
13:05:57 | * | coffeepot joined #nim |
13:07:31 | * | OnO quit (Client Quit) |
13:14:02 | * | milosn joined #nim |
13:26:19 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:28:43 | * | BitPuffin joined #nim |
13:35:14 | * | Ven joined #nim |
13:36:58 | * | milosn quit (Ping timeout: 272 seconds) |
13:45:30 | * | milosn joined #nim |
13:51:20 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:58:24 | * | pregressive joined #nim |
13:58:53 | * | Ven joined #nim |
14:03:29 | * | gallicrooster joined #nim |
14:04:31 | * | flaviu quit (Read error: Connection reset by peer) |
14:07:53 | * | gallicrooster quit (Ping timeout: 245 seconds) |
14:15:23 | * | milosn quit (Ping timeout: 245 seconds) |
14:28:42 | * | Flaise joined #nim |
14:31:06 | Araq | hi Flaise welcome |
14:31:11 | * | darkf quit (Quit: Leaving) |
14:35:51 | * | flaviu joined #nim |
14:37:49 | Flaise | Hi |
14:42:06 | * | flaviu quit (Remote host closed the connection) |
14:51:04 | * | OnO joined #nim |
14:51:49 | * | bcinman joined #nim |
14:54:57 | * | OnO quit (Client Quit) |
15:05:27 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:06:12 | * | dewdrop joined #nim |
15:11:09 | coffeepot | I have a weird problem, I wonder if anyone can enlighten me. I have a string defined thus: sqlState = newStringOfCap(6) and I'm calling a C function that's passed this sqlState str directly. The function populates it with a string, and if I echo sqlState I get what I expect. What I can't work out though, is if I do: echo "test " & sqlState it disp |
15:11:09 | coffeepot | lays "test " but only the first letter of sqlState! Doing echo sqlState displays it normally. I can't give a short example of this unfortunately :-/ |
15:12:16 | coffeepot | just wondering if anyone's encountered this before. |
15:12:17 | fowlmouth | what c function |
15:12:24 | Araq | coffeepot: it's simple |
15:12:38 | Araq | newStringOfCap() gives you effectively a buffer to work with |
15:12:38 | coffeepot | the c fun is SQLGetDiagRec |
15:12:55 | Araq | however, C stores something in there and then a \0 |
15:12:59 | fowlmouth | the character after the ' ' is '\0' but the strings length is off |
15:12:59 | Araq | now |
15:13:20 | Araq | echo prints up to the \0 due to a hard to fix bug |
15:13:35 | Araq | but & reads the string's length |
15:13:37 | fowlmouth | SQLSMALLINT * TextLengthPtr |
15:13:43 | Araq | which you didn't set at all |
15:14:00 | coffeepot | ahhhhhhh!!! Thanks Araq that makes sense :) |
15:14:06 | Araq | you need to call mybuffer.setLen(whatever) |
15:14:07 | fowlmouth | use that to set the str len after the call |
15:15:01 | coffeepot | also cheers fowlmouth :) |
15:18:17 | * | pafmaf quit (Quit: This computer has gone to sleep) |
15:19:55 | * | endragor_ joined #nim |
15:21:26 | * | pregress_ joined #nim |
15:22:57 | * | pidg joined #nim |
15:24:02 | * | milosn joined #nim |
15:24:02 | pidg | hello. In https://github.com/Araq/Nim/issues/2361, Araq says 'You cannot capture openArray/varargs or 'var T' as that would violate memory safety.' What does he mean by 'capture' there? I struck out when googling. |
15:24:12 | * | endragor quit (Ping timeout: 276 seconds) |
15:24:18 | * | pregressive quit (Ping timeout: 264 seconds) |
15:24:25 | * | endragor_ quit (Ping timeout: 264 seconds) |
15:24:38 | Araq | pidg: |
15:24:56 | Araq | proc outer(toCapture: var int): auto = |
15:25:09 | Araq | return proc (): int = toCapture |
15:25:20 | * | gmpreussner quit (Quit: Konversation terminated!) |
15:25:41 | Araq | if an inner proc accesses stuff in an outer scope that process is called "capturing" |
15:25:59 | pidg | ah. As in a closure? |
15:26:04 | Araq | exactly |
15:26:12 | pidg | gonna stare at that for a sec, pretty sure that clears it up. |
15:26:13 | pidg | thanks |
15:27:09 | * | brson joined #nim |
15:27:53 | Araq | pidg: maybe the literature uses a different verb, I cannot remember ;-) |
15:30:43 | pidg | I'm new to nim, so it wasn't obvious to me that 'xs' was being accessed in a block that was closed over. I'm not sure about terminology of closures either, just know the word 'closure' :) Thanks for the response |
15:32:14 | * | untitaker quit (Ping timeout: 272 seconds) |
15:32:31 | * | ChrisMAN joined #nim |
15:32:41 | * | untitaker joined #nim |
15:33:59 | Araq | pidg: the workaround is trivial of course, copy it into a local variable and capture that instead |
15:34:08 | fowlmouth | let xs = @xs |
15:34:28 | Araq | or use 'ptr' if you need to write to it (but ensure it lives long enough!) |
15:35:17 | * | elbow_jason joined #nim |
15:37:30 | pidg | araq, fowlmouth: got it. |
15:38:08 | * | jefus joined #nim |
15:39:42 | * | HakanD joined #nim |
15:43:09 | * | HakanD_ joined #nim |
15:47:00 | * | Ven joined #nim |
15:47:36 | * | HakanD quit (Ping timeout: 276 seconds) |
15:52:08 | * | pregress_ quit (Remote host closed the connection) |
15:54:33 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:56:27 | * | pidg quit (Quit: Page closed) |
16:01:28 | renesac | has someone wrote something using non-copying slices in nim yet? |
16:01:41 | * | pafmaf joined #nim |
16:01:55 | EXetoC | https://github.com/AdrianV/nimrod-tools/blob/master/seqslices.nim |
16:02:08 | renesac | I'm needing that now (started using an extra "offset" parameter, but then caugth myself using seq.len) |
16:02:22 | renesac | thanks |
16:02:38 | EXetoC | oh yeah that's really old |
16:04:36 | * | johnsoft quit (Ping timeout: 240 seconds) |
16:04:43 | * | brson quit (Quit: leaving) |
16:07:01 | * | brson joined #nim |
16:22:41 | * | coffeepot left #nim (#nim) |
16:30:44 | * | Matthias247 joined #nim |
16:36:10 | renesac | nimfix gives this error when I try to compile it: |
16:36:14 | renesac | compiler/commands.nim(58, 15) Error: cannot open 'doc/basicopt.txt' |
16:48:20 | fowlmouth | this is cool https://github.com/transfuturist/outlet im going to try using it in a project |
16:54:46 | * | pafmaf quit (Quit: This computer has gone to sleep) |
16:56:29 | * | pregressive joined #nim |
17:05:39 | * | BlaXpirit_ joined #nim |
17:08:20 | * | BlaXpirit quit (Ping timeout: 252 seconds) |
17:16:24 | * | irrequietus joined #nim |
17:18:43 | * | TEttinger joined #nim |
17:20:51 | * | dtscode is now known as csaw_ |
17:21:14 | * | csaw_ is now known as dtscode |
17:21:48 | * | dtscode is now known as csaw |
17:21:55 | * | csaw is now known as cSaw |
17:22:31 | * | cSaw is now known as dtscode |
17:30:04 | * | Arrrrr joined #nim |
17:32:04 | Arrrrr | Hello Nimrod. |
17:33:18 | * | a5i quit (Quit: Connection closed for inactivity) |
17:34:24 | Arrrrr | Is there a friendlier way to handle ptr creation than 'cast[ptr ObType](alloc(sizeOf(ObType)))' ? |
17:35:21 | BlaXpirit_ | stop with the rods :| |
17:35:48 | BlaXpirit_ | Arrrrr, what are you doing? |
17:35:49 | * | dewdrop quit (Read error: Connection reset by peer) |
17:36:15 | Arrrrr | Nothing, just playing with pointers. I have nothing i nmind. |
17:36:29 | BlaXpirit_ | well u dont need pointers, unless you really do |
17:36:50 | Arrrrr | So, when i do, i have no alternative than 'castlongsentence' ? |
17:36:58 | BlaXpirit_ | let me check one more thing |
17:37:17 | Arrrrr | I var you check that thing. |
17:38:12 | BlaXpirit_ | Arrrrr, so... the friendlier way is to use `addr` |
17:38:56 | BlaXpirit_ | create whatever you want normally, then take its address |
17:39:12 | BlaXpirit_ | unless you're absolutely sure you need to allocate like this. i never needed it. |
17:39:31 | Araq | Arrrrr: there is also system.create and stuff |
17:40:10 | Araq | and even if not, a nice syntax is usually a template away in Nim |
17:41:00 | * | gallicrooster joined #nim |
17:42:05 | Arrrrr | Oh god, that create makes a difference, thanks Araq. So, create is the 'new' for ptr. |
17:42:44 | Arrrrr | One day i'll learn templating, but not yet. |
17:44:01 | * | a5i joined #nim |
17:45:16 | * | gallicrooster quit (Ping timeout: 240 seconds) |
17:48:32 | * | dewdrop joined #nim |
18:02:40 | renesac | and if I try to run nimfix with --styleCheck:auto it gives: |
18:02:42 | renesac | Error: system module needs 'shared' |
18:02:53 | renesac | (after I disabled that line complaining above |
18:03:59 | Araq | renesac: don't install nim, compile like it like we tell you to do it |
18:04:11 | Araq | and then nimfix builds and should work |
18:04:26 | renesac | ? |
18:04:33 | * | Trustable joined #nim |
18:04:41 | renesac | I recompiled nim from the last git devel |
18:04:58 | renesac | the Nim/bin directory is on path |
18:05:04 | renesac | and I dropped nimfix there too |
18:05:21 | renesac | as the nimfix user guide says to |
18:08:23 | Araq | well but the error makes no sense |
18:08:38 | Araq | system module doesn't need 'shared' anymore |
18:10:51 | renesac | nimfix -v |
18:10:51 | renesac | Nim Compiler Version 0.10.3 (2015-04-17) [Linux: amd64] |
18:11:11 | renesac | I don't know what is happening |
18:12:13 | BlaXpirit_ | in any uncertain situation: start from scratch |
18:12:23 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
18:12:39 | Araq | what does nimfix say about its search path? |
18:12:41 | * | BlaXpirit joined #nim |
18:23:08 | * | filwit joined #nim |
18:24:05 | * | gsingh93 joined #nim |
18:25:21 | * | HakanD_ quit (Quit: Be back later ...) |
18:25:54 | filwit | dom96: any chance you can review and merge my Aporia PR soon? It's been ready for awhile and improves/fixes quite a few things. |
18:26:09 | * | OnO_ joined #nim |
18:30:48 | * | zama quit (Ping timeout: 245 seconds) |
18:39:12 | Arrrrr | I think every type by default should overload toString ('$'), maybe behave as repr. |
18:39:49 | * | smelod joined #nim |
18:40:11 | EXetoC | Arrrrr: it is available for all values types |
18:40:29 | Arrrrr | $ ? |
18:40:35 | EXetoC | yep |
18:41:27 | EXetoC | .eval type T = object; x: int; y: int; echo T() |
18:41:30 | Mimbus | EXetoC: (x: 0, y: 0) |
18:42:08 | Arrrrr | You are right, i dont know how i missed that. Maybe i tried with a ref |
18:42:28 | Arrrrr | yes, it was that. |
18:43:25 | Arrrrr | Why doesn't work in this case? |
18:43:31 | * | zama joined #nim |
18:44:54 | Arrrrr | (unless you deference it, which most of the times is what you want anyway) |
18:47:26 | EXetoC | because the tuple|object doesn't take pointer/refs of tuples/objects |
18:48:22 | Arrrrr | wut |
18:49:57 | EXetoC | "proc `$`*[T: tuple|object]..." and then some other overloads, none of which accepts refs |
18:51:17 | Arrrrr | Ah, ok. Thanks for your explanations EXetoC. Would not be possible to add one overload for refs/ptr ? In case is null, just echo type+[null], in other case deference it and call return $ |
18:52:09 | Arrrrr | (by echo i mean return) |
18:52:49 | EXetoC | it's possible |
18:53:22 | * | HakanD_ joined #nim |
18:54:33 | Arrrrr | And desirable, in my opinion. |
18:55:02 | * | OnO_ quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
19:01:04 | * | OnO joined #nim |
19:09:52 | Araq | OnO: tests/parser has a couple of tests including tests that should fail with a particular error message |
19:12:15 | OnO | this with discard """ ? |
19:13:55 | OnO | tester checks this discard header or #ERROR_MSG comment? |
19:14:06 | * | HakanD_ quit (Quit: Be back later ...) |
19:14:10 | Araq | the discard header |
19:14:23 | Araq | the #ERROR_MSG comment is obsolete |
19:14:34 | Araq | (it used to be parsed) |
19:15:35 | * | HakanD_ joined #nim |
19:16:01 | * | irrequietus_ joined #nim |
19:17:04 | * | irrequietus quit (Ping timeout: 272 seconds) |
19:17:11 | * | irrequietus_ is now known as irrequietus |
19:17:16 | * | irrequietus quit (Client Quit) |
19:17:28 | * | irrequietus joined #nim |
19:20:13 | * | HakanD_ quit (Ping timeout: 264 seconds) |
19:20:51 | * | alex99 joined #nim |
19:21:50 | alex99 | I see bug reports about nim traits and concepts and there were some forum posts about type classes |
19:22:02 | alex99 | where I can read more about traits/concepts/typeclasses? |
19:22:12 | alex99 | there doesn't seem to be anything in official docs |
19:23:06 | Araq | there are some docs in devel, but yes, very sparse |
19:24:46 | alex99 | oh i see, in doc/manual/generics.txt |
19:24:58 | * | KimSchmitz joined #nim |
19:25:48 | KimSchmitz | how would I go about debugging my nim proggie with linux? |
19:27:31 | Araq | use one of the various GDB frontends and compile with --debugger:native |
19:28:17 | Araq | (--debugger:native is new in devel, for 0.10.2 use --linedir:on --debuginfo) |
19:28:45 | * | HakanD_ joined #nim |
19:34:13 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
19:34:57 | KimSchmitz | thanks araq, I am still on arch linux included 10.2 .. |
19:35:16 | KimSchmitz | 0.10.2 |
19:36:05 | * | filcuc joined #nim |
19:37:32 | Arrrrr | I have to go, see you nimroders. |
19:37:36 | * | Arrrrr quit (Quit: Page closed) |
19:39:14 | * | Matthias247 quit (Read error: Connection reset by peer) |
19:42:56 | saml | does context aware macro make sense? |
19:43:18 | saml | macro expands different depending on context |
19:43:21 | Araq | saml: depends on what you mean by "context" |
19:43:46 | Araq | in general: yes it does. see overloading resolution. ;-) |
19:44:19 | saml | let's say i want to implement malloc() as macro so that it knows about copying of ownership.. frees automatically when it goes out of scope and no copy of ownership has been there |
19:45:00 | saml | http://nim-lang.org/manual.html#overloading-resolution To be written |
19:47:26 | Araq | pfff documented in devel :P |
19:48:07 | Araq | saml: I doubt you can implement that as a macro |
19:48:44 | Araq | "no copy of ownership has been there" ... so you want an escape analysis. not possible as a macro. |
19:49:03 | saml | yah. just wondering instead of baking those stuff into language, what would it look like if language provided a programmable way |
19:49:41 | saml | so the core of language is simple.. but stdlib can include all niffy malloc ...e tc |
19:54:10 | * | KimSchmitz quit (Ping timeout: 246 seconds) |
19:56:24 | * | OnO joined #nim |
19:56:48 | Araq | saml: it's not feasible to make complex analyses like that "programmable", Nim actually goes a long way to this goal via its TR macros |
19:57:43 | Araq | but there is a point where it breaks down |
19:57:57 | saml | what's tr macro? |
19:58:10 | Araq | a term rewriting macro |
19:58:40 | saml | maybe better approach is to have programmer write some sort of proof. and compiler checks program against the proof |
19:58:54 | Araq | er ... that's even worse ;-) |
19:59:09 | saml | or just use garbaeg collector :P |
19:59:47 | Araq | well thinking about it ... TR macros with builtin "escapes/doesntEscape" constraints could be cool |
20:00:32 | Araq | template optMalloc{malloc(a, b, c)](a, b, c: expr{doesntEscape}) = ... |
20:01:06 | EXetoC | are there any TR examples that focus on functionality rather than optimizations? |
20:02:39 | Araq | no, their design actively tries to prevent this |
20:02:53 | Araq | a TR macro should not affect semantics |
20:06:43 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
20:16:02 | * | jefus quit (Remote host closed the connection) |
20:20:15 | * | Senketsu joined #nim |
20:20:29 | Senketsu | ou shit beer stream already started |
20:20:59 | Senketsu | oh wrong channel hue |
20:21:10 | Araq | no |
20:21:20 | Araq | tell us about the beer ;-) |
20:27:14 | * | johnsoft joined #nim |
20:27:23 | Senketsu | umm, like what ? its a music stream..with a drunk dj and beer opening intermissions |
20:37:37 | * | smelod quit (Remote host closed the connection) |
20:49:33 | * | gsingh93 quit (Ping timeout: 245 seconds) |
20:58:07 | * | JStoker quit (Killed (holmes.freenode.net (Nickname regained by services))) |
20:58:29 | * | JStoker joined #nim |
21:00:03 | * | Kingsquee joined #nim |
21:02:21 | * | mpthrapp quit (Remote host closed the connection) |
21:07:32 | * | filcuc quit (Ping timeout: 244 seconds) |
21:07:48 | * | filcuc joined #nim |
21:10:01 | * | MightyJoe quit (Ping timeout: 264 seconds) |
21:10:33 | * | MightyJoe joined #nim |
21:16:20 | * | filwit quit (Quit: Leaving) |
21:18:20 | * | johnsoft quit (Ping timeout: 246 seconds) |
21:18:40 | * | gallicrooster joined #nim |
21:19:18 | * | johnsoft joined #nim |
21:22:53 | * | gallicrooster quit (Ping timeout: 245 seconds) |
21:23:48 | * | gsingh93 joined #nim |
21:27:16 | * | HakanD_ quit (Quit: Be back later ...) |
21:57:29 | * | irrequietus_ joined #nim |
21:58:34 | * | irrequietus quit (Ping timeout: 272 seconds) |
22:10:20 | * | saml quit (Quit: Leaving) |
22:10:36 | * | Trustable quit (Remote host closed the connection) |
22:22:03 | * | ChrisMAN quit (Ping timeout: 245 seconds) |
22:23:15 | * | pregressive quit () |
22:32:18 | * | ChrisMAN joined #nim |
22:35:44 | * | irrequietus_ quit () |
22:50:56 | * | jefus joined #nim |
23:08:04 | * | gallicrooster joined #nim |
23:12:05 | * | gallicrooster quit (Ping timeout: 246 seconds) |
23:44:43 | * | brson quit (Quit: leaving) |