<< 23-12-2021 >>

00:01:53FromDiscord<KatrinaKitten> In reply to @qb "https://play.nim-lang.org/#ix=3Jbq": If you don't mind importing `sequtils`, this is equivalent. Not sure if there's a simpler version.↵https://play.nim-lang.org/#ix=3Jbu
00:02:57FromDiscord<KatrinaKitten> Without the `[0..^2]` it puts an extra separator on the end, beyond that the behavior is fairly intuitive.
00:04:52FromDiscord<KatrinaKitten> This is also equivalent but needs the `let`, so it can't be a one-liner. ↵https://play.nim-lang.org/#ix=3Jbw
00:25:02*vicfred quit (Quit: Leaving)
00:29:40*stosby joined #nim
00:43:18FromDiscord<marcus> is there a way to send a embed using a webhook in nim?
00:48:26FromDiscord<IsaacPaul> Anyone know why `echo result.repr` doesn't do anything in a macro ?
00:55:26*noeontheend joined #nim
01:07:55FromDiscord<Sabena Sema> tfw you think the generic cache is broken again but you actually just ... explicitly wrote out one of the generics
01:07:59FromDiscord<Elegantbeef> what is `result`
01:08:12FromDiscord<Elegantbeef> Like `echo result.treeRepr`
01:08:28FromDiscord<Elegantbeef> or `echo result.kind`
01:11:34FromDiscord<IsaacPaul> I think the macro isnt being executed (there are templates and macros with the same operator) 🤦
01:11:53FromDiscord<marcus> In reply to @marcus "is there a way": ^^^
01:20:34*TakinOver quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
01:24:21FromDiscord<Elegantbeef> Still working on an alternative wrapnils?↵(@IsaacPaul)
01:27:30FromDiscord<IsaacPaul> Kinda I’m looking at the ‘questionable’ Library, and was trying to get it to work for procedures that return void.
01:27:54FromDiscord<IsaacPaul> Honestly it probably wouldn’t have bothered but I feel like I’m so close lol
01:40:44*Colt quit (Remote host closed the connection)
01:41:16*Colt joined #nim
01:47:58FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3JbO
01:48:32FromDiscord<retkid> (edit) "https://play.nim-lang.org/#ix=3JbO" => "https://play.nim-lang.org/#ix=3JbP"
01:48:52FromDiscord<IsaacPaul> there’s a matrix library.. I forget the name tho
01:49:03FromDiscord<retkid> i suppose I will check itertools
01:49:06FromDiscord<retkid> but the docs confuse me
01:49:37FromDiscord<IsaacPaul> Arraymancer? Maybe
01:49:55FromDiscord<retkid> isnt that ai stuff
01:51:15FromDiscord<retkid> I will write my own magick then
01:51:37FromDiscord<IsaacPaul> I think it’s more big data than so
01:51:40FromDiscord<IsaacPaul> ai
01:52:33FromDiscord<IsaacPaul> Ah deep learning focus
02:02:22*krux02 quit (Remote host closed the connection)
02:08:05FromDiscord<Rosen> Neo is the other big one? I'm not sure exactly what kind of function you're looking for tho
02:10:06FromDiscord<Rosen> Are you trying to like... glue adjacent arrays?
02:23:37*noeontheend quit (Ping timeout: 240 seconds)
02:28:26FromDiscord<Rika> its not a well defined problem
02:28:46FromDiscord<Rika> what happens when [[1,2],[3,4],[5,6]]?
02:28:58FromDiscord<Rika> and also you need seqs here
02:36:31*arkurious quit (Quit: Leaving)
02:36:57*neurocyte0132889 quit (Ping timeout: 240 seconds)
02:40:14FromDiscord<retkid> well i wrote the code
02:40:16FromDiscord<retkid> uh
02:40:37FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Jc0
02:40:43FromDiscord<retkid> (edit)
02:40:55FromDiscord<retkid> so you have a seq of seqs of equal lengths
02:41:17FromDiscord<retkid> any you take all of them and you plop them into one list
02:41:35FromDiscord<retkid> guys dont ask why i need this
02:41:53FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Jc1
02:41:57FromDiscord<retkid> (edit)
02:43:27FromDiscord<Rika> i have no fucking clue what you mean
02:43:38FromDiscord<retkid> uhhhhhn
02:44:20FromDiscord<retkid> [[1,2,3,, [1,2,3], [1,2,3]] => [[1,1,1], [2,2,2], [3,3,3,]]
02:44:35FromDiscord<retkid> (edit) "[[1,2,3,," => "[[1,2,3],"
02:44:51FromDiscord<Rika> In reply to @Rika "its not a well": still not well defined
02:45:01FromDiscord<retkid> well, my works fail me
02:45:09FromDiscord<retkid> (edit) "works" => "words"
02:46:08FromDiscord<demotomohiro> transpose matrix?
02:46:09FromDiscord<retkid> 1. all sub-sequences must be of equal lengths↵2. the returned list is defined as: each element in each place of the list is arranged based on their place into individual lists
02:46:37FromDiscord<retkid> no clue dont exist in the science world because im a baby
02:50:15FromDiscord<Rika> oh so yeah transpose matrix
02:50:28FromDiscord<Rika> it feels like its a transpose to me at least
02:51:08FromDiscord<Rika> https://2.bp.blogspot.com/-8LzbJv0zB3A/WAzRQbxP5eI/AAAAAAAAHYU/MEqPV8JxtLMCSGSQ-0UKZSYlUN3jALZaQCLcB/s1600/Java%2BProgram%2Bto%2BTranspose%2Ba%2BMatrix%2B.png
02:51:10FromDiscord<Rika> like this right
02:51:16FromDiscord<Rika> auuuuuuuuua
02:51:37FromDiscord<Rika> here the wiki i cant be assed to save the image and copy image dont work (thanks discord)
02:51:37FromDiscord<Rika> https://en.wikipedia.org/wiki/Transpose
03:25:48NimEventerNew Nimble package! rangequeries - An implementation of Range Queries in Nim, see https://github.com/vanyle/RangeQueriesNim/
03:36:19*stosby quit (Read error: Connection reset by peer)
03:41:17FromDiscord<Sabena Sema> is there a usual way to make your own data structures that can be indexed arbitrarily?↵`type mdArray[N,M: static Slice[int]] = array[len(M)len(N), int]`↵↵does not work, and triggers an ice
03:41:25FromDiscord<Sabena Sema> oh, it's actually not quite an ice
03:42:02*stosby joined #nim
03:42:38*stosby quit (Read error: Connection reset by peer)
03:43:46FromDiscord<Sabena Sema> should that work?
03:43:53FromDiscord<Sabena Sema> is the range in an array type constructor a type or a value?
03:43:56FromDiscord<Sabena Sema> is it both?
03:43:59FromDiscord<Sabena Sema> neither?
03:44:02FromDiscord<Sabena Sema> a tyvalue
03:44:09FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jcd
03:44:10FromDiscord<Sabena Sema> sure
03:44:18FromDiscord<TryAngle> ah wait
03:44:18FromDiscord<TryAngle> (edit) "https://play.nim-lang.org/#ix=3Jcd" => "https://play.nim-lang.org/#ix=3Jce"
03:44:21FromDiscord<Sabena Sema> but then I would need to encode the start and end indicies seperately
03:44:27FromDiscord<TryAngle> u want to index via slicen 🤔
03:44:52FromDiscord<Sabena Sema> I want to be able to have `mdarray[1..5,0..4]` for a 5x5 array where the rows are indexed from 1 to 5 and the columns from 0 to 4
03:45:37FromDiscord<Rika> you will need to make a custom type with a custom `[]`
03:46:45FromDiscord<TryAngle> is there a quick way to flatten an array?
03:46:50FromDiscord<TryAngle> dim 2 -> dim 1
03:47:05FromDiscord<Sabena Sema> OK so the type will need additional parameters to indicate the top and bottom indicies
03:47:21FromDiscord<Sabena Sema> but then ... how can I write a type that can accept _any_ range for indexing like array can?
03:47:41FromDiscord<Sabena Sema> just writing a type with a custom `[]` doesn't work since the type needs to carry the start and end indicies along with it
03:48:19*stosby joined #nim
03:49:18FromDiscord<Rika> you can access generics in a function?
03:49:28FromDiscord<Sabena Sema> hih?
03:49:30FromDiscord<Sabena Sema> (edit) "hih?" => "huh?"
03:49:31FromDiscord<Sabena Sema> ofc
03:49:56*stosby quit (Client Quit)
03:50:22FromDiscord<Sabena Sema> I mean nim doesn't really do HKTs so if you have a generic proc on a type that proc is typically parameterized on all that type's parameters too
03:50:28FromDiscord<Rika> why would you need to carry
03:50:30FromDiscord<Rika> ?
03:50:30FromDiscord<Sabena Sema> for implicit generics you can use dot syntax to access them
03:50:45FromDiscord<Sabena Sema> how would the `[]` know where indexing starts?
03:50:52FromDiscord<Rika> check the type on the generic?
03:50:55FromDiscord<Sabena Sema> yes
03:51:05FromDiscord<Sabena Sema> and thus the type needs to carry that type with it
03:51:15FromDiscord<Rika> so? thats what array does
03:51:25FromDiscord<Sabena Sema> right
03:51:38FromDiscord<Sabena Sema> and that's what I tried
03:51:43FromDiscord<Sabena Sema> but `type mdArray[N,M: static Slice[int]] = array[len(M)len(N), int]` is not valid nim
03:51:46FromDiscord<Rika> then i dont know
03:51:49FromDiscord<Rika> array is a magic
03:51:54FromDiscord<Rika> you dont have much option
03:52:03FromDiscord<Sabena Sema> sigh I'll report the bug
03:56:00FromDiscord<Rika> OH
03:56:11FromDiscord<Rika> seems to compile
03:56:12FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Jcj
03:56:36FromDiscord<Sabena Sema> maybe it's because system.len for slices uses `Ord`
03:56:41FromDiscord<Rika> it does
03:56:47FromDiscord<Rika> i mean compile
03:56:49FromDiscord<Rika> it compiles
03:56:52FromDiscord<Sabena Sema> yeah
03:56:54FromDiscord<TryAngle> nim is such a sussy language 😳
03:56:56FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=3Jck
03:57:05FromDiscord<Sabena Sema> the len I was calling in my code was that one from system.nim
03:57:10FromDiscord<Rika> i know
03:57:20FromDiscord<Rika> its strange that it doesnt without the len
03:57:47FromDiscord<Sabena Sema> I will add your information to the bug report
03:57:52FromDiscord<Sabena Sema> and try after updating my compiler
04:00:47FromDiscord<TryAngle> I'm curious, in which cases do u want to force indexing from x to y instead of from 0 to x-y ?↵@Sabena Sema
04:00:58FromDiscord<TryAngle> (edit) "x-y" => "y-x"
04:01:42FromDiscord<Sabena Sema> none
04:01:53FromDiscord<Sabena Sema> I want indexing from 1..ncols
04:01:56FromDiscord<Sabena Sema> sometimes
04:02:03FromDiscord<Sabena Sema> but from 0..ncols-1 some other times
04:02:12FromDiscord<Sabena Sema> since in math it's traditional to index from one
04:03:13FromDiscord<TryAngle> ah I see
04:04:17FromDiscord<TryAngle> I did nimble develop in trymisc project↵and added it to requires in another nimble project↵why doesn't it get found? https://media.discordapp.net/attachments/371759389889003532/923425753482276894/unknown.png
04:04:41FromDiscord<Rika> idk, its found when i nimble develop then compile with nim
04:05:35FromDiscord<Sabena Sema> zero based indexing is kinda better for the usual ways
04:05:48FromDiscord<Sabena Sema> but if you're going between math and code frequently one based can be nice
04:05:56FromDiscord<Rika> eh both indexing schemes have its benefits and demerits
04:06:17FromDiscord<Sabena Sema> maybe I should just have a way to pass a pairing function in
04:06:33FromDiscord<Sabena Sema> that has other advantages
04:06:42FromDiscord<Sabena Sema> since you can store stuff diagonally and stuff
04:06:49FromDiscord<TryAngle> In reply to @Rika "idk, its found when": hmmm I would publish trymisc sooner or later anyways I think↵if I publish it now to use it, would I have to wait until the pull request gets accepted or does it get added automatically?
04:07:04FromDiscord<Rika> wait for the pull request afaik
04:07:15FromDiscord<TryAngle> I see
04:07:22FromDiscord<TryAngle> I guess I use nim then over nimble xd
04:07:54FromDiscord<Rika> i was looking into using other build systems like idk xmake (some dude advertised it here some time ago)
04:08:10FromDiscord<Sabena Sema> it's generally pretty easy
04:08:27FromDiscord<Sabena Sema> because generally nim projects just have one TU
04:08:36FromDiscord<Sabena Sema> the nim compiler could be a bit better about outputting deps
04:08:52FromDiscord<Sabena Sema> there is an option to do it but having it in .d format would be kinda nice
04:09:08FromDiscord<Rika> in what format
04:09:12FromDiscord<Sabena Sema> you'll need to integrate that into the build system if you want to avoid rerunning `nim` each time
04:09:20FromDiscord<Sabena Sema> `.d` it's a subset of GNU make format
04:09:30FromDiscord<Sabena Sema> it's what GCC outputs if you pass `-MD`
04:11:37*noeontheend joined #nim
04:41:43FromDiscord<TryAngle> how do I implement an iterator for a datastructure with a sequence internally that gets automatically used in for loops?
04:42:19FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jcr
04:45:12FromDiscord<Rika> What do you mean
04:45:21FromDiscord<TryAngle> wait I edit message
04:45:23FromDiscord<Rika> You mean the items iterator
04:45:32FromDiscord<Rika> Just make an iterator named items for the type
04:48:16FromDiscord<TryAngle> In reply to @Rika "Just make an iterator": I've never done anything with iterators...↵also how do I name the iterator that the for loop automatically uses it?
04:48:29FromDiscord<Rika> Literally just call it “items”
04:48:45FromDiscord<Rika> With input type of the vector type you have and any yield type
04:49:22FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jcs
04:49:31FromDiscord<Rika> Perfect
04:49:40FromDiscord<TryAngle> ok thanks 👍
04:54:37*rockcavera quit (Remote host closed the connection)
04:55:09FromDiscord<Elegantbeef> `type Vector[T] = distinct ref seq[T]` goes brr 😛
05:05:52FromDiscord<TryAngle> In reply to @Elegantbeef "`type Vector[T] = distinct": Ik that but I store extra things as well xd↵I do that for static version of vector for example with arrays
05:08:10FromDiscord<TryAngle> Does array[1, array[LEN, T]] have any overhead compared to just array[LEN, T]?
05:08:32FromDiscord<Elegantbeef> Afaik they're stored identically internally
05:08:39FromDiscord<TryAngle> That way I don't have to implement everything twice
05:09:21FromDiscord<TryAngle> In reply to @Elegantbeef "Afaik they're stored identically": 🤔
05:10:04FromDiscord<Rika> In reply to @TryAngle "🤔": ?
05:10:29FromDiscord<Elegantbeef> `array[1,T]` is contigious storage of `T`
05:21:33FromDiscord<TryAngle> Ok good to know 👍
05:22:57*noeontheend quit (Ping timeout: 240 seconds)
06:03:54FromDiscord<Rosen> Is there anyone in here who uses nvim + has a working nimlsp setup + is willing to share their init.vim?
06:04:19FromDiscord<Rosen> Going nuts trying to get completion working, or even just syntax highlighting that stays while i'm typing
06:23:30FromDiscord<Elegantbeef> @Rosen\: my messy nvim https://play.nim-lang.org/#ix=3JcN
06:24:17FromDiscord<Rosen> And your editing experience is smooth? Completion works as expected, etc?
06:24:26FromDiscord<Rosen> I think my issue might be with nimlsp then... that's unfortunate
06:24:29FromDiscord<Elegantbeef> It's not my daily driver but yes
06:38:38FromDiscord<Mrcool> I spent some time yesterday setting up nvim + coc + nim, I think its an ok setup now↵↵I only use alaviass nim plugin, and I installed nimlsp through nibmle and add it to coc settings for nim filea
06:39:49FromDiscord<Mrcool> The overrides and the no namespacing makes the completion a bit annoying (its full of duplicate and irrelevant items)
06:46:37*typnoking is now known as tinytim
06:50:44FromDiscord<Mrcool> But the experience is generally ok , I'm probably going to disable lsp completions though and keep other sources like buffer until it gets better
06:57:12FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JcS
06:57:31FromDiscord<Elegantbeef> `var`
06:58:27FromDiscord<TryAngle> oh 😂 ↵ty
07:00:52FromDiscord<Elegantbeef> I was meaning to make a PR that explicitly states "Atleast one mismatch is due to immutabillity"
07:16:14*Colt quit (Ping timeout: 260 seconds)
07:16:41*Colt joined #nim
07:39:52FromDiscord<TryAngle> is there a way to specialize in nim?
07:40:15FromDiscord<Elegantbeef> Use your small words
07:40:58FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JcY
07:41:20FromDiscord<TryAngle> the second proc should only be used for N != 1
07:41:37FromDiscord<Elegantbeef> `when n != 1:`
07:41:47FromDiscord<TryAngle> where do I put that?
07:42:53FromDiscord<Elegantbeef> In the proc
07:44:58FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JcZ
07:45:22FromDiscord<TryAngle> (edit) "https://play.nim-lang.org/#ix=3JcZ" => "https://play.nim-lang.org/#ix=3Jd0"
07:51:09FromDiscord<Elegantbeef> I meant dispatch inside it
07:53:24FromDiscord<Elegantbeef> Or w/e
07:53:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jd3
07:54:31FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jd4
07:54:55FromDiscord<TryAngle> they're not equal types
07:55:10FromDiscord<TryAngle> ah wait
07:55:21FromDiscord<TryAngle> the T can be another array
07:55:30FromDiscord<TryAngle> (edit) "the T can be another array ... " added "for SVector no?"
07:56:03FromDiscord<Elegantbeef> You mean SMatrix?
07:56:59FromDiscord<TryAngle> I should go to bed my brain doesn't work anymore idk anymore anything tbh 🥶
08:02:13FromDiscord<valerga> removed tooltips on hover on vscode, they only get in the way
08:04:18FromDiscord<valerga> `"editor.hover.enabled": false`
08:04:40FromDiscord<valerga> thought would be nice to summon the tooltip on demand
08:04:43FromDiscord<valerga> (edit) "thought" => "though"
08:06:07*PMunch joined #nim
08:32:52FromDiscord<Sabena Sema> huh I bet that would fix my array range problem
08:33:09FromDiscord<Sabena Sema> and arrays of arrays aren't really a sin like seq[seq]] is
08:33:56FromDiscord<Sabena Sema> For (dense) matrices and vectors it's generally better to do array[NM, T] rather than array[N, array[N, T]]
08:34:07FromDiscord<Sabena Sema> or it's more typical
08:34:19FromDiscord<Sabena Sema> for fixed size matrices it probably doesn't matter much
08:39:04FromDiscord<TryAngle> In reply to @Sabena Sema "For (dense) matrices and": I don't think array of arrays add an overhead 🤔
08:39:16FromDiscord<Sabena Sema> yeah, it's not bad for fixed size
08:39:24FromDiscord<TryAngle> maybe in Java and C arrays werent' even arrays
08:39:26FromDiscord<Sabena Sema> seq[seq] the questionable one
08:39:30FromDiscord<Elegantbeef> The issue is with seqs since you're dealing with indirection
08:39:31FromDiscord<TryAngle> so maybe that's why the other thing is common
08:39:52FromDiscord<Sabena Sema> well, it's easy enough to do the indexing
08:40:02FromDiscord<Sabena Sema> but yeah
08:40:26FromDiscord<TryAngle> yes I also use it for my "dynamic" matrices
08:40:40FromDiscord<Sabena Sema> carry on then
08:41:10FromDiscord<Sabena Sema> nothing actually wrong with it for fixed size, I just see it a _lot_ with dynamic sized
08:41:13FromDiscord<Sabena Sema> esp C programmers
08:41:17FromDiscord<TryAngle> (edit) "yes I also use it for my "dynamic" matrices ... " added "the [i row + j] or [j col + i] thingy"
08:42:06FromDiscord<Elegantbeef> Speaking of the formula, isnt the math just so wonderful for the index, it doesnt rely on the height of the container
08:42:25FromDiscord<TryAngle> anybody knows how this operation is called? https://media.discordapp.net/attachments/371759389889003532/923495746651697163/unknown.png
08:42:37FromDiscord<Sabena Sema> sure it does, it's colsy+x
08:42:41FromDiscord<Sabena Sema> or colsx+y
08:42:53FromDiscord<Sabena Sema> (edit) "colsx+y" => "rowsx+y"
08:43:10FromDiscord<Sabena Sema> or any number of other things
08:43:41FromDiscord<qb> What is `cstring`'s equivalent of `setLen`?
08:43:59FromDiscord<Elegantbeef> It only needs the size of one dimension is the thing i like
08:44:11FromDiscord<Elegantbeef> `create(char, size)`
08:44:18FromDiscord<TryAngle> In reply to @TryAngle "anybody knows how this": in numpy that's matrix + vector but I don't understand how
08:44:24FromDiscord<Elegantbeef> `cstring` is a `ptr char` so it kinda deeppends
08:44:53FromDiscord<Elegantbeef> You must be tired try
08:45:20FromDiscord<Rika> In reply to @TryAngle "anybody knows how this": Addition?
08:45:28FromDiscord<Rika> Matrix vector addition?
08:46:01FromDiscord<Rika> What exactly do you want to know about it
08:46:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jdo
08:46:12FromDiscord<Sabena Sema> you can also index by `(0.5 (x + y -1)(x+y)(x)` I think
08:46:13FromDiscord<Elegantbeef> Oh how it's called 😀
08:46:15FromDiscord<Sabena Sema> if you are insane
08:46:28FromDiscord<Sabena Sema> except without the floating point
08:46:56FromDiscord<TryAngle> omg
08:47:00FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jdp
08:47:07FromDiscord<TryAngle> I can't add
08:47:09FromDiscord<TryAngle> anymore
08:47:12FromDiscord<Elegantbeef> Is this sarcasm or did you miss that
08:47:15FromDiscord<TryAngle> ....
08:47:32FromDiscord<TryAngle> -1.79 + 3 != 1.21 in my head
08:47:37FromDiscord<TryAngle> so It hought it's different
08:47:40FromDiscord<TryAngle> ????
08:47:40FromDiscord<Elegantbeef> Ah
08:47:53*neurocyte0132889 joined #nim
08:47:53*neurocyte0132889 quit (Changing host)
08:47:53*neurocyte0132889 joined #nim
08:47:55FromDiscord<Elegantbeef> Yea i was confused for a minute but it's just row addition
08:48:04FromDiscord<Elegantbeef> Or column, whatever the fucking stupid arbitrary term is
08:48:09FromDiscord<TryAngle> that's it I go to bed gn guys
08:48:10FromDiscord<Rika> I recommend going back to grade school 😛
08:48:35FromDiscord<TryAngle> In reply to @Rika "I recommend going back": I'm engineering & bioinformatics undergrad 😔
08:48:47FromDiscord<Sabena Sema> real mathematicians can't do arithmetic, as a rule
08:49:03FromDiscord<Sabena Sema> (they also can't write comments in their code, a separate issue)
08:49:06FromDiscord<Elegantbeef> Here i am "high school graduate" 😛
08:49:33FromDiscord<Rika> I’m taking an undergrad but I’m only around halfway there so far
08:49:49FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/issues/19284 is this you try? Or was there another similar conversation?
08:49:59FromDiscord<Sabena Sema> eyp I opened that
08:50:10FromDiscord<Elegantbeef> Ah
08:50:11FromDiscord<Elegantbeef> Looking at it now
08:50:18FromDiscord<Rika> The rika that answered is totally not me though
08:50:50FromDiscord<Sabena Sema> nope, that was you
08:50:55FromDiscord<Sabena Sema> you pointed out the working snippet
08:51:04FromDiscord<Elegantbeef> JokesSabena's' head
08:51:09FromDiscord<Rika> Lol
08:51:40FromDiscord<Sabena Sema> huh?
08:51:56FromDiscord<Rika> I was joking ;;
08:52:29FromDiscord<Sabena Sema> oh, totally over my head
08:55:57*neurocyte0132889 quit (Ping timeout: 268 seconds)
08:57:46FromDiscord<Elegantbeef> Oh seems like the issue is it doesnt properly generate a generic proc
08:58:32FromDiscord<Sabena Sema> that's bizarre
08:59:05FromDiscord<Elegantbeef> Well it goes through `staticExpr` so perhaps this tree doesnt know how to generate generic procs
08:59:38FromDiscord<Elegantbeef> Or a flag just isnt passed
09:05:10FromDiscord<Sabena Sema> yeah but the fact it works with a custom len function
09:06:53FromDiscord<Elegantbeef> It works if it comes from the same module
09:06:58FromDiscord<Elegantbeef> That's interesting
09:07:18FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Jdw is the direct copy of the system version
09:07:47FromDiscord<Elegantbeef> I do know when the code runs with the dud version `result` is an ident and `max` is an `openSym` which means it's not instantiated as you well know
09:08:30FromDiscord<Elegantbeef> So it seems like it's an issue with a generic from another module causing it not be semmable
09:11:38FromDiscord<qb> https://play.nim-lang.org/#ix=3JdA
09:11:48FromDiscord<qb> How could I avoid this issue without removing the setlen?
09:12:14FromDiscord<Elegantbeef> You cant really
09:12:32FromDiscord<qb> aw
09:12:47FromDiscord<Elegantbeef> Well i mean you can always find the overlap
09:14:12FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3JdC
09:14:30FromDiscord<Elegantbeef> I guess `getPrefixOverlap` makes the most sense
09:18:23FromDiscord<Elegantbeef> If what you're looking for is a static phrase you can do `startsWith` or w/e it's called in `strutils`
09:19:39FromDiscord<Zajt> How do I get the current process handle in Nim?↵In c++, you would do like this `(HANDLE)-1` but what would I use in Nim to do the same thing?
09:20:54FromDiscord<Rika> ?
09:20:57FromDiscord<Rika> Did someone send something here
09:21:18FromDiscord<Elegantbeef> Yes they then deleted it
09:21:33FromDiscord<Elegantbeef> Was about PID getting on windows
09:21:47FromDiscord<Rika> I see
09:22:50FromDiscord<Zajt> Yeah one sec, rewriting my question
09:24:02FromDiscord<Zajt> I got this line `DuplicateHandle(hParentProcess, (HANDLE)-1, GetCurrentProcess(), addr hDup, 0, FALSE, DUPLICATE_SAME_ACCESS)`↵which I converted from c++ but (HANDLE)-1 is c++ which is why I get this error `Error: type mismatch: got <type HANDLE, int literal(1)>`↵To solve it, should I replace it with GetCurrentProcess() as well, same as the third argument?
09:25:05FromDiscord<Elegantbeef> `HANDLE` is a type is the issue
09:25:35FromDiscord<Elegantbeef> So yes you should probably use that proc as it returns what you need
09:26:44*Vladar joined #nim
09:27:09FromDiscord<qb> Could I get the string size of 3 for "foo" even if I used setLen(50)?
09:27:39FromDiscord<Zajt> In reply to @Elegantbeef "So yes you should": thanks will use that instead
09:27:40FromDiscord<Elegantbeef> You can iterate until you find the first whitespace or control character
09:27:48FromDiscord<Elegantbeef> The issue is that it's not reliable if this is a random string
09:30:27FromDiscord<qb> >.<
09:31:02FromDiscord<Rika> There's a reason nim tracks the length unlike in c traditionally
09:31:23FromDiscord<Zajt> How would I convert this c++ line to Nim?↵`LARGE_INTEGER sectionSize = { size };`
09:31:26FromDiscord<Rika> \0 is a valid character in non-text strings (by the way pls don't do that)
09:31:42FromDiscord<Rika> Use seq byte if you need to store bytes...
09:31:44FromDiscord<Elegantbeef> `var sectionSize = size`?
09:31:59FromDiscord<Zajt> what type should sectionSize variable be?
09:32:21FromDiscord<Elegantbeef> I dont know what LargeInteger is
09:32:27FromDiscord<Elegantbeef> Sounds like a fixed size int64
09:32:54FromDiscord<Elegantbeef> https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-large_integer-r1
09:32:59FromDiscord<Elegantbeef> So it should be a union
09:33:38FromDiscord<Elegantbeef> https://github.com/khchen/winim since you're using winapi's you may want that
09:34:07FromDiscord<Zajt> yeah I have imported that one
09:34:13FromDiscord<Zajt> (edit) "yeah I have imported that one ... " added "`import winim`"
09:35:06FromDiscord<Elegantbeef> Well i dont know how to make a large integer using it there are probably helper procs
09:35:38FromDiscord<qb> how dangerous and dirty is that? https://play.nim-lang.org/#ix=3JdI
09:35:50FromDiscord<Zajt> sent a code paste, see https://play.nim-lang.org/#ix=3JdJ
09:35:51FromDiscord<Elegantbeef> Very
09:36:02FromDiscord<Zajt> since I use that format to define multiple variables in one section of the code, then assign them later on
09:36:16FromDiscord<Elegantbeef> Like i said there is probably a helper proc to do this
09:36:23FromDiscord<Elegantbeef> I dont know winim so i dont know how
09:37:13FromDiscord<Elegantbeef> Look for the Large\_Integer definition then see if there are any procs that return ti
09:40:00FromDiscord<qb> https://play.nim-lang.org/#ix=3JdK
09:40:02*kayabaNerve quit (Remote host closed the connection)
09:40:38*kayabaNerve joined #nim
09:40:49FromDiscord<Elegantbeef> So many assumptions made here 😀
09:41:27FromDiscord<Rika> Len of a cstring is already dependent on \0 placement
09:41:40FromDiscord<Rika> No need to make that function again
09:42:14FromDiscord<Elegantbeef> I mean they've grown their string with empty data then are shrinking it after
09:42:19FromDiscord<Elegantbeef> Personally i dont get what they're doing
09:44:13FromDiscord<qb> b is a buffer of a c function and I need to compare that buffer to regular nim strings
09:44:38FromDiscord<qb> https://github.com/qb-0/NimbleImGui/blob/main/src/ui.nim#L127
09:46:27FromDiscord<qb> If I don't give that buffer some space I get a segfault
09:56:31FromDiscord<Elegantbeef> I dont get it all of your code uses strings here
10:02:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JdP
10:14:08FromDiscord<TryAngle> can forloops be run at comptime?
10:14:14NimEventerNew Nimble package! nordaudio - A small wrapper around PortAudio for cross-platform audio IO., see https://github.com/Psirus/nordaudio
10:14:32FromDiscord<Elegantbeef> Do you mean unrolled or just "can i use iterators at compile time"?
10:14:43FromDiscord<TryAngle> iterators at compile time
10:14:52FromDiscord<Elegantbeef> Inline iterators work yes
10:14:56FromDiscord<Elegantbeef> Closue i believe do not
10:22:12FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JdU
10:24:23FromDiscord<TryAngle> and, does range have a step function?
10:24:27FromDiscord<TryAngle> (edit) removed "and,"
10:24:45FromDiscord<Elegantbeef> `countUp(a, b, step)`
10:25:17FromDiscord<TryAngle> ty
10:40:27FromDiscord<qb> In reply to @Elegantbeef "So instead of doing": Silly stuff 😄 well that one ends in a indexdefect atm.
10:40:48FromDiscord<Elegantbeef> `0 .. <20`
10:40:59FromDiscord<Elegantbeef> Off by one is fun
10:41:25FromDiscord<Elegantbeef> Anywho i sleep now so forward all your complaints to the nearest seal
10:42:30FromDiscord<qb> Thank you as usual ;D gn
10:48:55*xet7 quit (Remote host closed the connection)
10:50:07*xet7 joined #nim
10:51:24FromDiscord<Zajt> sent a code paste, see https://play.nim-lang.org/#ix=3Jef
10:52:38FromDiscord<Rika> Because it's defined as one in whatever library you're using
10:52:44FromDiscord<Rika> Handles are integers in general
10:53:38FromDiscord<TryAngle> In reply to @Elegantbeef "`countUp(a, b, step)`": ah I need somethign that works for floats aswell
10:56:41FromDiscord<Zajt> In reply to @Rika "Because it's defined as": okay so I should but INT instead of HANDLE in the variable definition there?
10:57:45FromDiscord<Rika> No
10:59:23FromDiscord<Zajt> What's the correct way to solve this error then?
10:59:26FromDiscord<TryAngle> In reply to @Zajt "I have these lines": Why not use std/options?
10:59:59FromDiscord<Rika> You should set to 0 and not null
11:00:25FromDiscord<TryAngle> Isn't it already set to 0 if it's a numeric?
11:00:43FromDiscord<Rika> Yeah but if you want to be explicit
11:06:23FromDiscord<Zajt> I see, that fixed it nice. On another line, I am using a function which expects a large integer (int64), and right now in that argument, I put a 0 but it didn't like that. What other value can I put instead?
11:06:47FromDiscord<Zajt> (edit) "it nice. On another line, I am using a function which expects a large integer (int64), and right now in that argument, I put a 0 but it didn't like that. What other value can I put instead?" => "it!"
11:08:55*neceve joined #nim
11:32:42FromDiscord<lumi> how do I fix this warning? `implicit conversion to 'cstring' from a non-const location`
11:33:13FromDiscord<lumi> nvm, manually casting is make the compiler happy
11:33:19FromDiscord<lumi> (edit) "make" => "makes"
12:06:42FromDiscord<tandy> i wonder if futhark can wrap ffmpeg
12:49:11FromDiscord<Zajt> Why do I get this when compiling my nim code on Linux ? Isn't windows.h correct to use on Linux? I've used it before https://media.discordapp.net/attachments/371759389889003532/923557853913022474/unknown.png
13:06:08FromDiscord<exelotl> I think you could only use windows.h if you were using a cross-compiler e.g. `mingw-w64-i686-gcc` to build for windows
13:06:36FromDiscord<exelotl> then you could run the compiled program in Wine
13:12:16*rockcavera joined #nim
13:12:16*rockcavera quit (Changing host)
13:12:17*rockcavera joined #nim
13:25:59FromDiscord<gogolxdong (liuxiaodong)> Who can bough me a $6 vultr instance so that we can pay via crypto afterwards? We can pay the twice of buying instance.
13:33:16FromDiscord<gogolxdong (liuxiaodong)> It requires credit card or paypal for the first deposit, it supports Alipay as well , we are concerned with the privacy protection though.
13:33:24FromDiscord<Zajt> In reply to @exelotl "I think you could": I see, is it possible to compile with this line in an external file that I import from my main nim file?
13:33:57FromDiscord<Zajt> The nim file that I import looks like this at the top which has that windows.h line v
13:34:01FromDiscord<Zajt> (edit) removed "v"
13:34:03FromDiscord<Zajt> https://media.discordapp.net/attachments/371759389889003532/923569142752239646/unknown.png
13:38:32FromDiscord<Zajt> Nvm I solved it by adding `--cpu:amd64 --os:windows --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc`
13:43:22FromDiscord<gogolxdong (liuxiaodong)> or we can buy someone's Vultr account which has been verified and raised limit of cost.
13:46:27FromDiscord<gogolxdong (liuxiaodong)> which is free to pay via crypto.
13:53:18FromDiscord<gogolxdong (liuxiaodong)> We'd like to pay $100 for such account and pay in advance.
14:03:44FromDiscord<Zajt> What's the correct way to echo out a pointer to variable of type handle?
14:04:06FromDiscord<Zajt> (edit) "What's the correct way to echo out a pointer to variable of type handle? ... " added " (for debugging purposes)"
14:05:51FromDiscord<enthus1ast> `repr` can debug print pointers
14:06:08FromDiscord<enthus1ast> or what i like to use lately is treeforms/print
14:09:56FromDiscord<Zajt> I ran this `echo fmt"[DEBUG] Section base address: {repr(sectionHandle)} "` but it didn't make any differece
14:20:18FromDiscord<retkid> heyyyy how do i sort a sequence of sequences
14:21:13*arkurious joined #nim
14:21:30FromDiscord<retkid> i kinda just wanna lambda into it and do ↵↵x.sort(a=>system.cmp(a[3]))
14:21:34FromDiscord<retkid> or something like that
14:59:21FromDiscord<Solitude> https://nim-lang.org/docs/algorithm.html#sort%2CopenArray%5BT%5D%2Cproc%28T%2CT%29
15:00:40*Vladar quit (Quit: Leaving)
15:14:57NimEventerNew thread by Lyhokia: Manipulating varargs in compile time (like what lua do in runtime)?, see https://forum.nim-lang.org/t/8729
15:18:21FromDiscord<retkid> In reply to @Solitude "https://nim-lang.org/docs/algorithm.html#sort%2Cope": the sugar syntax is the real mvp hjere
15:25:09*PMunch quit (Quit: Leaving)
17:26:54FromDiscord<Alea> does += not work for floats?
17:26:56FromDiscord<Alea> https://media.discordapp.net/attachments/371759389889003532/923627748558270464/unknown.png
17:27:48FromDiscord<Alea> wait nvm
17:36:09nrds<Prestige99> Hm?
17:37:51nrds<Prestige99> @Alea https://play.nim-lang.org/#ix=3Jgz
17:44:03FromDiscord<eyis> sent a code paste, see https://play.nim-lang.org/#ix=3JgA
17:44:07FromDiscord<Alea> yeah sorry, forgot that I used let instead of var
17:44:20FromDiscord<Alea> the error message was misleading
17:44:30nrds<Prestige99> No worries
17:44:56nrds<Prestige99> Yeah that is a pretty bad error message
17:46:31FromDiscord<Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3JgB
17:46:44FromDiscord<Solitude> In reply to @eyis "How do I do": https://nim-lang.github.io/Nim/tut1.html#advanced-types-reference-and-pointer-types
17:52:32FromDiscord<eyis> I see, thanks, and how to I get a reference to a an existing `Node`?
17:53:02FromDiscord<eyis> or do I need to have all my objects declared as `ref object` to do that?
17:55:26FromDiscord<Solitude> yes, you can remove `ref` from the field then
17:56:59FromDiscord<eyis> okay, thanks again :D
18:02:44FromDiscord<Smarc> Does anyone have a clue, why my program is not recognizing a check if the Rook is standing right west of the king? A test where the Rook stands right south of the king works fine, I just don't really get it. https://github.com/Smarcy/nim_chess/blob/master/tests/test_move.nim#L648
18:03:09FromDiscord<Smarc> The isChecked proc is here: https://github.com/Smarcy/nim_chess/blob/master/src/nim_chess/model/board.nim#L76
18:04:12FromDiscord<Smarc> (You can see the behaviour by running 'nimble test')
18:06:09FromDiscord<Smarc> My guess would be that the 'isChecked' proc has issues with checking for check if the checking-Piece is on the board-edge.. But I can't figure out how to fix that
18:17:15*anadahz joined #nim
18:18:16anadahzHi! I am trying to deploy Nim packages locally (https://github.com/nim-lang/packages). Any suggestions on how to do this?
18:22:05nrds<Prestige99> Do you mean adding a package to nimble?
18:23:42anadahz@Prestige No, I mean running the nimble.directory
18:32:18NimEventerNew post on r/nim by PrettySeriousUser: Chess Logic Issue, see https://reddit.com/r/nim/comments/rn20pp/chess_logic_issue/
18:32:54FromDiscord<lkioi> Is there a way to parse a pdf in nim like pypdf2 does?
18:36:21nrds<Prestige99> Hm anadahz @dom96 might be the person to ask about that
18:36:30nrds<Prestige99> if he's around
18:39:21anadahz@dom96 Hi, do you know how to deploy nimble.directory? I like how simple it is and I would like to use for indexing other types of packages (not necessary nim).
18:39:31anadahz(thx @Prestige)
18:44:07FromDiscord<Mango IV.> If I have a `var seq[seq[int]]` why is the inner sequence always immutable? Can I have any nested mutable datastructure?
18:47:05nrds<Prestige99> off topic but if you want a 2D sequence I recommend having it be a single seq with helper functions, e.g. https://github.com/avahe-kellenberger/maze_bench_nim/blob/master/src/seq2d.nim
18:48:22FromDiscord<Mango IV.> well, of course that's one way to do it, but I feel like that would be severely less expressive.
18:48:58nrds<Prestige99> not really because you can do something like mySeq[x, y] = 5
18:50:15FromDiscord<Mango IV.> Ok, I just looked a the code. I'm still very new and it confuses me that this language has so many possibilities to just write missing parts of the language yourself :D ↵Is there a standard lib that has this?
18:50:17FromDiscord<qb> Why is the inner sequence immutable?
18:50:46FromDiscord<Mango IV.> sent a code paste, see https://play.nim-lang.org/#ix=3Jh2
18:52:25FromDiscord<qb> Guess your issue is somewhere else: https://play.nim-lang.org/#ix=3Jh3
18:52:29FromDiscord<qb> But im a newbie aswell 😛
18:53:34FromDiscord<enthus1ast> If there is no library available yet (which I don't know) you could always call out to a terminal application like mupdf/mutools↵(@lkioi)
18:53:58FromDiscord<Mango IV.> In reply to @qb "But im a newbie": that's not about the mutability of the data structure but of the immutability of the elements of the datastructure.
18:54:57FromDiscord<Solitude> In reply to @Mango IV. "that's not about the": show code
18:55:13FromDiscord<Mango IV.> sent a code paste, see https://play.nim-lang.org/#ix=3Jh5
18:55:17FromDiscord<Mango IV.> It's probably my mistake then.
18:55:21nrds<Prestige99> I think qb's example made sense - he was able to modify an inner value
18:56:10nrds<Prestige99> I wonder if I should submit this Seq2D thing to be part of the stdlib
18:58:02FromDiscord<Mango IV.> sent a code paste, see https://play.nim-lang.org/#ix=3Jh6
18:58:19FromDiscord<Mango IV.> (edit) "https://play.nim-lang.org/#ix=3Jh6" => "https://play.nim-lang.org/#ix=3Jh7"
18:59:29FromDiscord<Solitude> ` for basin in areas:`↵basin is immutable
18:59:39FromDiscord<Solitude> use mitems
19:00:03FromDiscord<Smarc> Does nobody have a clue for my issue? Or should I provide any more informations?
19:02:08FromDiscord<Mango IV.> In reply to @Solitude "use mitems": worked beautifully, thanks. What is the motivation behind making those immutable by default?
19:12:43FromDiscord<Solitude> for easier tracking of mutations?
19:17:11*xet7 quit (Ping timeout: 250 seconds)
19:29:55*xet7 joined #nim
19:38:40*xiamx[m] joined #nim
19:39:01FromDiscord<Rosen> It's nice to be certain that you're not mutating what you're looking over if you don't specifically ask for mutation
19:59:15xiamx[m]I might be still missing the answer after some google searches, can nim do static analysis to suggest replacing var with let when it knows the value doesn't change?
20:14:45NimEventerNew post on r/nim by geckosarecool: Here's my interpreter, compiler and transpiler of brainfuck! Supports 3 languages and 8 targets, see https://reddit.com/r/nim/comments/rn48zf/heres_my_interpreter_compiler_and_transpiler_of/
20:22:05FromDiscord<Smarc> I'll start a last try to get maybe at least a hint for my problem, so I'll link the reddit post. I really would appreciate some insights. I can provide more info if neede of course :/↵https://www.reddit.com/r/nim/comments/rn20pp/chess_logic_issue/
20:27:22FromDiscord<Yardanico> did you post on the forum? that's the first place you need to post in if you want help with some bigger project
20:27:32FromDiscord<Yardanico> https://forum.nim-lang.org/
20:30:06FromDiscord<Smarc> Gonna post it there as well, thank you!
20:31:48NimEventerNew thread by Smarc: Chess logic issue, see https://forum.nim-lang.org/t/8730
20:35:06FromDiscord<Yardanico> In reply to @Smarc "I'll start a last": ill check it out
20:35:11FromDiscord<Yardanico> try to see if there's anything obvious
20:37:33FromDiscord<Smarc> Appreciate that a lot! I'm sure it is quiet obvious for someone who is more skilled than me
20:38:03FromDiscord<Smarc> Actually the 'isChecked' proc seems to not work properly
20:39:32FromDiscord<Smarc> I just can't wrap my head around how to do it correctly
20:56:51FromDiscord<Yardanico> @Smarc do your coordinates go from 0,0 to 7,7 ?
20:57:03FromDiscord<Yardanico> i mean xPos and yPos
20:57:24FromDiscord<Smarc> yes
20:57:34FromDiscord<Smarc> [0][0] = a8
20:57:40FromDiscord<Yardanico> but then why do you check < 7 in your `while` on line 87
20:57:43FromDiscord<Yardanico> shouldn't it be < 8 ?
20:57:57FromDiscord<Yardanico> since if you do < 7 you discard all results where some coordinate is 7
20:57:59FromDiscord<Yardanico> either x or y
20:58:26FromDiscord<Yardanico> ` while (currX > 0 and currX < 7) and (currY > 0 and currY < 7):` shouldn't it be `currX <= 7` or `currX < 8` and same for y?
20:59:36FromDiscord<Yardanico> i made the change but then other tests started failing for some reason
20:59:39FromDiscord<Yardanico> and this one too
20:59:54FromDiscord<Smarc> ye, other tests are failing including the one that was before :/
20:59:57FromDiscord<Smarc> I just don't get it
21:00:03FromDiscord<Smarc> But the error has to be in this proc
21:00:04FromDiscord<Yardanico> yes, but maybe you were checking coords the wrong way before :D
21:00:06*vicfred joined #nim
21:00:43FromDiscord<Smarc> maybe the while condition is wrong?
21:01:13FromDiscord<Yardanico> well it runs the body while _both_ cords are in bounds
21:01:22FromDiscord<Yardanico> when one of the coords gets outs of the bounds it doesn't iterate any more
21:02:00FromDiscord<Smarc> Ye I thought about that, but had no clue how to fix that
21:02:37FromDiscord<Smarc> if I just change the `and` for `or` it goes OutOfBounds
21:03:08FromDiscord<Yardanico> yes, but I didn't say that your way of checking is wrong
21:03:14FromDiscord<Yardanico> I just explained what the `while` does
21:06:27FromDiscord<Yardanico> In reply to @Smarc "if I just change": wait, I'm not sure if I'm right but maybe I am
21:06:44FromDiscord<Yardanico> it seems like you don't check if the enemy piece is obstructed by another enemy piece?
21:06:51FromDiscord<Yardanico> in isChecked
21:07:13FromDiscord<Yardanico> you only check for "If a friendly piece is blocking sight, stop looking in that direction" so if an enemy queen is obstructed by enemy pawn your algo still returns true
21:07:20FromDiscord<Yardanico> that's why tests started failing after I fixed the while condition
21:08:45FromDiscord<Smarc> Yes, the proc is far from ready, right now I only wanted to check for Rook or Queen standing right beneath the king
21:08:51FromDiscord<Smarc> with dist=1
21:09:14FromDiscord<Yardanico> well idk, I'm just sharing what I found
21:09:23FromDiscord<Yardanico> "black king all directions without captures" is the first failing test with fixed while condition
21:11:49FromDiscord<Smarc> If I comment out most of the move instructions it is green actually
21:11:52FromDiscord<Smarc> I don't get it
21:12:05FromDiscord<Yardanico> In reply to @Smarc "If I comment out": because your `move` calls `isChecked`
21:12:25FromDiscord<Yardanico> and before the while fix you simply ignored the last coordinate
21:12:33FromDiscord<Smarc> L329 is the one that lets it fail
21:12:51FromDiscord<Yardanico> yes, but as I said, that's because your `move` calls `isChecked`
21:13:08FromDiscord<Yardanico> and your algo returns `true` if a king is "checked" by a queen obstructed by a pawn
21:13:49FromDiscord<Smarc> oh so you mean the king is checked over the whole board because its on the same file as the queen, although a pawn is in the way? Do I get that right?
21:13:53FromDiscord<Yardanico> yes
21:14:02FromDiscord<Yardanico> because you don't check if an enemy piece is obstructed by another enemy piece
21:14:06FromDiscord<Yardanico> you only do that check for friendly pieces
21:14:12FromDiscord<Smarc> Ahh
21:14:20FromDiscord<Smarc> Lets see if I can fix that somehow
21:15:18FromDiscord<Smarc> Hm, how would I do that without actually crashing the isChecked? If I just check the color it would not recognize any check i guess
21:21:53FromDiscord<Smarc> ` if (currPiece.color != this.color) and not(currPiece of Rook) and↵ not(currPiece of Queen):↵ break↵`
21:21:56FromDiscord<Smarc> Seems to do the trick
21:22:19FromDiscord<Smarc> Remember right now it is just for checking Rook/Queen checks
21:22:31FromDiscord<Smarc> But still the last test is failing
21:22:42FromDiscord<Smarc> although I fixed the while
21:26:56*xet7 quit (Ping timeout: 252 seconds)
21:27:43FromDiscord<Smarc> I'm so confused :/
21:30:48FromDiscord<Smarc> Now it does not even recognize a check where an enemy rook is on the same file as the enemy king without any piece in the way ..
21:35:49FromDiscord<TryAngle> what is more idiomatic?↵assert or if + raise Exception
21:37:51FromDiscord<Solitude> assertions throw AssertionDefect. if it fits your case then use it.
21:39:35*xiamx[m]1 joined #nim
21:40:43*xet7 joined #nim
21:41:05FromDiscord<demotomohiro> Use assert for expressions that always true as long as your program doesn't have a bug.
21:42:39FromDiscord<evoalg> In reply to @xiamx "I might be still": From what I'm lead to believe (and I don't know much), although the compiler can do many optimizations behind the scenes, there is no difference between `var` and `let` (when there are no attempts to assign to mutate a `let` variable) as they are for the programmer (to catch unintended assignments) rather than for compiler optimization ... in a working program you can replace all the `let`'s with `
21:42:59FromDiscord<demotomohiro> if + raise for checking runtime error even if you your program doesn't have bug.
21:46:11xiamx[m]1FromDiscord: Yeh I understand that I can replace these on my own. Though just wondering if there are programs that help me ident these.
21:46:42FromDiscord<evoalg> In reply to @xiamx "FromDiscord: Yeh I understand": ahh sorry I misread ... yea that would be nice
21:49:03FromDiscord<evoalg> and func's instead of proc's ... but only as an option that's not on by default
21:50:49*noeontheend joined #nim
22:29:37*noeontheend quit (Ping timeout: 240 seconds)
22:31:40FromDiscord<TryAngle> @ElegantBeef wait remember when I asked how to impl something only for N == 1 and the rest for N > 1 ?
22:31:57FromDiscord<TryAngle> can't I just define a type that goes from 2 to high(int)
22:31:58FromDiscord<TryAngle> ?
22:34:20*PMunch joined #nim
22:34:26FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JhX
22:36:12FromDiscord<Elegantbeef> I suppose you could
22:42:26*PMunch quit (Quit: Leaving)
22:44:14*audiophile_ joined #nim
22:48:30FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JhY
22:48:43FromDiscord<TryAngle> (edit) "https://play.nim-lang.org/#ix=3JhY" => "https://play.nim-lang.org/#ix=3JhZ"
22:49:34FromDiscord<Elegantbeef> You can do `proc doThing(a: AVector or SVector): auto`
22:49:53FromDiscord<Elegantbeef> Though if you use the type information you need to do `a.type.T` or `a.type.N`
22:51:03FromDiscord<TryAngle> In reply to @Elegantbeef "You can do `proc": doesnt' it require the N: static[int]?
22:51:27FromDiscord<Elegantbeef> No those are composite type classes iirc
22:51:39FromDiscord<Elegantbeef> Nim allows generics to drop `[]` and will infer it
22:52:12FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Ji0
22:52:27FromDiscord<TryAngle> or even leave out the T also?
22:52:30FromDiscord<Elegantbeef> Not what i meant you need `N` for sVector
22:52:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Ji1
22:53:14FromDiscord<TryAngle> ah I see
22:53:40FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Ji2
22:53:46FromDiscord<Elegantbeef> Yes it should
22:53:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Ji3
22:53:53FromDiscord<TryAngle> ok I'll try thanks
22:54:04FromDiscord<Elegantbeef> That's a typeclass of composite type classes
22:54:52FromDiscord<Elegantbeef> Composite typeclasses are very useful when you dont need the type parameters or if they have the same API
22:55:04FromDiscord<TryAngle> ah wait I just noticed lol↵I can't do that anyways because I need to initialize the seq for AVector anyaywas...
22:55:29FromDiscord<Elegantbeef> I dont follow
22:57:50FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Ji5
22:58:22FromDiscord<TryAngle> while with `SVector`, I can directly edit the result because the length is known at compile time
22:58:27FromDiscord<Elegantbeef> I dont see how that's an issue, you can do per type logic like i showed above
22:58:53FromDiscord<Elegantbeef> But if everything is different there is no reason to make them all in a single proc
22:58:55FromDiscord<TryAngle> In reply to @Elegantbeef "I dont see how": of course but that's essentially still two impls of the same thing in my case
22:59:04FromDiscord<TryAngle> t_t
22:59:27FromDiscord<Elegantbeef> Yea if the entire logic has 0 overlap then two overloaded procs is best
22:59:37FromDiscord<Elegantbeef> Otherwise use type conditional logic
23:00:35FromDiscord<TryAngle> if there only was a way to infer size of a seq at compile time 🤔 ↵does that even make sense, from a compiler perspective?
23:10:40*xet7 quit (Ping timeout: 268 seconds)
23:17:18FromDiscord<Elegantbeef> One could technically figure out if a seq depends on runtime information and if not replace it with an array
23:18:01FromDiscord<Elegantbeef> But that requires a ton of fun logic and reasoning
23:22:19*xet7 joined #nim
23:27:07FromDiscord<kaddkaka> God Jul! 🙂 New nimmer here 👋 ↵How do I iterate over an array in reverse order?
23:28:12FromDiscord<Elegantbeef> https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L42-L50 there is no built in way but you can easily make an iterator or use a package that provides it
23:31:16FromDiscord<kaddkaka> In reply to @Elegantbeef "https://github.com/beef331/slicerator/blob/master/s": Is that a package that is packaged with nim, or more of an example?
23:31:53FromDiscord<Elegantbeef> It's a package on git you can use if you want, but you can always just copy my code and paste it
23:32:15FromDiscord<Elegantbeef> I'm not going to hunt down people that dont abide by the MIT license in a small regard 😀
23:34:18FromDiscord<Elegantbeef> If you were to want to use it since it's not in nimble you'd `nimble install https://github.com/beef331/slicerator` then `import slicerator`, though i think there are nimble packages that do it
23:35:38FromDiscord<Leonardo da Vinci> Random question
23:35:54FromDiscord<Leonardo da Vinci> can i use OpenGL or SDL2 with Nim?
23:36:16FromDiscord<demotomohiro> Yes
23:36:52FromDiscord<Elegantbeef> It's a system language if you could'nt we'd be in big trouble
23:38:15FromDiscord<demotomohiro> https://nimble.directory/↵Search opengl or sdl
23:38:35FromDiscord<Leonardo da Vinci> Thanks bro!
23:39:27FromDiscord<demotomohiro> There are 3 or more OpenGL bindings for Nim.
23:41:00FromDiscord<kaddkaka> In reply to @Elegantbeef "It's a package on": thanks! 🙂 btw, are you a bot? o.O
23:41:12FromDiscord<Elegantbeef> I'm using the matrix bridge
23:41:22FromDiscord<Elegantbeef> So i'm just infinitely cooler
23:41:44FromDiscord<Elegantbeef> Atleast that's what my mom tells me
23:43:40FromDiscord<kaddkaka> 👍
23:46:53FromDiscord<retkid> is uh, arrayMancer... useable?
23:47:02FromDiscord<retkid> or should i continue to try and use math to optimize this problem
23:47:09FromDiscord<Elegantbeef> Nah mratsim wrote it just cause he was having a gigle
23:47:22FromDiscord<Elegantbeef> Spent all that time making code that doesnt do anything
23:47:40FromDiscord<retkid> it was a funny shitpost, not real AI
23:48:05FromDiscord<retkid> but seriously, I know nothing about that world
23:48:34FromDiscord<Elegantbeef> Have you checked out scinim's stuff
23:49:30FromDiscord<retkid> it all looks very useful but I dont use because I dont wanna learn new things, but then spend large amount of times writing my own functions which are less effective
23:49:47FromDiscord<Elegantbeef> Well i dont know what to say
23:50:24FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Jib
23:50:27FromDiscord<retkid> i've been staring at this example for a while
23:50:30FromDiscord<retkid> still haven
23:51:11FromDiscord<retkid> im gonna continue to try and find patterns in this data, this looks like last resort stuff to me
23:51:43FromDiscord<retkid> I wish there was a way to make collapsible messages in discord, so people wouldn't see that giant wall
23:52:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jic
23:52:46FromDiscord<Elegantbeef> Jokes cause he finds the tuple unpacking more unreadable for declaration
23:53:25FromDiscord<retkid> In reply to @Elegantbeef "*Jokes cause he finds": See, im afraid to post my code here because of this. I fear people being inside of my mind-brain
23:53:40FromDiscord<Elegantbeef> Oh noes someone might make a joke
23:53:46FromDiscord<Elegantbeef> Most of my code is OSS so go shit on it
23:54:04FromDiscord<retkid> well, its less of shitting on it
23:54:19FromDiscord<retkid> its more that "this bitch doesn't like this, they like this
23:54:20FromDiscord<retkid> (edit) "this" => "this""
23:54:25FromDiscord<retkid> its like your in my mindddd"
23:54:26FromDiscord<retkid> (edit) "mindddd"" => "mindddd\"
23:54:28FromDiscord<retkid> (edit) "mindddd\" => "minddd"
23:54:32FromDiscord<Rika> We all are
23:54:34FromDiscord<Elegantbeef> Oh noes
23:54:40FromDiscord<Elegantbeef> We dont actually exist
23:54:49FromDiscord<retkid> get out of there
23:54:57FromDiscord<retkid> GO AWAY NIM DEMONS
23:54:58FromDiscord<Rika> Nah it’s comfy and warm here
23:55:10FromDiscord<Elegantbeef> Pretty empty though
23:55:29FromDiscord<retkid> its probably pretty crampt
23:55:45FromDiscord<Rika> Only because it’s so smooth
23:56:36FromDiscord<Leonardo da Vinci> Can i use nim with geany?
23:56:38FromDiscord<Rika> I think I killed him
23:57:00FromDiscord<Rika> In reply to @Leonardo da Vinci "Can i use nim": What’s stopping you? I don’t know what Geany is exactly other than it’s for Java I think
23:57:22FromDiscord<retkid> In reply to @Rika "I think I killed": her
23:57:41FromDiscord<Leonardo da Vinci> In reply to @Rika "What’s stopping you? I": I use geany for everything
23:58:03FromDiscord<Rika> Then why do you think you can’t use Nim in there 😛
23:58:13FromDiscord<retkid> geany has weird nim stuff
23:58:17FromDiscord<retkid> but i think you can
23:58:45FromDiscord<Elegantbeef> It has Nim support
23:58:48FromDiscord<Elegantbeef> It's a shitty editor imo though
23:58:58FromDiscord<Elegantbeef> Though that's neither here nor there
23:59:17FromDiscord<Leonardo da Vinci> In reply to @Rika "Then why do you": Idk if i can set up the compiler and linker commands for num
23:59:45FromDiscord<Elegantbeef> I mean is `nim c ./myfile.nim` really that hard?