00:08:42 | dom96 | nimble package@#git-tag |
00:10:56 | FromGitter | <rayman22201> bleh. thanks @dom96. I have fat fingers today |
00:15:42 | * | stefantalpalaru quit (Quit: Leaving) |
00:21:10 | FromGitter | <mratsim> @alehander42 @Araq seems like I will have to abandon this `ptr ref` idea, just after attaching the ptr ref to an object field, I can repr it properly. Then after `let foo = newObjWithPtrRef` I can repr foo properly. But then when I pass it to another function, the `ptr ref` field will SIGSEGV, other fields are fine. |
00:22:47 | FromGitter | <mratsim> casting to ByteAddress, the memory address didn’t change |
00:23:25 | FromGitter | <mratsim> so I think you cannot keep a ptr to a ref. Too tired for a repro |
00:26:12 | xace | var p = startProcess("w3m"); write(p.inStream, "Hello world") # results in p.inStream is a indecleared field... What am I doing wrong? |
00:28:41 | * | rayman22201 joined #nim |
00:30:42 | xace | hmm i was suppose to call inputStream() it seems |
00:38:44 | dom96 | mratsim: used gc_ref? |
00:42:10 | * | Tyresc quit (Quit: WeeChat 2.3-dev) |
00:45:55 | * | krux02 quit (Remote host closed the connection) |
00:46:20 | * | krux02 joined #nim |
00:50:37 | * | PrimHelios quit (Quit: Leaving) |
00:56:25 | xace | var p = startProcess("w3m"); write(p.inputStream, "Hello world"); flush(p.inputStream) # isn't this enough to write to stdin of another process? |
01:17:07 | xace | https://pastebin.com/raw/46vuZ3yL # I cant figure out why w3m isn't printing my output, does anyone see what I am doing wrong? |
01:38:01 | * | krux02 quit (Remote host closed the connection) |
01:42:47 | shashlick | what's the issue |
01:43:23 | xace | shashlick: w3m doesn't seem to get the text im trying to write to it, same goes for echo... i cant seem to figure out how to pipe my text into another process |
01:44:00 | xace | echo Hello world | w3m -T text/html -dump # works fine |
01:46:30 | shashlick | line endings perhaps |
01:46:45 | shashlick | works for me in ff - https://github.com/genotrance/ff/blob/master/ff.nim#L72 |
01:47:36 | xace | shashlick: same problem with writeLine() |
01:48:53 | shashlick | so this is the basic problem with pipes - w3m doesn't know when the input is done |
01:49:05 | shashlick | so it is still waiting for input since there's no EOF sent yet |
01:49:07 | xace | can I signal it somehow? |
01:49:24 | shashlick | EOF = pipe being closed so unless you close it |
01:49:32 | shashlick | i don't think closing the input stream will work, you can stry |
01:50:32 | shashlick | i guess you can try close() and see if that tips w3m that input is done |
01:51:34 | xace | still the same problem |
01:52:12 | shashlick | close output stream also - which of course means you can read back from it - but at least test |
01:52:39 | shashlick | actually I don't think it will work |
01:52:59 | shashlick | reason it works in ff is because i write to input and just sit there in the while loop |
01:53:25 | shashlick | once the child process exits (fzf which is interactive and manually exited), then ff continues |
01:53:57 | shashlick | so either you quit the spawning proc or something - no good answer but i remember researching it for a while and giving up |
01:54:07 | xace | shashlick: this worked: closing input stream, and reading output before waitforexit |
01:57:51 | shashlick | that's good |
01:58:10 | xace | Thank you :) |
02:01:34 | * | lukd quit (Quit: WeeChat 2.3) |
02:03:08 | * | abm quit (Read error: Connection reset by peer) |
02:07:40 | * | ng0_ joined #nim |
02:10:43 | * | ng0 quit (Ping timeout: 256 seconds) |
02:30:07 | * | zachk quit (Quit: Leaving) |
02:33:50 | FromGitter | <xmonader> @shashlick I checked it, interesting, would be awesome to carry along the DLLs. ⏎ I'm more familiar with go-bindata workflow |
02:34:04 | FromGitter | <xmonader> @kaushalmodi is there any chance to get nimdoc for `zeal` too? |
02:41:45 | xace | do we have a way to see if a string contains one of the strings in a seq[string] or do i have to make my own with sequtils.any() ? |
02:45:32 | * | kapil____ joined #nim |
02:48:24 | leorize | xace: you'd have to make your own with `any()`, not too hard actually |
02:48:59 | xace | leorize: yeah i did but it looked like the apocalypse |
02:49:52 | leorize | ? it should just be: `seqOStr.anyIt(it in str)` |
02:51:09 | xace | leorize: behold this monstrosity: if any(query, proc (x: string): bool = return e.name.contains(x)): |
02:51:43 | leorize | use `anyIt`, it's designed for this kind of thing |
02:51:58 | xace | yeah i find yours much mode readable |
02:54:27 | leorize | for `any()`, there's also the `sugar` module which would let you do this: `any(query, (x: string) => e.name.contains x)` |
02:54:49 | leorize | well, but `anyIt` is way faster :P |
02:55:17 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c131b95ca317a0e25c35398] |
02:55:36 | xace | yeah, would it have worked if i also did `seqOStr.anyIt(it contains str)` ? |
02:55:44 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c131bb0539aca60b2083dc1] |
02:55:58 | xace | or is `contains` different from `in` |
02:56:48 | leorize | `in` is an operator and `contains` is a proc |
02:56:53 | leorize | so yes, they're different |
02:57:09 | xace | alright, ill keep that in mind |
02:57:21 | FromGitter | <gogolxdong> What's wrong with this code? |
02:57:54 | leorize | xace: to implement the `in` operator, you implement `contains()` :P |
02:58:05 | leorize | so in a way it's the same thing |
02:58:22 | xace | leorize: yeah i wasnt aware of nim having a `in` operator... i like these fancy toys |
02:58:54 | leorize | gogolxdong: have you initialized the table? |
03:00:05 | FromGitter | <gogolxdong> oh, my bad |
03:02:41 | xace | does nim have a way to suspend terminal output? atm my program is printing a lot of things and it would be faster if it didnt wait for stdout.write() |
03:03:12 | xace | otherwise im considering just appending the output to a seq[string] and printing them at the end |
03:03:23 | leorize | the UNIX™ way: `./stuff` >/dev/null :P |
03:03:40 | xace | haha, oh yeah :) |
03:08:43 | xace | here i am running `time <mycommand>` not realising why its not going anyfaster, later realising i should compile it... thats it i should sleep |
03:08:47 | * | banc quit (Quit: Bye) |
03:14:36 | * | vlad1777d quit (Ping timeout: 250 seconds) |
03:24:30 | * | banc joined #nim |
03:35:45 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:41:18 | * | Elronnd quit (Ping timeout: 264 seconds) |
03:51:36 | * | Elronnd joined #nim |
03:59:10 | * | dddddd quit (Remote host closed the connection) |
04:29:28 | shashlick | @xmonader: ya that was a big motivation but was a dead end since DLLs are loaded in PreMainInner, way before any imports |
04:30:46 | * | nsf joined #nim |
04:46:44 | FromGitter | <gogolxdong> yesterday's issue might out of this `var instanceData = fromJsonJsonNode (response)` |
05:00:32 | * | endragor joined #nim |
07:18:03 | * | krux02 joined #nim |
07:37:15 | * | Tanger joined #nim |
07:50:55 | Tanger | Anybody working on an ElasticSearch api for Nim? |
08:08:29 | * | Vladar joined #nim |
08:11:30 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c1365b1ca317a0e25c50ecf] |
08:12:27 | FromGitter | <gogolxdong> Is this a good pattern? I want to split a large body into pieces. |
08:13:19 | FromDiscord_ | <j$> is there a way to play a video file in nim |
08:13:24 | FromGitter | <gogolxdong> and further , how to remove the buildHtml in each piece. |
08:13:51 | FromGitter | <alehander42> @gogolxdong I would put each tag on new line, as with normal html |
08:14:16 | FromGitter | <alehander42> buildHtml is required so the tdiv/tags macros can work in that context |
08:14:30 | FromGitter | <alehander42> you can probably shorten it to something if you really want to |
08:17:20 | FromGitter | <gogolxdong> Is this splitting is acceptable or a good practice? |
08:19:45 | Araq | splitting is good, but keep the buildHtml |
08:20:00 | Araq | splitting is just the ordinal "turn proc into more procs" |
08:20:26 | Araq | *the usual |
08:37:13 | * | jjido joined #nim |
08:45:01 | FromGitter | <mratsim> @dom96 I shouldn’t need gc_ref, the ptr ref cannot outlive the ref. I just wanted to break a cyclic dependency in an acyclic tree where I keep a backlink for convenience |
09:01:03 | * | floppydh joined #nim |
09:03:03 | * | jjido quit (Ping timeout: 250 seconds) |
09:05:52 | * | Trustable joined #nim |
09:05:55 | Araq | mratsim: Give me something to reproduce |
09:06:13 | FromGitter | <mratsim> yep will do |
09:08:16 | FromGitter | <alehander42> i am interested too, can't imagine how the compiler can be convinced about that |
09:18:12 | FromGitter | <mratsim> @alehander42 @Araq here you go: https://github.com/nim-lang/Nim/issues/9974 |
09:18:17 | FromGitter | <mratsim> it’s very strange |
09:20:07 | FromGitter | <alehander42> i dont get a sigsegv |
09:24:43 | FromGitter | <mratsim> I use devel from beginning on November, I’ll try on latest |
09:27:23 | FromGitter | <mratsim> I think with ptr Foo, even ptr seq, the GC shouldn’t increase the ref count. |
09:27:38 | FromGitter | <mratsim> well seq is a bad example. |
09:27:44 | FromGitter | <mratsim> ptr ref int say. |
09:27:57 | FromGitter | <mratsim> but I can’t try that due to this issue |
09:32:41 | FromGitter | <mratsim> @alehander42 still crashes on latest devel |
09:40:08 | FromGitter | <mratsim> Breaking news, Nim is a JIT language: https://www.ruby-lang.org/en/news/2018/12/06/ruby-2-6-0-rc1-released/ ⏎ ⏎ > Unlike ordinary JIT compilers for other languages, Ruby’s JIT compiler does JIT compilation in a unique way, which prints C code to a disk and spawns common C compiler process to generate native code. |
09:42:36 | FromGitter | <alehander42> ha, they finally have builtin ast module, but I think everybody uses the `parser` gem anyway now |
09:49:25 | * | snowolf quit (Ping timeout: 250 seconds) |
09:49:42 | * | crashbjorn joined #nim |
09:50:21 | crashbjorn | hey |
09:50:47 | FromGitter | <mratsim> ho |
09:50:49 | crashbjorn | I'm trying to find the key in a table, which has the maxmimum *value*.. but can't seem to do this very elegantly in nim... |
09:51:32 | crashbjorn | in python i'd do something like `max(d.keys(), key=lambda x: d[x])` |
09:52:38 | crashbjorn | but i can't seem to get the same elegance in nim. Even my first struggle is, that it seems the max() proc in nim won't take the keys() iterator as a parameter. do I need to convert it to a list first? |
09:52:44 | FromGitter | <mratsim> countTable —> largest |
09:53:01 | FromGitter | <mratsim> https://nim-lang.org/docs/tables.html#largest%2CCountTable%5BA%5D |
09:54:00 | crashbjorn | oh this looks nice. of course there's an elegant solution :) thanks a bunch |
09:55:07 | FromDiscord_ | <j$> hey does anyone know of a video playback api for nim? |
09:55:31 | FromGitter | <mratsim> otherwise ⏎ Otherwise this is how you search for the max key in general: https://github.com/numforge/laser/blob/master/benchmarks/random_sampling/bench_multinomial_samplers.nim#L118-L127 |
09:55:44 | FromGitter | <mratsim> keep track of the current key, val in a result tuple and compare |
09:56:04 | FromGitter | <mratsim> @j$ there is an low-level ffmpeg binding, and there is an example video player in karax |
09:56:21 | FromGitter | <mratsim> https://github.com/pragmagic/karax/tree/master/examples/mediaplayer |
09:56:39 | FromDiscord_ | <j$> awesome thanks |
09:56:50 | FromGitter | <mratsim> https://github.com/ahirner/nim-ffmpeg |
09:57:59 | FromGitter | <mratsim> this thread might help you as well: https://forum.nim-lang.org/t/2742 |
10:02:31 | * | stefanos82 joined #nim |
10:05:23 | * | jjido joined #nim |
10:12:01 | * | Cthalupa quit (Ping timeout: 244 seconds) |
10:14:09 | * | Cthalupa joined #nim |
10:34:21 | * | abm joined #nim |
11:03:42 | FromGitter | <gogolxdong> @Araq, I'm not sure when is the occasion of using `template sync*(n:VNode):untyped = vnodeToDom(n) ` |
11:04:33 | FromGitter | <gogolxdong> `template sync*(n:VNode):untyped = dthunk vnodeToDom(n) ` |
11:05:18 | Araq | it's when you wrap something that returns a kdom.Node or when you need more control over your input elements |
11:05:24 | FromGitter | <gogolxdong> a minimal diffing part? |
11:08:26 | FromGitter | <gogolxdong> ripple effects? |
11:09:59 | FromGitter | <gogolxdong> It seems redrawing automatically. |
11:46:00 | * | nc-x joined #nim |
11:47:33 | nc-x | Can anyone familiar with nimRtl check if these now work as expected - https://github.com/nim-lang/Nim/issues/6855 , https://github.com/nim-lang/Nim/issues/8405 |
11:48:35 | nc-x | Nope, my bad |
11:48:39 | nc-x | I checked it wrong |
12:05:08 | * | nc-x quit (Quit: Page closed) |
12:18:51 | * | awal joined #nim |
12:19:15 | * | awal is now known as Guest78937 |
12:20:05 | * | Guest78937 is now known as awal |
12:24:39 | * | PMunch joined #nim |
12:31:14 | * | Snircle joined #nim |
12:44:32 | * | ftsf joined #nim |
12:46:43 | ftsf | hi, is it possible to compile some modules with debug and others as release? i have low level stuff that i'm sure is solid but runs very slow when in debug mode, and my high level stuff I'm working on I want to know about problems. |
12:50:05 | Araq | yes, the syntax in the config is mymodule.options.always = "-O2" |
12:50:18 | Araq | I think. |
12:54:35 | * | kapil____ quit (Quit: Connection closed for inactivity) |
12:59:02 | * | nc-x joined #nim |
12:59:48 | * | bozaloshtsh quit (Ping timeout: 252 seconds) |
13:01:23 | nc-x | Araq: Any idea how to fix https://github.com/nim-lang/Nim/issues/5604. I see https://github.com/nim-lang/Nim/blob/devel/compiler/semexprs.nim#L30, so the compile time errors show correct info, but the line locations are not stored for runtime errors. |
13:04:09 | * | jjido quit (Read error: Connection reset by peer) |
13:06:34 | Araq | nc-x: it's a C codegen problem |
13:07:09 | Araq | the C codegen emits line information on the statement level which is not good enough, it should be at the expression granularity |
13:07:23 | Araq | but more I don't know either, otherwise I would have fixed it already :p |
13:09:54 | ftsf | @Araq, thanks! |
13:11:20 | * | endragor quit (Remote host closed the connection) |
13:12:48 | nc-x | Araq: 👍 |
13:21:06 | * | voiceftp quit (Remote host closed the connection) |
13:21:41 | * | voiceftp joined #nim |
13:21:52 | * | voiceftp quit (Remote host closed the connection) |
13:25:34 | * | Vladar quit (Remote host closed the connection) |
13:29:05 | ftsf | hmm doesn't seem to have an effect if I check the generated c file, the command line doesn't contain -O2. gcc.options.always = "-O2" does, but to every module |
13:36:26 | FromGitter | <alehander42> Araq, I have a weird `nim doc OSError access is denied` error on my PR in appveyor: does this happen often |
13:51:04 | * | nc-x quit (Quit: Page closed) |
13:54:40 | * | tobbez quit (Ping timeout: 264 seconds) |
14:00:25 | * | kapil____ joined #nim |
14:07:05 | * | vlad1777d joined #nim |
14:16:21 | * | theelous3 joined #nim |
14:29:04 | xace | does someone know of a nim library that provides CLI-UI features? |
14:31:01 | leorize | there's nimbox |
14:34:57 | xace | ill check it out thanks :) |
14:35:57 | * | yuken_ joined #nim |
14:36:22 | yuken_ | Hmm. Nim has pretty similar syntax to BYOND, never thought I would have said that about anything. |
14:37:01 | * | azuri5 joined #nim |
14:38:31 | * | PMunch quit (Remote host closed the connection) |
14:41:07 | * | theelous3 quit (Ping timeout: 240 seconds) |
14:41:13 | * | dddddd joined #nim |
14:41:42 | * | azuri5 quit (Quit: azuri5) |
14:49:20 | xace | If I were to create a interactive pager like `less` would termbox fit for the job or am i better of with ncurses? |
14:52:20 | leorize | you can check if termbox supports what you need |
15:07:49 | * | abm quit (Quit: Leaving) |
15:09:25 | * | abm joined #nim |
15:12:44 | * | bozaloshtsh joined #nim |
15:12:45 | * | bozaloshtsh quit (Changing host) |
15:12:45 | * | bozaloshtsh joined #nim |
15:14:39 | * | abm quit (Quit: Leaving) |
15:15:27 | xace | yeah having trouble finding documentation for them ill try to understand then better to make a decision |
15:39:48 | xace | hmm the nim-ncurses seems like its a simple wrapper while nimbox seems to wrap and add some extra support, i guess I will stick with nimbox for ease of use and the readme made me chuckle |
15:40:33 | ldlework | xace: I'd be super interested in a nice template for nimbox |
15:41:21 | xace | ldlework: maybe sometime in the future when i try to strip dependencies of my project, but that would have to be after mid-january |
15:43:26 | * | nc-x joined #nim |
15:46:01 | nc-x | Araq: Is typed/untyped allowed in proc? If not then -> https://github.com/nim-lang/Nim/blob/devel/lib/system.nim#L688 https://github.com/nim-lang/Nim/blob/devel/lib/system/alloc.nim#L400 |
15:46:34 | Araq | some procs in system need it, in general it's not valid |
15:46:51 | nc-x | I was trying to give error for typed/untyped in proc for fixing some of the issues instead of crashing. |
15:47:02 | nc-x | But it fails on these 2 locations |
15:47:45 | nc-x | So what should I do for them? |
15:49:52 | Araq | don't check if the owner is skModule and sfSystemModule in owner.flags |
15:52:07 | * | vlad1777d quit (Ping timeout: 250 seconds) |
15:56:01 | * | ftsf quit (Ping timeout: 250 seconds) |
16:06:02 | * | floppydh quit (Quit: WeeChat 2.3) |
16:06:26 | * | rockcavera quit (Ping timeout: 246 seconds) |
16:11:58 | nc-x | Thanks! |
16:15:23 | Araq | nc-x: btw did my mergeConfig cause the old bugs to reappear? |
16:15:37 | Araq | that's the problem when we don't add tests for bugs |
16:17:11 | nc-x | I'll have to check |
16:17:32 | nc-x | After pushing the typed/untyped stuff, I will look it into |
16:17:36 | Araq | thanks |
16:18:33 | * | Ven`` joined #nim |
16:26:34 | * | narimiran joined #nim |
16:28:59 | * | Vladar joined #nim |
16:36:08 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:44:35 | * | kapil____ quit (Quit: Connection closed for inactivity) |
16:47:10 | nc-x | So now it fails on macros.nim https://travis-ci.org/nim-lang/Nim/jobs/468074200#L1145 |
16:48:42 | Araq | ah too bad :P |
16:48:57 | Araq | my time.h lacks CLOCK_THREAD_CPUTIME_ID |
16:49:16 | Araq | wtf, this is is not 'when defined(posix)', this is Linux specific |
16:50:37 | Araq | on the other travis on OSX is green so I don't care |
16:52:13 | nc-x | Araq: nim c --run -d:nodejs a.nim gives Error: system module needs: process.exit |
16:52:25 | nc-x | Oh sorry |
16:52:31 | nc-x | I used nim c |
16:53:41 | nc-x | So there are no regressions from your mergeConfig. Every thing works fine. |
16:54:09 | nc-x | So coming back to macros.nim. How do I special case macros.nim like I have done for system.nim |
16:59:44 | nc-x | > no regressions from your mergeConfig |
16:59:48 | nc-x | Except maybe one |
17:02:05 | nc-x | create empty `config.nims` in nim/config folder and try to compile any file `nim c filename.nim`. It now shows all the gcc commands used. (Which is not shown when config.nims not present)) |
17:04:12 | nc-x | https://github.com/nim-lang/Nim/issues/9982 |
17:04:47 | * | nc-x quit (Quit: Page closed) |
17:18:47 | * | banc quit (Ping timeout: 250 seconds) |
17:24:55 | * | banc joined #nim |
17:32:34 | FromGitter | <alehander42> wow , used 50_000 syntax in a python script because of nim habit for some time and finally realized they actually support it, they didnt before |
17:39:17 | narimiran | it is in python since 3.5 or so |
17:40:31 | * | tobbez joined #nim |
17:40:34 | FromGitter | <alehander42> yeah found the pep |
17:52:40 | * | snowolf joined #nim |
18:12:05 | * | wildlander joined #nim |
18:15:43 | FromGitter | <brentp> is nimble build from devel now broken? On nimble install for any local packages, I get "Error: undeclared identifier: 'version'." |
18:18:41 | leorize | judging from the latest commits https://github.com/nim-lang/Nim/commits/devel, yes it is |
18:18:51 | leorize | make sure you've updated to the latest version |
18:29:28 | FromGitter | <brentp> still fails with latest nim `git hash: 5ba22c9315a46a281baa2baf5a3ab4abdfcc4a33` |
18:48:44 | leorize | then I think you should open an issue on Nim git repo |
18:51:14 | * | Jesin quit (Quit: Leaving) |
18:59:30 | * | Jesin joined #nim |
19:06:16 | FromGitter | <iffy> Has anyone made a NodeJS addon (`.node` file you can `require` from NodeJS) from Nim? I just made a hello world one and think there's potential for Nim to make the process easier, but didn't want to redo it if someone had already done it |
19:10:41 | * | Jesin quit (Quit: Leaving) |
19:10:44 | * | zakora joined #nim |
19:12:25 | * | krux02 quit (Remote host closed the connection) |
19:14:49 | * | Jesin joined #nim |
19:42:53 | FromDiscord_ | <deech> I was taking a look at https://github.com/nim-lang/Nim/issues/9961 and the problem is that field access on a `typedesc` that doesn't have a base type causes the compiler to crash. Changing the `const b: typedesc` to `const b : typedesc[Table]` or even just `const b : Table` works. The crash happens because the `v.type` in the `proc` resolves to `type(v.type)` which is of kind `tyFromExpr` causing the crash. My question: is there any time fie |
19:46:50 | FromDiscord_ | <deech> I was taking a look at https://github.com/nim-lang/Nim/issues/9961 and the problem is that field access on a `typedesc` that isn't parameterized, eg. `typedesc[int]`, the compiler to crash. Changing the `const b: typedesc` to `const b : typedesc[Table]` or even just `const b : Table` works. The crash happens because the `v.type` in the `proc` resolves to `type(v.type)` which is of kind `tyFromExpr` causing the crash. My question: is there an |
19:47:05 | FromDiscord_ | <deech> I was taking a look at https://github.com/nim-lang/Nim/issues/9961 and the problem is that field access on a `typedesc` that isn't parameterized, eg. `typedesc[int]`, causes the compiler to crash. Changing the `const b: typedesc` to `const b : typedesc[Table]` or even just `const b : Table` works. The crash happens because the `v.type` in the `proc` resolves to `type(v.type)` which is of kind `tyFromExpr` causing the crash. My question: is t |
19:49:31 | Araq | sorry, deech, post what you said after "My question: " |
19:49:35 | Araq | again. |
19:50:03 | Araq | iffy: I don't think anybody did that before |
19:50:31 | FromDiscord_ | <deech> My question: is there any time field access on some `type(foo.type)` makes sense? |
19:51:07 | FromDiscord_ | <deech> I guess editing the comment on Discord doesn't work well for people reading on IRC. 😃 |
19:52:01 | Araq | in theory typedesc of typedesc makes sense and in the long it's gonna be supported |
19:52:10 | Araq | *in the long run |
19:54:44 | leorize | @deech: editing on Discord = multiple messages for IRC users :P |
19:55:52 | FromGitter | <alehander42> basically <fixed subsentence>* is the most portable thing you can do :D |
20:22:08 | * | Vladar quit (Remote host closed the connection) |
20:26:44 | xace | im stuck on this: https://pastebin.com/raw/6yPRuCCD # how can i make 'matches' only point to the object rather than actually copying it? |
20:27:45 | xace | oh and the `var e:BigData` # how could i initilize it if it was a `let e: BigData` ? |
20:30:04 | leorize | you'd need to use the constructor to initalize a `let` variable |
20:30:23 | leorize | `let e = BigData(i: 0, str: "")` for example |
20:30:25 | xace | leorize: oki, then i guessed that one correctly. what about matches.add() |
20:30:35 | leorize | use a ref object |
20:30:46 | leorize | if you wanted to pass as reference, use a reference :P |
20:32:15 | xace | leorize: is it possible without changing to `BigData = ref object` ? The reason I'm asking is to better understand the language |
20:33:01 | leorize | I don't think copy-on-write is supported, so you'd have to change BigData to a `ref object` |
20:34:00 | xace | leorize: Then how would i create a copy of a `ref object` later on? |
20:34:24 | * | zachk joined #nim |
20:35:15 | leorize | system.deepCopy() |
20:35:39 | xace | hmm, |
20:35:42 | leorize | that'll clone everything, so be careful |
20:36:14 | leorize | an another way would be to construct a new `ref object` and copy the fields over |
20:37:33 | leorize | actually, I think you can do some thing like this: |
20:37:48 | xace | leorize: another question, if i have `BigData = ref object` and call `proc foo(bar:BigData)` # will foo be able to change bar? or does it still need a `bar: var BigData` |
20:38:04 | leorize | yep, foo can change bar |
20:38:19 | xace | can i limit it to `const` somehow? |
20:38:40 | xace | `immutable` is the correct term i believe |
20:38:50 | * | zakora quit (Quit: WeeChat 2.2) |
20:38:51 | leorize | write tracking is not implemented yet, sadly |
20:48:53 | xace | leorize: hmm `ref object` now requires me to var foo = BigData() # and while doing that i realised i can: `let foo = BigData(n: i, str: "foobar") |
21:00:10 | * | ng0_ is now known as ng0 |
21:02:09 | * | narimiran quit (Remote host closed the connection) |
21:09:42 | * | PaddyF joined #nim |
21:30:54 | Zevv | is experimental "callOperator" here to stay? |
21:32:11 | * | zachk quit (Read error: Connection reset by peer) |
21:33:07 | * | zachk joined #nim |
21:34:30 | * | zachk quit (Changing host) |
21:34:30 | * | zachk joined #nim |
21:43:42 | * | Tyresc joined #nim |
21:56:04 | * | stephenwithav quit (Quit: ERC (IRC client for Emacs 25.3.1)) |
21:56:32 | * | stephenwithav joined #nim |
21:56:32 | * | stephenwithav quit (Changing host) |
21:56:32 | * | stephenwithav joined #nim |
22:05:00 | * | Cthalupa quit (Ping timeout: 272 seconds) |
22:07:19 | * | Cthalupa joined #nim |
22:41:49 | * | Trustable quit (Remote host closed the connection) |
22:47:37 | * | vlad1777d joined #nim |
22:54:00 | * | stefanos82 quit (Remote host closed the connection) |
23:47:52 | * | vlad1777d quit (Ping timeout: 250 seconds) |