<< 03-02-2018 >>

00:04:59*yglukhov joined #nim
00:34:12*vlad1777d quit (Ping timeout: 256 seconds)
00:40:31*yglukhov quit (Remote host closed the connection)
00:54:18*arnetheduck joined #nim
01:13:01*d10n-work quit (Quit: Connection closed for inactivity)
01:20:25skrylarpet peeve: when serialization libraries don't post their formats
01:20:46*redlegion quit (Quit: Peace, bitches)
01:20:48skrylarhyperdex does this too; it's supposedly a good key/value store but it's protocol is "use a c lib"
01:23:25*vlad1777d joined #nim
01:29:08*MJCaley joined #nim
01:29:20*yglukhov joined #nim
01:29:37*vlad1777d quit (Ping timeout: 248 seconds)
01:33:18*yglukhov quit (Ping timeout: 240 seconds)
01:41:06*icebattle quit (Quit: leaving)
01:45:09*smt quit (Ping timeout: 256 seconds)
02:19:52*dddddd quit (Ping timeout: 252 seconds)
02:28:23*chemist69 quit (Ping timeout: 276 seconds)
02:40:35Demos[m]yeah, I usually go for the format docs first. Cuz it's usually the best way to get an intuation for how the lib is designed
02:42:05*chemist69 joined #nim
02:44:10*tinAndi joined #nim
02:49:38*tinAndi quit (Ping timeout: 256 seconds)
02:50:09*MJCaley quit (Quit: MJCaley)
02:53:37*yglukhov joined #nim
02:58:17*yglukhov quit (Ping timeout: 276 seconds)
03:18:52FromGitter<Quelklef> how can i make a proc take a default iterable?
03:19:28FromGitter<Quelklef> i.e. the proc signature looks something like `proc f(s: seq[seq[T]]): seq[T]`
03:19:50FromGitter<Quelklef> but I can write it in such a way so that each `seq` could be an `openarray` instead and it'd still work
03:20:16FromGitter<Quelklef> (or any other data type implementing `items -> T`)
03:20:31FromGitter<Quelklef> is there some way to make it generic in this sense?
03:25:18FromGitter<barcharcraz> Are the inner seqs different sizes?
03:25:29FromGitter<Quelklef> Perhaps
03:25:32FromGitter<Quelklef> no guarantee that they're the same
03:25:56FromGitter<Quelklef> My question extends a little beyond this to "how can I write code for general iterators"
03:26:14FromGitter<Quelklef> But I think (?) it's easy for 1D
03:27:34FromGitter<barcharcraz> So openarrays are NOT generic types afaik. (They are concrete but u can’t use them outside of procs)
03:27:47FromGitter<Quelklef> right...
03:28:00FromGitter<barcharcraz> If you use real genetics then u could say like T[T]
03:28:19FromGitter<Quelklef> I tried before, I can't seem to get any kind of generics working for it
03:28:20FromGitter<barcharcraz> Then use concepts to get better error messages
03:28:25FromGitter<barcharcraz> Huh
03:28:29FromGitter<Quelklef> yeah im trying concepts now but I can't get it to work
03:28:38FromGitter<Quelklef> current attempt: ```nim
03:28:43FromGitter<Quelklef> oops
03:29:06FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a752c824a6b0dd32b81d79b]
03:29:23FromGitter<barcharcraz> And the error
03:29:41FromGitter<barcharcraz> Also closure iterators may work
03:30:15FromGitter<Quelklef> `.add` is saying it's not getting the right types
03:30:21FromGitter<Quelklef> how so?
03:30:34FromGitter<barcharcraz> They are real values
03:30:46FromGitter<Quelklef> right, but like, how can i apply it
03:30:49FromGitter<barcharcraz> So I can pass in just the iteration
03:30:53FromGitter<Quelklef> oh, right
03:30:54FromGitter<Quelklef> hmm
03:31:10FromGitter<Quelklef> that seems less general even though it conceptually isn't
03:31:34FromGitter<Quelklef> Wait, maybe not. I've never used closure iterators 😬
03:35:26FromGitter<Quelklef> it seems to think `result` is of type `seq[seq[T]]`?
03:38:18FromGitter<barcharcraz> Huh
03:38:53FromGitter<Quelklef> oh, shoot, I think something was up with block comments
03:39:01FromGitter<Quelklef> Nope, I lied
03:39:52FromGitter<barcharcraz> Try static: echo and print the type names
03:40:32FromGitter<Quelklef> wow, TIL of `static:`
03:41:52FromGitter<Quelklef> How do I do what you're asking, though
03:44:05FromGitter<Quelklef> Well, I can deduce the type from the compiler errors......
03:49:55*radagast quit (Ping timeout: 260 seconds)
03:51:44FromGitter<jamesalbert> Is there anyway to stop runForever?
03:52:11FromGitter<jamesalbert> from inside one of the functions that are asyncCheck'd?
03:53:03FromGitter<jamesalbert> nevermind, I can just exit
03:53:40*dddddd joined #nim
03:54:20FromGitter<Quelklef> πŸ‘
04:41:47*yglukhov joined #nim
04:45:51*yglukhov quit (Ping timeout: 248 seconds)
04:54:45FromGitter<honewatson> @Quelklef I made some notes on concepts a couple of weeks ago. The second example may be of interest. https://gist.github.com/honewatson/583135c1b191119a3b3be3fdbfe8607b
05:00:17FromGitter<Quelklef> Looks maybe relevant, but not generic
05:00:57FromGitter<Quelklef> as in it has no type parameters
05:14:28*BitPuffin joined #nim
05:15:43FromGitter<honewatson> Fair enough
05:16:50FromGitter<honewatson> I can probably put some generic examples up later when I home
06:23:11*Yardanico_ joined #nim
06:23:18*Yardanico_ quit (Client Quit)
06:29:59*yglukhov joined #nim
06:34:20*yglukhov quit (Ping timeout: 252 seconds)
06:37:41GitDisc<bahm> I can see that list comprehension (and for loop as an expression) has been discussed here on Discord several times with (apparently) little progress. I have written down my thoughts so far on the syntax etc. Should I post it on the forums or this Github issue (or some third place?): https://github.com/nim-lang/Nim/issues/5707
06:39:11FromGitter<Quelklef> NIM HAS LIST COMPREHENSIONS!?
06:39:18FromGitter<Quelklef> *it just gets better*
06:46:26Araqbahm: RFC
06:47:13Araqlet stuff = @[for i in 0..4: i] # syntax?
06:47:17FromGitter<Quelklef> What does RFC stand for?
06:48:41AraqRequests for Comments
06:50:48FromGitter<Quelklef> i.e. "This is tentative and we want opinions on it?"
06:51:33*nsf joined #nim
06:52:36GitDisc<bahm> That's actually the first example of a syntax I've seen.
06:55:50GitDisc<bahm> The ones I've been playing around with are:
06:55:50GitDisc<bahm>
06:55:50GitDisc<bahm> Syntax 1: var a: seq[T] = for x in y: expr
06:55:50GitDisc<bahm> Syntax 2 (cond is optional): var a: seq[T] = expr for x in y cond
06:55:50GitDisc<bahm>
06:55:55GitDisc<bahm> Both work with type inference, too (var a = ...) and I've thought about using Y[T] instead of seq[T], where Y is any collection that implements add(). I'm not very familiar with collections (or anything else, really) in Nim yet, but I figured I might know enough to make suggestions.
06:57:11GitDisc<bahm> Also, expansions for syntax 1 and 2 (I haven't learned how macros work, but I'm guessing they could be used):
06:57:11GitDisc<bahm>
06:57:11GitDisc<bahm> Syntax 1:
06:57:11GitDisc<bahm> var a: seq[T] = (var s: seq[T] = seq[T](); for x in y: (var e: T = expr; if e != nil: s.add(e)); s)
06:57:11GitDisc<bahm>
06:57:11GitDisc<bahm> Syntax 2 (without cond):
06:57:14GitDisc<bahm> var a: seq[T] = (var s: seq[T] = seq[T](); for x in y: (var e: T = expr; if e != nil: s.add(e)); s)
06:57:14GitDisc<bahm>
06:57:15GitDisc<bahm> With cond:
06:57:18GitDisc<bahm> var a: seq[T] = (var s: seq[T] = seq[T](); for x in y: (var e: T = expr; cond: (if e != nil
06:57:19GitDisc<bahm> : s.add(e))); s)
06:59:54Araqit needs to be based on a protocol as you say
07:00:09Araq(anything that implements add())
07:00:30Araqbut it's not obvious how to denote the type
07:00:49Araqmost collections lack a constructor like @[]
07:00:52*Kingsquee joined #nim
07:01:16Araqlet x = initQueue(for x in y: x)
07:01:38Araq-->
07:02:02Araqlet x = initQueue[type(element)]()
07:02:08Araqfor i in y: x.add i
07:02:28Araqseems like a pretty trivial transformation
07:05:53GitDisc<bahm> Would it be workable to use seq[T] unless another type can be inferred? I.e.
07:05:53GitDisc<bahm>
07:05:53GitDisc<bahm> # @[2, 3, 4]
07:05:53GitDisc<bahm> var a = for x in [1, 2, 3]: x+1
07:05:54GitDisc<bahm>
07:05:54GitDisc<bahm> # {2, 3, 4}
07:05:54GitDisc<bahm> var a: set[int] = for x in [1, 2, 3]: x+1
07:08:31GitDisc<bahm> Expanding
07:08:31GitDisc<bahm> var a: Y[T] = for x in y: expr
07:08:31GitDisc<bahm> Into
07:08:32GitDisc<bahm> var a: Y[T] = (var s: Y[T] = Y[T](); for x in y: (var e: T = expr; if e != nil: s.add(e)); s)
07:08:32GitDisc<bahm>
07:08:32GitDisc<bahm> And
07:08:32GitDisc<bahm> var a = for x in y: expr
07:08:34GitDisc<bahm> Into
07:08:36GitDisc<bahm> var a: seq[T] = (var s: seq[T] = seq[T](); for x in y: (var e: T = expr; if e != nil: s.add(e)); s)
07:11:29GitDisc<bahm> Please do let me know if I my understanding of Nim (or its inner workings) isn't good enough to make sensible suggestions.
07:20:56Araqit's ok, only my own suggestions are "sensible", no worries ;-)
07:21:35Araqbut I wouldn't get rid of the @[] just because we can
07:22:04Araqfeels like a less generic solution then
07:25:53FromGitter<dom96> Araq: you coming?
07:29:22*yglukhov joined #nim
07:34:06*yglukhov quit (Ping timeout: 256 seconds)
07:41:22*dddddd quit (Remote host closed the connection)
07:43:34*solitudesf joined #nim
08:16:09*yglukhov joined #nim
08:41:34*yglukhov quit (Remote host closed the connection)
08:57:39*miran joined #nim
09:02:56*gmpreussner quit (Ping timeout: 276 seconds)
09:05:27*gmpreussner joined #nim
09:10:32*aziz joined #nim
09:18:22FromGitter<tim-st> I often used list comprehensions in Python and liked their syntax like `x for x in f() if x`
09:18:41FromGitter<tim-st> of course with `[...]`
09:22:24FromGitter<tim-st> btw. is it necessary to supply the type in nims list comprehensions? Cant the compiler find out quite easily?
09:26:20*nsf quit (Quit: WeeChat 2.0.1)
09:28:30*Arrrr joined #nim
09:28:30*Arrrr quit (Changing host)
09:28:30*Arrrr joined #nim
09:32:37Arrrrhttps://i.imgur.com/TrJVuKm.png
09:35:57*couven92 joined #nim
09:50:44*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
09:53:24*clyybber joined #nim
10:03:15*solitudesf quit (Ping timeout: 260 seconds)
10:05:35*j_rod_s quit (Quit: j_rod_s)
10:09:52*j_rod_s joined #nim
10:10:05*ftsf joined #nim
10:44:49*clyybber quit (Ping timeout: 248 seconds)
10:54:22*radagast joined #nim
10:54:56FromGitter<tim-st> Is this normal that I have to use brackets for an assert like this `assert (not true and false or true)`
10:56:21FromGitter<tim-st> `assert true and false or true` works
10:58:47Arrrrassert foo == false
11:01:25FromGitter<tim-st> ok thanks, but in theory not has a priority that shouldnt force brackets
11:02:03FromGitter<tim-st> (I know that It's because of the implementation of not^^)
11:08:00FromGitter<alehander42> hahaha @Arrrr did you draw it
11:09:09*miran quit (Quit: Konversation terminated!)
11:10:00*couven92 quit (Ping timeout: 256 seconds)
11:12:52*miran joined #nim
11:14:38Arrrrmemes have no authors
11:17:07*tinAndi joined #nim
11:20:47*couven92 joined #nim
11:22:22FromGitter<alehander42> modern folklore
11:48:51*Yardanico_ joined #nim
11:53:32*yglukhov joined #nim
11:55:54*tinAndi quit (Ping timeout: 256 seconds)
11:58:55*Yardanico_ quit (Read error: Connection reset by peer)
12:03:09*aziz quit (Remote host closed the connection)
12:23:09*Vladar joined #nim
12:26:59*yglukhov quit (Remote host closed the connection)
12:27:25*yglukhov joined #nim
12:31:48*yglukhov quit (Ping timeout: 240 seconds)
12:37:03*vlad1777d joined #nim
12:46:03*yglukhov joined #nim
12:46:20*vlad1777d quit (Ping timeout: 256 seconds)
12:50:40*yglukhov quit (Ping timeout: 260 seconds)
12:51:20*yglukhov joined #nim
13:04:30*yglukhov quit (Remote host closed the connection)
13:04:56*yglukhov joined #nim
13:09:56*yglukhov quit (Ping timeout: 276 seconds)
13:10:57*Arrrr quit (Ping timeout: 240 seconds)
13:19:32*nsf joined #nim
13:21:58FromGitter<tim-st> is there a way to have a field for `A` named `x` and a `proc` for `A` named `x` ?
13:22:24*yglukhov joined #nim
13:22:57FromGitter<tim-st> (without renaming the field)
13:23:41*rokups joined #nim
13:28:06*yglukhov quit (Remote host closed the connection)
13:28:32*yglukhov joined #nim
13:33:22*yglukhov quit (Ping timeout: 256 seconds)
13:37:48*yglukhov joined #nim
13:39:50*yglukhov quit (Remote host closed the connection)
13:40:10*yglukhov joined #nim
13:41:45*yglukhov quit (Remote host closed the connection)
13:43:02*dddddd joined #nim
13:44:01*MJCaley joined #nim
13:50:42*yglukhov joined #nim
13:53:16*yglukhov_ joined #nim
13:54:10*MJCaley quit (Quit: MJCaley)
13:54:48*yglukhov quit (Ping timeout: 240 seconds)
13:55:53*Yardanico_ joined #nim
13:55:55*Yardanico_ quit (Remote host closed the connection)
13:56:12*Vladar quit (Remote host closed the connection)
13:58:02*yglukhov_ quit (Ping timeout: 276 seconds)
14:03:39*Serenitor joined #nim
14:09:52*solitudesf joined #nim
14:12:34*yglukhov joined #nim
14:16:40*yglukhov quit (Ping timeout: 240 seconds)
14:24:16*Arrrr joined #nim
14:30:17ArrrrIs this a good idea? https://pastebin.com/DMxcu6Eb
14:30:28ArrrrI would expect either a promotion or a complain in the template example
14:31:21Arrrr*complaint
14:33:43*radagast quit (Quit: radagast)
15:01:48*yglukhov joined #nim
15:06:44*yglukhov quit (Ping timeout: 265 seconds)
15:10:57*yglukhov joined #nim
15:16:02*yglukhov quit (Ping timeout: 276 seconds)
15:42:07*ftsf quit (Ping timeout: 256 seconds)
15:42:45*yglukhov joined #nim
15:47:16*yglukhov quit (Ping timeout: 252 seconds)
15:48:05*yglukhov joined #nim
15:52:24*yglukhov quit (Ping timeout: 252 seconds)
16:03:11*rokups quit (Quit: Connection closed for inactivity)
16:13:36*rauss quit (Read error: Connection reset by peer)
16:14:53*rauss joined #nim
16:19:10*yglukhov joined #nim
16:19:24*arnetheduck quit (Ping timeout: 256 seconds)
16:23:18*yglukhov quit (Ping timeout: 240 seconds)
16:27:40*yglukhov joined #nim
16:32:17*yglukhov quit (Ping timeout: 265 seconds)
16:41:49FromGitter<Varriount> Arrrr: I'm guessing the template doesn't actually convert it's arguments, it just checks if they are compatible.
16:42:20FromGitter<Varriount> Whereas a procedure does convert it's arguments.
16:48:47ArrrrYes, but it is misleading until you experience it.
16:49:32ArrrrI wasn't aware of the implications until i had to kill a bug because of it.
16:52:28*yglukhov joined #nim
16:55:50*yglukhov_ joined #nim
16:57:14*yglukhov quit (Ping timeout: 256 seconds)
17:00:12*yglukhov_ quit (Ping timeout: 256 seconds)
17:09:28*natrys joined #nim
17:14:42*xkapastel joined #nim
17:22:20*tinAndi joined #nim
17:27:57*tinAndi quit (Ping timeout: 240 seconds)
17:35:54*couven92 quit (Ping timeout: 256 seconds)
17:35:57*Serenitor quit (Quit: Leaving)
17:50:05*mgdelacroix joined #nim
17:50:28*yglukhov joined #nim
17:54:48*yglukhov quit (Ping timeout: 240 seconds)
17:56:31*yglukhov joined #nim
17:58:19*yglukhov quit (Remote host closed the connection)
17:58:47*yglukhov joined #nim
18:02:10*couven92 joined #nim
18:03:44*yglukhov quit (Ping timeout: 276 seconds)
18:09:32YardanicoGuys, this is not an issue, right? https://github.com/nim-lang/Nim/issues/7182
18:09:56YardanicoI mean it's documented that toSeq transforms any iterator (not an object) to a sequence
18:19:39*miran quit (Quit: Konversation terminated!)
18:39:45*BitPuffin quit (Remote host closed the connection)
18:44:52FromGitter<Quelklef> https://nim-lang.org/docs/sequtils.html#toSeq.t,untyped
18:44:57FromGitter<Quelklef> `template toSeq(iter: untyped): untyped`
18:45:02FromGitter<Quelklef> "Transforms any iterator into a sequence."
18:45:06FromGitter<Quelklef> Seems properly documented
19:38:04ArrrrIt could be a good idea to call items
20:14:19*Arrrr quit (Quit: Leaving.)
20:41:56*MJCaley joined #nim
20:59:22*MJCaley quit (Quit: MJCaley)
21:00:59*natrys quit (Quit: natrys)
21:22:18FromGitter<tim-st> when I write `while index < text.len` is `text.len` called again or once?
22:06:02*MJCaley joined #nim
22:32:57*solitudesf quit (Ping timeout: 256 seconds)
22:33:10*shashlick1 joined #nim
22:36:56*nsf quit (Quit: WeeChat 2.0.1)
22:36:59*shashlick1 quit (Client Quit)
22:49:19FromGitter<Varriount> Once.
22:51:26FromGitter<Quelklef> ```code paste, see link``` ⏎ ⏎ Begs to differ... [https://gitter.im/nim-lang/Nim?at=5a763cee98927d574573f1ca]
23:00:08*yglukhov joined #nim
23:04:57*j_rod_s_ joined #nim
23:06:40*j_rod_s quit (Ping timeout: 240 seconds)
23:06:40*j_rod_s_ is now known as j_rod_s
23:06:48*yglukhov quit (Ping timeout: 240 seconds)
23:22:57FromGitter<tim-st> ok, thanks. I assume if it's a field it's called once, if it's a proc without a special pragma it's called again
23:24:46FromGitter<tim-st> hm, also fields should be called again.. maybe always called again unless something static
23:34:55*yglukhov joined #nim
23:39:42*yglukhov quit (Ping timeout: 256 seconds)
23:41:17*yglukhov joined #nim
23:43:34*MJCaley quit (Quit: MJCaley)
23:45:59*j_rod_s_ joined #nim
23:48:51*couven92 quit (Quit: Client Disconnecting)
23:49:54*j_rod_s quit (Ping timeout: 256 seconds)
23:49:55*j_rod_s_ is now known as j_rod_s