00:24:40 | * | tanami quit (Ping timeout: 244 seconds) |
00:34:16 | FromDiscord | <Iliketwertles> got what i wanted https://media.discordapp.net/attachments/371759389889003532/1024479117623701554/screenshot_2022-09-27-202250.png |
00:42:24 | FromDiscord | <ChocolettePalette> I mean, doesn't any program support this? |
00:45:53 | FromDiscord | <Iliketwertles> support what? |
00:46:39 | FromDiscord | <Prestige> reading from stdin |
00:47:38 | FromDiscord | <Iliketwertles> i mean final product is what i wanted, i wanted to make a lolcat type program without looking at lolcats source |
00:56:40 | FromDiscord | <Prestige> https://nim-lang.org/docs/terminal.html would be useful |
00:56:52 | FromDiscord | <Prestige> And maybe https://nim-lang.org/docs/rdstdin.html |
00:59:10 | FromDiscord | <ChocolettePalette> Not only reading from stdin, but also having stdin redirected with use of command line arguments and other redirection operators like \<\<↵(@Prestige) |
01:24:54 | FromDiscord | <Bubblie> have any of you used discmd? How does one do autocomplete? So if I had a command called /greeting how would I make discord read out the possible things /greeting could have so like it can autocomplete /greeting hello or /greeting salutations |
01:30:42 | FromDiscord | <Elegantbeef> dimscmd you mean? |
01:32:01 | FromDiscord | <Bubblie> yes |
01:32:39 | FromDiscord | <Elegantbeef> dont think it presently supports that |
01:33:02 | FromDiscord | <Bubblie> oh no :( |
01:33:13 | FromDiscord | <Elegantbeef> Doesnt seem it supports documentation either |
01:33:17 | FromDiscord | <Bubblie> because I know it has an auto complete feature |
01:33:25 | FromDiscord | <Bubblie> but I dont know exactly how to use it |
01:33:31 | FromDiscord | <Bubblie> cause the docs are lack luster |
01:35:03 | FromDiscord | <Elegantbeef> Well you can jump into the dimscord discord server and ask, they're more active there |
01:35:25 | * | CyberTailor joined #nim |
02:09:10 | * | mal`` quit (Quit: Leaving) |
02:38:56 | * | mal`` joined #nim |
02:53:19 | * | arkanoid quit (Ping timeout: 268 seconds) |
03:00:30 | FromDiscord | <Girvo> Is it possible to turn off the async traceback (from getCurrentExceptionMsg)? |
03:06:02 | FromDiscord | <Prestige> I don't believe so |
03:11:45 | FromDiscord | <Girvo> All good. I'll just filter it out for now (when not in verbose mdoe) |
03:11:48 | FromDiscord | <Girvo> mode, even |
03:29:12 | FromDiscord | <Scoobery Doobery> sent a code paste, see https://play.nim-lang.org/#ix=4bEN |
03:29:45 | FromDiscord | <Elegantbeef> how are you calling it? |
03:29:47 | FromDiscord | <Elegantbeef> also you need to do `new result` |
03:30:47 | FromDiscord | <Rika> Probably Grid[T] too on the get function |
03:31:00 | FromDiscord | <Scoobery Doobery> sent a code paste, see https://play.nim-lang.org/#ix=4bEO |
03:31:00 | FromDiscord | <Scoobery Doobery> I'm assuming that's wrong |
03:31:18 | FromDiscord | <Scoobery Doobery> this would be where `myGridInstance` is a `Grid[MyType]` of course :P |
03:31:18 | FromDiscord | <Elegantbeef> `get[: MyType]` |
03:31:24 | FromDiscord | <Elegantbeef> Nim doesnt do reverse inference |
03:31:30 | FromDiscord | <Rika> What |
03:31:32 | FromDiscord | <Rika> Beef |
03:31:35 | FromDiscord | <Rika> Slow down and read |
03:31:46 | FromDiscord | <Rika> Grid has the T generic on it |
03:31:54 | FromDiscord | <Elegantbeef> You need to supply the generic parameter |
03:31:56 | FromDiscord | <Rika> But it’s just not written explicitly on her function |
03:31:59 | FromDiscord | <Rika> Get |
03:32:02 | FromDiscord | <Rika> |
03:32:08 | FromDiscord | <Elegantbeef> Ah you're right |
03:32:20 | FromDiscord | <Rika> Smh |
03:32:27 | FromDiscord | <Elegantbeef> I just read the header |
03:32:37 | FromDiscord | <Elegantbeef> and the `result[]` |
03:32:45 | FromDiscord | <Rika> That’s one more bug yes |
03:32:45 | FromDiscord | <Scoobery Doobery> Okay wait, I'm actually probably dumb |
03:32:56 | FromDiscord | <Elegantbeef> you need `Grid[T]` |
03:33:13 | FromDiscord | <Rika> Yeah as I said 😦 |
03:33:16 | FromDiscord | <Elegantbeef> that allows it to infer `T` from the left hand of the `.` |
03:33:57 | FromDiscord | <Scoobery Doobery> sent a code paste, see https://play.nim-lang.org/#ix=4bEQ |
03:33:59 | FromDiscord | <Scoobery Doobery> So I guess I really did just need that |
03:34:07 | FromDiscord | <Elegantbeef> as does changing the procedure to `Grid[T]` |
03:34:46 | FromDiscord | <Scoobery Doobery> Well look at that |
03:34:53 | FromDiscord | <Scoobery Doobery> Learn something new every day |
03:34:56 | FromDiscord | <Scoobery Doobery> Thanks for the help! |
03:35:23 | FromDiscord | <Scoobery Doobery> now to figure out the `SIGSEGV` it's throwing me! :D |
03:35:44 | FromDiscord | <Elegantbeef> `new result` before `result []` |
03:36:03 | FromDiscord | <Scoobery Doobery> Ye added that as well |
04:11:49 | FromDiscord | <Girvo> Hey, hey @Rika I think that person needs `Grid[T]` 😉 |
04:12:14 | FromDiscord | <Elegantbeef> Are we sure they dont need `Grid[T]`? |
04:19:31 | FromDiscord | <Bubblie> what is the best vscode nim extension? |
04:19:59 | FromDiscord | <Elegantbeef> saem's |
04:31:38 | * | tanami joined #nim |
05:26:55 | FromDiscord | <Bubblie> thanks |
05:29:38 | FromDiscord | <Bubblie> how do you do "does not equal" or "is not null" in nim |
05:30:10 | FromDiscord | <Elegantbeef> `!=` |
05:30:14 | FromDiscord | <Prestige> In reply to @Scoobery Doobery "Hey all. Hopefully this": Check out the Seq2D package btw |
05:30:33 | FromDiscord | <Elegantbeef> `a notin [b, nil]` |
05:31:52 | FromDiscord | <Bubblie> In reply to @Elegantbeef "`!=`": oh wait so this works? I thought I had to use the keywords nim has like is and not |
05:31:56 | FromDiscord | <Bubblie> I guess not |
05:32:14 | FromDiscord | <Elegantbeef> `is` is for type comparisons |
05:32:39 | FromDiscord | <Elegantbeef> `of` is for inheritance checking |
05:33:11 | FromDiscord | <Bubblie> got it |
05:33:42 | * | CyberTailor quit (Ping timeout: 258 seconds) |
05:35:12 | * | CyberTailor joined #nim |
05:52:41 | * | LuxuryMode joined #nim |
05:57:20 | FromDiscord | <Bung> what's `prev` in `sem` procs arguments, when I debuging compiler most of time it's `nil` |
06:12:10 | * | rockcavera quit (Remote host closed the connection) |
06:14:57 | * | kenran joined #nim |
06:15:58 | NimEventer | New thread by drkameleon: Overriding default C/C++ options + error with 1.6.8 / C++ / macOS, see https://forum.nim-lang.org/t/9495 |
07:21:57 | FromDiscord | <srozb> looks like play.nim-lang is down https://media.discordapp.net/attachments/371759389889003532/1024581713285877810/unknown.png |
07:22:05 | FromDiscord | <Horizon [She/Her]> How stupid would it be to try integrating Nimscript with Python so you can use Python modules lmao |
07:22:11 | FromDiscord | <Horizon [She/Her]> In reply to @srozb "looks like play.nim-lang is": Known issue, been down for quite a while now |
07:26:17 | FromDiscord | <pietroppeter> love play.nim-lang.org, @PMunch if some financial support would help to keep it running let me know, happy to pitch in and I guess others could be interested in that too. when play-nim is down I now usually go to https://replit.com/ where you can create a Nim replit (you can actually do a lot more in replit, also serve apps). |
07:29:33 | FromDiscord | <Girvo> Yeah I'd be happy to as well/my work would be happy to pitch in if it helps |
07:33:06 | FromDiscord | <Horizon [She/Her]> In reply to @pietroppeter "love play.nim-lang.org, <@696333749570371585> if": The Nim repl is outdated, i made a script to install Nim specifically because of this |
07:37:36 | FromDiscord | <pietroppeter> yeah, it is currently 1.4.8. the good think is that with the shell you can update and upgrade (and probably someone could create a better nim template, I guess someone who knows about nix should be able to). better play-nim for that, but the advantage of replit is that you can install all packages you want |
07:37:54 | FromDiscord | <pietroppeter> In reply to @Event Horizon "The Nim repl is": what's your script to update? |
07:38:17 | FromDiscord | <Horizon [She/Her]> I'll get it rn |
07:39:03 | FromDiscord | <Horizon [She/Her]> sent a code paste, see https://paste.rs/QA8 |
07:39:18 | FromDiscord | <Horizon [She/Her]> Also has a (very crappy) script to install dependencies too |
07:39:40 | FromDiscord | <Horizon [She/Her]> I just added `./start.sh` to the run param in .replit |
07:45:01 | FromDiscord | <PMunch> In reply to @Avahe "PMunch": I'm not hosting it, @dom96 originally set it up. It runs on a VPS |
07:45:15 | FromDiscord | <PMunch> I'm just maintaining it |
07:45:20 | FromDiscord | <ieltan> Playground is down sobbing right now |
07:46:41 | FromDiscord | <Prestige> ah |
07:47:00 | FromDiscord | <PMunch> Rebooted it now, usually helps |
07:48:26 | FromDiscord | <ieltan> It does, thanks ! |
08:07:00 | FromDiscord | <pietroppeter> as an example of something I did in replit some time ago is to be able to set up a datasette instance of a sqlite snapshots of irc logs that @Yardanico shared some time ago: https://nimirclogsdatasette.pietroppeter.repl.co/ (I am running it now, it will go down in som time) https://replit.com/@pietroppeter/NimIrcLogsDatasette |
08:07:46 | FromDiscord | <srozb> I've just installed nim 1.6.8 on pure windows 10 vm with choosenim and even compilation of hello world causes assertion errors in nimbase.h - is it something wrong with 1.6.8? can't find any related issue on GH |
08:09:04 | FromDiscord | <flywind> What's error? |
08:09:30 | FromDiscord | <srozb> sent a code paste, see https://paste.rs/lGJ |
08:09:39 | FromDiscord | <pietroppeter> In reply to @pietroppeter "as an example of": example of a query: https://nimirclogsdatasette.pietroppeter.repl.co/irc?sql=select+count%28%29+from+log+where+message+like+%27%25araq%25%27 https://media.discordapp.net/attachments/371759389889003532/1024593719061647461/unknown.png |
08:10:03 | FromDiscord | <srozb> sent a code paste, see https://play.nim-lang.org/#ix=4bFI |
08:12:21 | FromDiscord | <srozb> I'll check 1.6.6 |
08:13:46 | * | jmdaemon quit (Ping timeout: 246 seconds) |
08:14:28 | FromDiscord | <srozb> and it worked on 1.6.6 |
08:16:55 | FromDiscord | <flywind> Doing a git bisect would be appreciated https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler-bisecting-for-regressions and https://github.com/nim-lang/Nim/compare/v1.6.6...v1.6.8 |
08:20:43 | FromDiscord | <srozb> wait I see where is the problem |
08:21:08 | FromDiscord | <srozb> nim -v shows me i686 build on 1.6.8, but when I `choosenim 1.6.6` it gets me amd64 |
08:21:56 | FromDiscord | <srozb> now what did I wrong that causes choosenim to get me 32bit version ? |
08:23:12 | FromDiscord | <srozb> and it is `choosenim-0.8.4_windows_amd64.exe` |
08:29:03 | FromDiscord | <srozb> so looks like a choosenim bug not compiler ( @dom96 👀 ) |
08:48:58 | * | arkurious joined #nim |
08:52:24 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
08:54:04 | * | qwr quit (Ping timeout: 268 seconds) |
08:55:00 | * | CyberTailor left #nim (Konversation terminated!) |
08:55:33 | * | qwr joined #nim |
09:16:02 | * | sagax joined #nim |
10:22:00 | NimEventer | New post on r/nim by thindil: Nim version 1.6.8 released, see https://reddit.com/r/nim/comments/xq8w5c/nim_version_168_released/ |
11:28:50 | * | pro joined #nim |
11:57:16 | * | kenran quit (Remote host closed the connection) |
12:09:02 | * | gsalazar joined #nim |
12:18:57 | FromDiscord | <Scoobery Doobery> In reply to @Avahe "Check out the Seq2D": That may be just what I'm looking for. Thanks! |
12:35:30 | * | kenran joined #nim |
13:08:00 | * | gsalazar quit (Ping timeout: 265 seconds) |
13:14:20 | FromDiscord | <!&luke> In reply to @Bubblie "what is the best": All of them |
13:14:38 | FromDiscord | <!&luke> I literally installed all of them 😂 |
13:14:50 | FromDiscord | <!&luke> It works great tho |
13:47:13 | FromDiscord | <exelotl> that sounds like a terrible idea lmao |
13:51:23 | FromDiscord | <ChocolettePalette> I wasn't sure whether to install Super speed vpn – best vpn or unlimited proxy vpn pro so I installed both |
13:52:13 | FromDiscord | <ChocolettePalette> Sorry! |
13:52:14 | FromDiscord | <ChocolettePalette> Oh, thought that's an offtopic |
13:58:43 | * | derpydoo joined #nim |
14:31:34 | * | rockcavera joined #nim |
15:16:34 | * | LuxuryMode joined #nim |
15:21:18 | * | pro quit (Remote host closed the connection) |
15:22:54 | * | gsalazar joined #nim |
15:27:47 | * | kenran quit (Remote host closed the connection) |
15:30:58 | FromDiscord | <Horizon [She/Her]> In reply to @ripluke "All of them": No lmao |
15:31:10 | FromDiscord | <Horizon [She/Her]> In reply to @Bubblie "what is the best": It's the one by `nimsaem` |
15:37:45 | * | gsalazar quit (Ping timeout: 252 seconds) |
15:46:01 | FromDiscord | <qb> sent a code paste, see https://play.nim-lang.org/#ix=4bHP |
15:47:47 | FromDiscord | <Generic> huh |
15:47:52 | FromDiscord | <Rika> what does that mean |
15:47:55 | FromDiscord | <Generic> but what would that be good for? |
15:48:08 | FromDiscord | <Rika> you want a variable to be somehow global and local? i dont get it |
15:48:23 | FromDiscord | <Generic> you could just call reset on the variable everytime the function is called |
15:48:47 | FromDiscord | <qb> Yea I've reconsidered it. It doesn't makes sense and won't work ;D |
15:49:07 | FromDiscord | <Generic> well I guess there would be one situation wheret his would be useful |
15:49:17 | FromDiscord | <Generic> if you have a variable which would be too big too fit on the stack |
15:49:31 | FromDiscord | <Generic> and you can live with this function not being threads safe |
15:50:38 | FromDiscord | <qb> sent a code paste, see https://play.nim-lang.org/#ix=4bHS |
15:50:55 | FromDiscord | <Generic> ah |
15:51:00 | FromDiscord | <qb> And since it's a window loop you need global vars |
15:51:22 | FromDiscord | <Generic> Python doesn't have something like var parameters |
15:51:56 | FromDiscord | <Generic> one way to solve this would be if you would introduce some new object which would contain the active and the open variable |
15:52:01 | FromDiscord | <Generic> (edit) "variable" => "fields" |
15:52:13 | FromDiscord | <Generic> and expose the creation of it to Python |
15:52:42 | FromDiscord | <Generic> then the Python code would create such an object and it would be a parameter to dropdownBox |
15:53:14 | FromDiscord | <Generic> where you would then pass the active and open fields of that object raylib's dropdownBox function |
16:05:27 | FromDiscord | <qb> Yea well I can't export functions if var arguments |
16:05:35 | FromDiscord | <qb> sent a code paste, see https://play.nim-lang.org/#ix=4bHV |
16:05:50 | FromDiscord | <qb> (edit) "if" => "with" |
16:19:05 | FromDiscord | <!&luke> In reply to @Event Horizon "No lmao": I have double the autocompletion :) |
16:21:19 | FromDiscord | <Generic> make DropDownBox a ref object |
16:21:27 | FromDiscord | <Generic> problem solved |
16:21:50 | FromDiscord | <Generic> atleast if they work with nimpy, idk never used it |
16:22:55 | FromDiscord | <Generic> In reply to @ripluke "I have double the": twice the auto completion, double nimsuggest instances stuck at 100% cpu utilisation |
16:26:44 | FromDiscord | <Goel> Which is the latest nim dev- compiler version? |
16:28:13 | FromDiscord | <Goel> (edit) "version?" => "version?↵On the download page and Nightlies i only see up to 1.6 branch but im using 1.7.1 right now" |
16:28:57 | * | jmdaemon joined #nim |
16:32:56 | FromDiscord | <flywind> In reply to @Goel "Which is the latest": Here is the latest prebuild version https://github.com/nim-lang/nightlies/tags |
16:34:19 | FromDiscord | <flywind> If you use "choosenim devel --latest" to build a latest Nim compiler, the version will be 1.7.3 |
16:36:09 | FromDiscord | <flywind> I bumped it from 1.7.1 to 1.7.3 today |
16:37:00 | FromDiscord | <Horizon [She/Her]> In reply to @ripluke "I have double the": Why |
16:37:23 | FromDiscord | <flywind> In reply to @flywind "I bumped it from": https://github.com/nim-lang/Nim/pull/20432 |
17:15:17 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/3Oy |
17:15:48 | FromDiscord | <jmgomez> (I know I can move it by padding it manually, but it would be great if that works is already built in) |
17:15:55 | FromDiscord | <jmgomez> (edit) "works" => "work" |
17:17:31 | FromDiscord | <federico3> there's no mention of supporting OpenSSL 3 in https://nim-lang.org/blog/2022/09/27/version-168-released.html - how comes? |
17:35:45 | FromDiscord | <untoreh> sent a code paste, see https://play.nim-lang.org/#ix=4bIG |
17:35:59 | FromDiscord | <untoreh> zombies? how do I reap |
17:47:10 | NimEventer | New thread by NameUndefined: EpochTime substractions gives out small negative float, see https://forum.nim-lang.org/t/9496 |
18:13:16 | FromDiscord | <Horizon [She/Her]> How do i make Prologue return a file with a custom mimetype? |
18:19:15 | * | derpydoo quit (Ping timeout: 248 seconds) |
18:43:36 | FromDiscord | <Phil> In reply to @Event Horizon "How do i make": Determined to not use a reverse proxy, eh?↵In this regard, shouldn't it just be a matter of setting the content-type header |
18:43:39 | FromDiscord | <Phil> (edit) "header" => "header?" |
18:44:52 | FromDiscord | <Horizon [She/Her]> Yup i figured it out earlier xD |
18:44:54 | FromDiscord | <Phil> https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type |
18:44:57 | FromDiscord | <Horizon [She/Her]> Dug through internals lol |
18:44:59 | FromDiscord | <Phil> Ah, faster than I was |
18:46:39 | FromDiscord | <Phil> In reply to @untoreh "Why does this never": I haven't done much OS level stuff, but why would your try block ever cause an OSError? |
18:47:52 | FromDiscord | <Phil> In fact, how do you ever escape your while loop other than through an exception that isn't an OSError? |
19:01:29 | FromDiscord | <Tuatarian> How does one pass a range to a function? |
19:02:05 | FromDiscord | <Tuatarian> Rephrasing that |
19:02:20 | FromDiscord | <Tuatarian> How do you take a range as a function parameter? |
19:06:10 | * | krux02_ joined #nim |
19:15:29 | FromDiscord | <auxym> In reply to @iWonderAboutTuatara "How do you take": `proc f(x: range[10..50]) = ...` |
19:23:05 | FromDiscord | <Tuatarian> What if I want a range between any 2 naturals incl 0? |
19:46:14 | FromDiscord | <Mrcool> maybe `proc f(x: HSlice[Natural,Natural]) =` |
19:46:36 | FromDiscord | <auxym> that |
19:47:53 | FromDiscord | <Mrcool> you can use Slice instead of HSlice |
19:48:08 | FromDiscord | <Mrcool> whats HSlice is even used for |
19:52:56 | FromDiscord | <auxym> HSlice allows different types for the start and end positions (not sure why you'd want that) |
20:06:18 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
20:11:47 | * | Guest97 joined #nim |
20:47:53 | * | derpydoo joined #nim |
20:52:47 | FromDiscord | <jos> what does nim use for expression parsing? |
20:52:56 | FromDiscord | <jos> i know there's tons of control over operators and stuff in nim |
20:53:16 | FromDiscord | <jos> and i know "most things" in nim are expressions |
20:53:24 | FromDiscord | <jos> i figured it might use a pratt parser for expressions, because there's all this runtime registration of operators |
20:53:31 | FromDiscord | <jos> does anybody know? |
20:56:59 | * | vicecea quit (Remote host closed the connection) |
20:58:09 | FromDiscord | <jos> i see this quote on the forums |
20:58:14 | FromDiscord | <jos> > Nim was designed to be parsable without a symbol table and this feature would break this design. You can come up with post-parse rewrite rules (which is also what Haskell does iirc), in fact, you could implement these rules via a macro. But I don't like it and I don't see why we would need it.↵> ↵> Nim's design isn't arbitrary, there are no special rules for "builtin" operators and it should stay this way. |
20:58:34 | FromDiscord | <jos> why does nim avoid a symbol table? |
21:04:00 | NimEventer | New thread by errata-c: How to properly typecheck a variable number of array args?, see https://forum.nim-lang.org/t/9497 |
21:28:23 | FromDiscord | <auxym> @jos might want to ask in #internals people who work in compiler mostly hang out there |
21:29:25 | FromDiscord | <jos> ty, good idea |
21:29:49 | FromDiscord | <Elegantbeef> I'd say it's likely that since Nim doesnt really have keywords it's not needed |
21:30:42 | FromDiscord | <jos> well my first thought was that you can't specify precedence without a symbol table, I guess? |
21:30:53 | FromDiscord | <jos> for custom operators |
21:33:45 | qwr | "Otherwise, precedence is determined by the first character." https://nim-lang.org/docs/manual.html#lexical-analysis-operators |
21:34:10 | qwr | basically, nim has hardcoded rules for precedence |
21:36:11 | FromDiscord | <Elegantbeef> It has a few keywords, but a lot of parts are implemented in user space |
21:36:43 | FromDiscord | <Elegantbeef> It has a precedence table |
21:36:49 | FromDiscord | <Elegantbeef> For all operators |
21:36:57 | FromDiscord | <Elegantbeef> Since all operators are custom |
21:37:26 | FromDiscord | <Elegantbeef> Nim doesnt have operators implemented by default |
21:37:29 | qwr | and few rules determine any operators placement in the precedence table |
21:37:39 | FromDiscord | <Elegantbeef> All 'default' operators are apart of the system module |
21:38:00 | FromDiscord | <Elegantbeef> except `=` I guess |
21:40:32 | qwr | i guess that design was chosen to be less actively hostile to creating IDEs and code analysis tools for Nim (as opposed a design where programmer can dynamically alter precedence table) - with current Nim design you can for example have pretty standard parser after custom lexer that creates lisp-like syntax tree |
21:40:52 | FromDiscord | <Mrcool> why does this fail ? https://media.discordapp.net/attachments/371759389889003532/1024797868197949440/unknown.png |
21:41:32 | FromDiscord | <Elegantbeef> it tells you why it fails |
21:41:36 | qwr | parsing for example haskell is a bit more `fun' |
21:42:13 | qwr | (though on the other hand you don't have arbitrary macros after initial parse in haskell) |
21:42:31 | FromDiscord | <Mrcool> In reply to @Elegantbeef "it tells you why": I don't get it |
21:42:32 | FromDiscord | <Elegantbeef> `lines` with a string attempts to open the file |
21:42:38 | FromDiscord | <Elegantbeef> you want `std/strutils` and the `splitLines` |
21:43:05 | FromDiscord | <Elegantbeef> `for line in myStr.lines` opens `myStr` then iterates it |
21:43:09 | FromDiscord | <Elegantbeef> you want `for line in myStr.splitLines` |
21:54:10 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4bKf |
21:54:18 | FromDiscord | <Bung> https://github.com/SciNim/numericalnim/blob/614cb304d74ac32869ff74e0d013681ecf4ff5c8/src/numericalnim/integrate.nim#L420 am suprised this syntax used in real project. |
21:55:31 | FromDiscord | <Elegantbeef> Maths needs some constants 😄 |
21:56:22 | FromDiscord | <Elegantbeef> Or do you mean `(seq, seq)`? |
21:58:06 | FromDiscord | <Bung> yeah seq without element type |
21:59:37 | FromDiscord | <Mrcool> seems like <https://github.com/aMOPel/tree-sitter-nim> is getting closer to handle nim |
21:59:48 | FromDiscord | <Elegantbeef> I mean it 'works' it constraints to the typeclass, but araq doesnt like that so no clue 😄 |
22:00:31 | * | qwr . o O ( the lines function is very useful to know... and surprising to those who don't :) ) |
22:00:53 | FromDiscord | <Bung> https://github.com/nim-lang/Nim/pull/20412 my PR will break it. I hope so, me dont like |
22:01:17 | FromDiscord | <Elegantbeef> Does it break typeclasses? |
22:01:21 | FromDiscord | <Elegantbeef> like `proc doThing(s: seq)`? |
22:01:26 | FromDiscord | <Elegantbeef> If so it's wrong |
22:02:17 | FromDiscord | <Bung> seq will fill a tynone type if there isn't element type |
22:02:29 | FromDiscord | <Elegantbeef> So yes or no? |
22:03:02 | FromDiscord | <Bung> yes , where ever it occurs |
22:03:19 | FromDiscord | <Elegantbeef> So it breaks the array/seq typeclasses? |
22:03:31 | FromDiscord | <Elegantbeef> If that's the case your PR is wrong |
22:03:59 | FromDiscord | <Elegantbeef> `proc doThing(a: seq, b: set, c: array)` is 100% valid and should work |
22:04:39 | FromDiscord | <Bung> why |
22:04:52 | FromDiscord | <Elegantbeef> Those are typeclasses |
22:05:00 | FromDiscord | <Elegantbeef> It's the same as `proc doThing(a: object)` or `proc doThing(r: ref)` |
22:06:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bKk |
22:06:20 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4bKl |
22:06:44 | FromDiscord | <Bung> it's existed code , u see `errXExpectsOneTypeParam ` |
22:07:22 | FromDiscord | <Elegantbeef> I'm just making sure you didnt break typeclasses for the builtin types |
22:07:29 | FromDiscord | <Elegantbeef> I'm not overly competent with the compiler 😄 |
22:07:45 | FromDiscord | <Bung> generic works fine |
22:08:31 | FromDiscord | <Bung> I never use something like `proc doThing(a: seq, b: set, c: array)` |
22:08:50 | FromDiscord | <Elegantbeef> Sure, but it's supported and consistent with all other generics |
22:08:58 | FromDiscord | <Elegantbeef> I use typeclasses a lot |
22:09:08 | FromDiscord | <Bung> since nim is static typed, from that code , I dont see real type |
22:09:27 | FromDiscord | <Elegantbeef> I mean that's the point you only care that it's a specific type |
22:09:39 | FromDiscord | <Elegantbeef> It's a generic procedure that accepts all `seq` `set` and `array`s |
22:10:37 | FromDiscord | <Bung> oh, looks like no test case cover this... |
22:12:16 | qwr | Elegantbeef: what you can do with those? you can't add elements, since then wrong type of elements could be added... and you can't use the elements, as you don't know what type any element is? |
22:13:25 | * | Guest97 quit (Quit: Client closed) |
22:14:16 | qwr | though, it should be safe to delete or move around elements (I think thats how std library uses these types...) |
22:14:22 | * | rb quit (Quit: ZNC - https://znc.in) |
22:14:35 | * | rwb joined #nim |
22:15:55 | FromDiscord | <Elegantbeef> They're generic typeclasses they're not untyped |
22:15:56 | FromDiscord | <Elegantbeef> You can though↵(<@709044657232936960_qwr=5b=49=52=43=5d>) |
22:17:05 | FromDiscord | <Bung> I haven't check but during some step compiler will fill generic type ? I guess so |
22:17:40 | FromDiscord | <Bung> so after that it's not empty |
22:18:02 | qwr | Elegantbeef: if I look at example in manual, these type clases are used as constraints for generics, which makes sense |
22:18:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bKq |
22:18:55 | FromDiscord | <Elegantbeef> There's an example that should work 'flawlessly' |
22:18:55 | FromDiscord | <Bung> check is after type construction |
22:20:15 | qwr | hmok, that makes sense. |
22:21:56 | qwr | and... as i understand the manual, your example is actually using implicit generic type |
22:22:09 | FromDiscord | <Elegantbeef> Correct |
22:22:37 | * | krux02_ quit (Remote host closed the connection) |
22:22:53 | FromDiscord | <Elegantbeef> I mean i'd say the best thing to use is a concept, but yea 😄 |
22:23:28 | FromDiscord | <Elegantbeef> A real case is for things like https://github.com/beef331/nimtrest/blob/master/remoterefs.nim#L91-L97 |
22:23:38 | FromDiscord | <Rainbow Asteroids> sent a code paste, see https://play.nim-lang.org/#ix=4bKs |
22:23:39 | FromDiscord | <Elegantbeef> Where i really dont give a care in the world what type is `RemoteRef` |
22:24:05 | FromDiscord | <Elegantbeef> I just want to be certain it's a remoteref |
22:24:27 | FromDiscord | <Elegantbeef> Eh they might look wrong, but they feel so right |
22:24:41 | FromDiscord | <Elegantbeef> If they're wrong i dont want to be right! 😛 |
22:25:13 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimtrest/blob/master/sentinels.nim Another example if anyone isnt sold 😛 |
22:46:52 | FromDiscord | <Patitotective> im doubtful about how to implement a query parser↵easiest thing would be to have procedures that filter a document and output a document so you can use them with another procedures (`doc.allStartingWith("node").allWithXValues(2)`), but that seems to have more allocations than needed↵soo i was thinking maybe to make a sequence of `Filter` object variant that has all filter procedures as enums and fields, this way i can save and p |
22:47:08 | FromDiscord | <Patitotective> maybe there's already a query parser/lang example in nim |
22:47:24 | FromDiscord | <Patitotective> (edit) "nim" => "nim, dont know" |
22:49:55 | FromDiscord | <Elegantbeef> Do this with iterators and you're golden 😛 https://forum.nim-lang.org/t/9132#59763 |
22:50:43 | FromDiscord | <Elegantbeef> Yea i dont really know about querying i generally go towards iterators for problems |
22:53:17 | FromDiscord | <Patitotective> In reply to @Elegantbeef "Do this with iterators": ooo nice |
22:59:17 | FromDiscord | <Patitotective> In reply to @Elegantbeef "Do this with iterators": why distinct tho |
22:59:39 | FromDiscord | <Elegantbeef> Cause the `filter` makes it clear what you're doing |
23:01:30 | FromDiscord | <Elegantbeef> If you read the posts prior it's about using `[]` for doing filter/apply/... |
23:07:56 | FromDiscord | <Iliketwertles> suggestions? https://media.discordapp.net/attachments/371759389889003532/1024819782094176307/neocat.nim |
23:09:15 | FromDiscord | <Patitotective> `std/[typetraits, strutils, terminal, os]` :p |
23:09:36 | FromDiscord | <Iliketwertles> fair |
23:09:36 | FromDiscord | <Elegantbeef> Variables are a hell of a drug |
23:10:04 | FromDiscord | <Iliketwertles> wym? |
23:10:31 | FromDiscord | <Patitotective> is there a way to _mix_ two enums, something like `MyEnum or YourEnum` or `type OurEnum = MyEnum and YourEnum` |
23:11:28 | FromDiscord | <Elegantbeef> No |
23:11:35 | FromDiscord | <Elegantbeef> You'd need a macro for that |
23:12:11 | FromDiscord | <Iliketwertles> might make the default color for this white so it can be a usable "replacement(kinda not rly)" of cat |
23:12:25 | FromDiscord | <Iliketwertles> so itll be cat with colors |
23:12:56 | FromDiscord | <Elegantbeef> There we go much more sensible |
23:12:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bKB |
23:13:45 | FromDiscord | <Elegantbeef> colors as a parameter should be `openArray[ForegroundColor]` |
23:14:50 | FromDiscord | <Patitotective> btw @Iliketwertles you can do `newSeq[string]` |
23:15:22 | FromDiscord | <Elegantbeef> Or just `var output: seq[string]` |
23:15:22 | FromDiscord | <Elegantbeef> have\ |
23:15:22 | FromDiscord | <Elegantbeef> Since that's identical to what you hva |
23:16:03 | FromDiscord | <Iliketwertles> forgot about caseing↵gonna use that |
23:21:48 | FromDiscord | <Iliketwertles> sent a code paste, see https://play.nim-lang.org/#ix=4bKE |
23:28:34 | FromDiscord | <Elegantbeef> no |
23:28:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bKH |
23:29:10 | FromDiscord | <Iliketwertles> i see |