01:04:54 | * | beholders_eye quit (Ping timeout: 244 seconds) |
01:11:48 | * | redj quit (Read error: Connection reset by peer) |
01:12:26 | * | redj joined #nim |
01:16:54 | FromDiscord | <firasuke> IIRC, Nim uses `wyhash` as its default hashing algorithm; however, `wyhash` has been succeeded by `rapidhash` (https://github.com/Nicoshev/rapidhash) which provides more throughput and better overall quality (at least according to smhasher). Are there plans to switch from `wyhash` to `rapidhash` (https://github.com/golang/go/issues/67935)? |
01:17:02 | FromDiscord | <firasuke> (edit) "(https://github.com/golang/go/issues/67935)?" => "(https://github.com/golang/go/issues/67935 )?" |
01:32:16 | FromDiscord | <demotomohiro> In reply to @firasuke "IIRC, Nim uses `wyhash`": iirc, farm hash will became default: https://github.com/nim-lang/Nim/issues/23678 |
01:41:54 | * | rockcavera quit (Remote host closed the connection) |
02:01:45 | FromDiscord | <arkanoid> `chronos` is not compatible with nim 2.2.0?↵I get `/home/jack/.nimble/pkgs2/chronos-4.0.3-ba179f34b0513ebd1615076f07b61e2e217bd228/chronos/config.nim(150, 20) Error: expression cannot be cast to 'ptr SeqHeader'` |
02:11:09 | FromDiscord | <arkanoid> also `chronicles` fails to compile. Mh, ground seems less solid than usual |
02:58:14 | FromDiscord | <lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=hbwBwGzd |
02:58:22 | FromDiscord | <lainlaylie> are you using refc or something? |
03:11:27 | FromDiscord | <albassort> are tables safe to concurrently read and write to |
03:11:39 | FromDiscord | <albassort> 1 thread writes to while others read? |
03:14:06 | FromDiscord | <Elegantbeef> No |
03:15:54 | FromDiscord | <Elegantbeef> Writing to table can cause it to move where it's at, best case you get an old value, worst case you're reading memory that was overwritten |
03:20:30 | FromDiscord | <albassort> In reply to @Elegantbeef "Writing to table can": is there a datastructure in nim which would be good for this? |
03:20:41 | FromDiscord | <albassort> doubt it |
03:21:08 | FromDiscord | <albassort> a lock would surely be faster than a db query right? |
03:21:25 | FromDiscord | <Elegantbeef> Do you mutations have to occur now? |
03:21:27 | FromDiscord | <Elegantbeef> your\ |
03:22:08 | FromDiscord | <albassort> i dont think my mutations would be so critical that they cant wait for a read to finish |
03:22:11 | FromDiscord | <Elegantbeef> What you could do is queue them up and have them happen in batch when you're not reading, kinda like a RCU type |
03:22:50 | FromDiscord | <Elegantbeef> But instead of deleting when nothing is reading you add |
03:22:50 | FromDiscord | <albassort> why not have a write loc and have the reads happen concurrently |
03:23:05 | FromDiscord | <Elegantbeef> Constant locking is not very nice |
03:23:54 | FromDiscord | <albassort> still probably faster than a db query for every api query to validate the keys |
03:24:07 | FromDiscord | <Elegantbeef> I wouldn't know |
03:24:49 | FromDiscord | <albassort> database applications are kinda hard to benchmark because the database speed is highly variable |
03:24:54 | FromDiscord | <albassort> so idk if i even wanna try |
03:27:20 | FromDiscord | <arkanoid> sent a code paste, see https://play.nim-lang.org/#pasty=owtauZiu |
03:27:53 | FromDiscord | <Elegantbeef> Did you transfer the processes across the thread barrier? |
03:28:41 | FromDiscord | <albassort> the thread-brain barrier only allows codes smaller than 5 nm btw |
03:29:02 | FromDiscord | <arkanoid> now the program is much simpler\: just main thread (async), the child processes are all executed via async tools in `asynctools/asyncproc.nim`, but weird things are happening |
03:29:09 | FromDiscord | <Elegantbeef> Would be rad if it were true to prevent people from sharing things across the barrier 😄 |
03:33:43 | FromDiscord | <arkanoid> I have to revert to mutithreading, sigh |
03:34:06 | FromDiscord | <Elegantbeef> This is why selectors are rad 😄 |
03:38:29 | FromDiscord | <arkanoid> My trust into async programming has been hurt again. Why my problems have always to be so I/O limited! |
03:38:46 | FromDiscord | <Elegantbeef> IO is a mistake |
03:39:01 | FromDiscord | <arkanoid> Haskell to the resque! |
03:39:20 | FromDiscord | <Elegantbeef> Nah selectors to the rescue, they don't hide the logic |
03:40:27 | FromDiscord | <arkanoid> they do! my problem is purely random. I call same process every 5 seconds. It crash after 3 stdev 2 loops |
03:40:48 | FromDiscord | <Elegantbeef> How do selectors hide the logic? |
03:43:32 | FromDiscord | <arkanoid> because they seems not fully supported as stated |
04:00:58 | FromDiscord | <arkanoid> oh wow is an old time bug https://forum.nim-lang.org/t/5565 |
06:02:59 | * | SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev) |
06:07:57 | * | SchweinDeBurg joined #nim |
07:37:46 | * | coldfeet joined #nim |
07:39:00 | * | rockcavera joined #nim |
08:06:47 | * | ntat joined #nim |
10:37:26 | * | ntat quit (Read error: Connection reset by peer) |
10:38:30 | * | ntat joined #nim |
10:40:50 | FromDiscord | <firasuke> Is `execCmd` preferred over `execShellCmd` and what's the difference? IIRC the latter is basically `system()` from `stdlib.h`? |
10:43:33 | * | coldfeet quit (Quit: Lost terminal) |
10:52:45 | * | alexdaguy joined #nim |
10:53:35 | * | beholders_eye joined #nim |
10:54:00 | * | ntat quit (Quit: Leaving) |
11:03:35 | * | ntat joined #nim |
11:08:49 | * | notchris quit (Quit: Connection closed for inactivity) |
11:20:08 | FromDiscord | <luteva> Hi! I would like to help the community and port some libs that are written for nim version 1 and do not compile in nim 2 (like import correct db_connector etc.). So if someone has a library that needs some new imports or something like this and do not have the time or desire to change it, just contact me! And if i find the time I (hopefully) can do it for you. 🙂 |
11:28:48 | FromDiscord | <lainlaylie> In reply to @firasuke "Is `execCmd` preferred over": https://github.com/nim-lang/Nim/blob/version-2-2/lib/pure/os.nim#L401↵https://github.com/nim-lang/Nim/blob/version-2-2/lib/pure/osproc.nim#L1477↵they look pretty similar to me |
11:30:51 | FromDiscord | <lainlaylie> i always use startProcess to avoid shell escaping issues |
12:30:33 | FromDiscord | <firasuke> In reply to @lainlaylie "i always use startProcess": oh ok, thanks |
12:59:16 | * | alexdaguy quit (Quit: w) |
17:00:09 | * | coldfeet joined #nim |
17:01:49 | * | Jjp137 quit (Ping timeout: 252 seconds) |
17:38:57 | FromDiscord | <code_reaper5477> Hey everyone, new to Nim, wanted to pick up a language that I could possibly contribute libraries for, glad to be here |
17:54:11 | * | xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in) |
17:55:57 | * | xutaxkamay joined #nim |
18:21:28 | FromDiscord | <reculify> In reply to @code_reaper5477 "Hey everyone, new to": same |
19:14:03 | * | Jjp137 joined #nim |
19:33:08 | FromDiscord | <nnsee> welcome! |
19:33:11 | FromDiscord | <nnsee> nice to have you here |
19:44:14 | * | tiorock joined #nim |
19:44:14 | * | tiorock quit (Changing host) |
19:44:14 | * | tiorock joined #nim |
19:44:14 | * | rockcavera quit (Killed (molybdenum.libera.chat (Nickname regained by services))) |
19:44:14 | * | tiorock is now known as rockcavera |
19:45:30 | * | coldfeet quit (Quit: Lost terminal) |
20:05:53 | * | beholders_eye quit (Ping timeout: 252 seconds) |
20:07:58 | * | beholders_eye joined #nim |
20:08:04 | FromDiscord | <luteva> Welcome! |
20:09:09 | FromDiscord | <aintea> Anyone know when I should use `func(arg)`, `arg.func`, `arg.func()` ??? |
20:09:35 | FromDiscord | <aintea> func can be a proc too btw, I'm just askingabout the preferred codestyle in Nim |
20:10:55 | FromDiscord | <luteva> Make it well readable i would say 😃 |
20:11:28 | FromDiscord | <bostonboston> That, whatever is Intuitive, don't make it hard on the reader, each style has its place |
20:12:17 | FromDiscord | <Elegantbeef> If the procedure sounds like it operates on the first parameter you do `a.b` otherwise you do `b(a)` |
20:12:27 | FromDiscord | <Elegantbeef> `myString.isEmpty()` |
20:12:47 | FromDiscord | <aintea> I currently use:↵- `arg.func` when it is a func and returns a value↵- `func(arg, ...)` when it takes more than one argument↵- `arg.func()` if it is a proc |
20:13:04 | FromDiscord | <aintea> In reply to @Elegantbeef "If the procedure sounds": oh ok, thanks |
20:13:22 | FromDiscord | <Elegantbeef> Don't do it for weird reasons, do it cause it's readable |
20:13:36 | FromDiscord | <Elegantbeef> `isNil(x)` is awful |
20:13:48 | FromDiscord | <Elegantbeef> `add(a, b)` is also awful |
20:14:46 | FromDiscord | <aintea> well, a.add(b) is also awful |
20:16:03 | FromDiscord | <aintea> for `x.isNil` I see your point |
20:16:13 | FromDiscord | <aintea> but for `add(a, b)` I really don't |
20:16:24 | FromDiscord | <bostonboston> sent a code paste, see https://play.nim-lang.org/#pasty=ZNRcQuny |
20:16:49 | FromDiscord | <Elegantbeef> `myCollection.add b` is not really awful |
20:17:00 | FromDiscord | <aintea> OH |
20:17:05 | FromDiscord | <aintea> you mean the add into a collection |
20:17:13 | FromDiscord | <aintea> I tought you were talking about the addition |
20:17:16 | FromDiscord | <Elegantbeef> Well yea when else do you use `add` |
20:17:30 | FromDiscord | <Elegantbeef> No if I was talking about addition I'd use y'know `+` |
20:17:35 | FromDiscord | <aintea> I tought you were talking about a custom addition func |
20:17:54 | FromDiscord | <aintea> yeah sure, to add into a seq I'll use `s.add(x)` |
20:18:18 | FromDiscord | <aintea> Do you guys think some things in the Nim codestyle should change ? |
20:18:25 | FromDiscord | <aintea> For example camelCase |
20:18:26 | FromDiscord | <Elegantbeef> No |
20:18:34 | FromDiscord | <Elegantbeef> No |
20:18:55 | FromDiscord | <Elegantbeef> As someone that uses a NA keyboard snake case is hell to write imo |
20:19:12 | FromDiscord | <Elegantbeef> Those Rust nuts can keep it |
20:19:24 | FromDiscord | <Elegantbeef> I've been writing a small Odin toy and hate every time I have to write it 😄 |
20:19:41 | FromDiscord | <aintea> also |
20:19:49 | FromDiscord | <aintea> Did you guys know Nim converts case styling |
20:20:12 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=lQTquLHi |
20:20:35 | FromDiscord | <aintea> I wanted to burn everything around me when I learnt this |
20:20:37 | FromDiscord | <bostonboston> Yes, don't abuse it |
20:22:23 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=xPnnCkOz |
20:22:37 | FromDiscord | <Elegantbeef> I've been using Nim for like 5 years |
20:22:38 | FromDiscord | <Elegantbeef> If I didn't know that it was style insensitive someone should shoot me |
20:23:02 | FromDiscord | <aintea> I come from C, and upper snake case is my standard for constants (even if clearly discouraged in the Nim codestyle) |
20:23:13 | FromDiscord | <Elegantbeef> You can use the `--styleChecks` flag or w/e it is |
20:23:13 | FromDiscord | <aintea> In reply to @Elegantbeef "If I didn't know": Any last words ? 🔫 |
20:23:29 | FromDiscord | <Elegantbeef> Ah yes screaming constants for no reason |
20:23:33 | Amun-Ra | aintea: "don't shoot"? |
20:23:50 | FromDiscord | <Elegantbeef> Boo the value that doesn't move is so scary we have to emphasis it |
20:24:02 | FromDiscord | <aintea> yes |
20:24:09 | FromDiscord | <aintea> constants do no harm, variables do |
20:24:10 | FromDiscord | <Elegantbeef> So scary! |
20:24:22 | FromDiscord | <Elegantbeef> Right so we should make all variables screaming case |
20:24:27 | FromDiscord | <Elegantbeef> That way we know that they're variables |
20:24:37 | FromDiscord | <Elegantbeef> Alternatively it really doesnt matter whether something is a variable or constant |
20:24:58 | FromDiscord | <Elegantbeef> The compiler will complain if we try to do things wrongly |
20:44:31 | * | beholders_eye quit (Ping timeout: 252 seconds) |
20:46:11 | * | beholders_eye joined #nim |
20:48:26 | FromDiscord | <arkanoid> how would you ensure that there is only one copy of Nim program running? I'm using flock/shlock external tool, but it would be nice to use native Nim solution instead. |
20:51:29 | * | kasimir_ joined #nim |
20:52:44 | FromDiscord | <Elegantbeef> Write a lock file if the file exists the program is running or a previous instanced crashed 😄 |
20:56:25 | FromDiscord | <arkanoid> sure, thing, but what is a lockfile in this context? |
20:56:33 | FromDiscord | <Elegantbeef> Just a file in a path |
20:56:44 | FromDiscord | <Elegantbeef> If that file exists you close the instance |
20:59:39 | * | beholders_eye quit (Ping timeout: 244 seconds) |
21:01:16 | FromDiscord | <arkanoid> mh, I though there was some kind of write protection on the lockfile |
21:01:40 | FromDiscord | <arkanoid> like exclusive open to prevent other programs messing with the lockfile |
21:02:03 | FromDiscord | <arkanoid> sent a code paste, see https://play.nim-lang.org/#pasty=GotPtfYQ |
21:02:44 | FromDiscord | <Elegantbeef> Well you only delete it from the program that made it |
21:03:07 | FromDiscord | <Elegantbeef> Overiding signals and adding an exithook to destroy it |
21:07:30 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=vcLICuEt |
21:09:40 | FromDiscord | <Elegantbeef> Defects aren't exceptions |
21:10:18 | FromDiscord | <Elegantbeef> In a normal program with `--panics:on` as one would want they're not catchable |
21:11:11 | FromDiscord | <arkanoid> Defects are exceptions |
21:11:12 | FromDiscord | <Elegantbeef> Defects are defects |
21:11:15 | FromDiscord | <Elegantbeef> No |
21:11:28 | FromDiscord | <Elegantbeef> They're intentionally not meant to be caught, but you can catch them with `--panics:off` which is sadly default |
21:11:34 | FromDiscord | <arkanoid> https://nim-lang.org/docs/system.html#Defect |
21:12:19 | FromDiscord | <Elegantbeef> > Exceptions that indicate programming bugs inherit from system.Defect (which is a subtype of Exception) and are strictly speaking not catchable as they can also be mapped to an operation that terminates the whole process. If panics are turned into exceptions, these exceptions inherit from Defect. |
21:12:28 | FromDiscord | <Elegantbeef> While yes they derive from exceptions they're not considered catchable |
21:12:39 | FromDiscord | <Elegantbeef> You can catch them with `--panics:off` but that's a faux pas and you're not supposed to rely on that feature |
21:12:58 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#exception-handling-exception-hierarchy |
21:13:54 | FromDiscord | <arkanoid> so by default Defects are Exceptions |
21:14:33 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=HmpwbtUr |
21:14:48 | FromDiscord | <aintea> the compiler still doesn't enforce me to be exhaustive, not even a single warning |
21:14:58 | FromDiscord | <Elegantbeef> `raises` also doesn't track defects so ... yea |
21:15:14 | FromDiscord | <aintea> now it's not a defect |
21:15:20 | FromDiscord | <Elegantbeef> `else:` why would it? |
21:15:26 | FromDiscord | <aintea> IOError and ValueError are not at least |
21:15:35 | FromDiscord | <aintea> In reply to @Elegantbeef "`else:` why would it?": Because compiler enforces me to |
21:15:52 | FromDiscord | <Elegantbeef> You're explicitly stating I don't want exhaustive checking |
21:15:53 | FromDiscord | <aintea> It says "bro you haven't made a case statement for every number that exists" |
21:16:22 | FromDiscord | <Elegantbeef> What? |
21:16:49 | FromDiscord | <Elegantbeef> You went out of your way to add an else branch then are complaining that it's not exhaustive? |
21:16:52 | FromDiscord | <Elegantbeef> else makes it exhaustive |
21:17:14 | FromDiscord | <aintea> When I say exhaustive I am talking about the exception handling in the main part |
21:17:42 | FromDiscord | <Elegantbeef> Well then say that 😄 |
21:17:54 | FromDiscord | <aintea> I could rewrite the divide function with ifs and the compiler would still not enforce me to handle all exceptions |
21:18:07 | FromDiscord | <aintea> In reply to @Elegantbeef "Well then say that": It was clear in my head and I'm a bit tired, sorry for confusion |
21:19:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=wAoEwpTP |
21:19:20 | FromDiscord | <Elegantbeef> Right cause Nim does not force handling all exceptions unless the proc is annotated `{.raises: [].}` |
21:19:20 | FromDiscord | <Elegantbeef> Any body of code that raises an exception is assumed to desire to raise the exceptions |
21:19:33 | FromDiscord | <Elegantbeef> You have to state otherwise |
21:34:51 | FromDiscord | <haniel.> Good evening, good?↵can anyone help me on my code in nim? |
21:40:24 | FromDiscord | <nnsee> In reply to @haniel. "Good evening, good? can": what problem do you have? |
21:45:09 | FromDiscord | <haniel.> sent a long message, see https://pasty.ee/FfAkpMvu |
21:45:54 | FromDiscord | <haniel.> i cant send images? |
21:46:11 | FromDiscord | <Elegantbeef> Heh haniel just got banned on the matrix side 😄 |
21:46:11 | FromDiscord | <haniel.> sent a long message, see https://pasty.ee/KgpPCEYB |
21:46:58 | * | beholders_eye joined #nim |
21:47:08 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#pasty=lLORJkIT |
21:47:12 | FromDiscord | <ElegantBeef> Don't do this though |
21:47:20 | FromDiscord | <ElegantBeef> You're showing a singleton which is ugh |
21:47:33 | FromDiscord | <haniel.> i did this ↵type↵ DAO[E : Entidade] = ref object of Entidade↵ dados: seq[E] |
21:48:09 | FromDiscord | <haniel.> In reply to @haniel. "i did this ": because DAO its other class, inherates my class "entidade" |
21:48:32 | FromDiscord | <haniel.> In reply to @elegantbeef "You're showing a singleton": college work, i have to code java to nim |
21:48:49 | FromDiscord | <ElegantBeef> College is forcing you to convert java to Nim? |
21:48:55 | FromDiscord | <haniel.> srry for my english, i am brazilian |
21:49:34 | FromDiscord | <haniel.> In reply to @elegantbeef "College is forcing you": "forcing" its a strong word, but ye |
21:49:50 | FromDiscord | <ElegantBeef> Interesting Nim in educational environment |
21:49:57 | FromDiscord | <haniel.> kkkkkkk |
21:50:01 | FromDiscord | <ElegantBeef> Anyway the above works |
21:50:19 | FromDiscord | <ElegantBeef> So without an example of it exploding I cannot say anything else |
21:50:47 | FromDiscord | <haniel.> actually me and my group chose nim |
21:51:02 | FromDiscord | <haniel.> In reply to @elegantbeef "So without an example": lol |
21:52:55 | FromDiscord | <haniel.> thanks bro, i will try |
21:54:02 | FromDiscord | <haniel.> sent a long message, see https://pasty.ee/JVzODYlR |
21:54:58 | FromDiscord | <haniel.> sent a code paste, see https://play.nim-lang.org/#pasty=TshrYcmT |
21:58:41 | FromDiscord | <ElegantBeef> Provide full code |
21:59:54 | FromDiscord | <haniel.> bro, its 10 modules, i cant provide the full code lol |
22:00:38 | FromDiscord | <haniel.> i can send the zip with my code in nim and the code in java |
22:01:21 | FromDiscord | <ElegantBeef> You can provide a min repro |
22:01:34 | FromDiscord | <haniel.> ok, git? |
22:01:39 | FromDiscord | <haniel.> github? |
22:02:11 | FromDiscord | <ElegantBeef> Or just a small example of the problem at hand |
22:03:43 | FromDiscord | <haniel.> i will up in a repository, and i send you the link of git |
22:04:20 | * | beholders_eye quit (Ping timeout: 252 seconds) |
22:06:16 | * | beholders_eye joined #nim |
22:08:59 | FromDiscord | <haniel.> ||https://github.com/Carrocho/HELPPLZ|| |
22:09:03 | FromDiscord | <haniel.> @ElegantBeef |
22:11:36 | FromDiscord | <ElegantBeef> ` dao : DAO<Produto>` `<>` is not correct |
22:13:18 | FromDiscord | <haniel.> ok, so what i do? |
22:14:22 | FromDiscord | <haniel.> i simply just don't know how to proceed |
22:16:43 | FromDiscord | <bostonboston> [] for generics |
22:19:25 | Amun-Ra | what i do? read up the docs a little bit |
22:30:23 | FromDiscord | <leelikesfries> sent a code paste, see https://play.nim-lang.org/#pasty=kxksCNBe |
22:30:34 | FromDiscord | <leelikesfries> i need to know the exact error so i can fix it |
22:31:05 | FromDiscord | <leelikesfries> (edit) "https://play.nim-lang.org/#pasty=sXkOGkyT" => "https://play.nim-lang.org/#pasty=ztEmvvYN" |
22:53:20 | FromDiscord | <arkanoid> I don't remember how to turn an untyped parameter into a string. I want to echo it. I tried echo "`myarg`" but it prints `myarg` |
22:53:37 | FromDiscord | <arkanoid> dammit, chat formatting is messing up my backticks |
22:57:03 | FromDiscord | <demotomohiro> https://internet-of-tomohiro.pages.dev/nim/faq.en#macro-how-to-echo-nimnodeqmark |
22:57:13 | * | ntat quit (Quit: Leaving) |
23:02:44 | FromDiscord | <carrocho> @everyone algum br pra me ajudar em um probleminha de nim? |
23:04:20 | FromDiscord | <nnsee> please don't attempt to ping everyone |
23:04:46 | FromDiscord | <nnsee> state your problem and people will come and try to help you |
23:05:31 | FromDiscord | <arkanoid> if I run `jobThread(configurationJob, config.configurationIntervalS):` the `proc configurationJob` is successfully created, but, the log prints `INFO: 000000010DE89C53 job started` |
23:06:21 | FromDiscord | <carrocho> In reply to @nnsee "state your problem and": sorry man, thanks |
23:08:18 | FromDiscord | <zumi.dxy> this is not that small of a server 😭 |
23:09:02 | FromDiscord | <leelikesfries> the nim community must continue to grow |
23:10:13 | FromDiscord | <carrocho> so, i am creating a generic object and trying to put as a variable in another one, how do i do that? https://media.discordapp.net/attachments/371759389889003532/1333212423703756860/image.png?ex=67981253&is=6796c0d3&hm=27d40f2c07cbab8d6b512e74073a992cb217ef9566c4cc91921a2c23334cb4cc& https://media.discordapp.net/attachments/371759389889003532/1333212423938899988/image.png?ex=67981253&is=6796c0d3&hm=0ba271fafd558353fd30cf3435f5b57267a13f12 |
23:11:36 | FromDiscord | <demotomohiro> In reply to @carrocho "so, i am creating": https://nim-lang.org/docs/manual.html#generics |
23:13:46 | FromDiscord | <carrocho> In reply to @demotomohiro "https://nim-lang.org/docs/manual.html#generics": I read this, and it only says how to use generic variables like, int/string etc, not objects at all |
23:14:36 | FromDiscord | <carrocho> (edit) "variables like," => "variables, like" |
23:14:53 | FromDiscord | <carrocho> (edit) "etc, not" => "etc. Not" |
23:15:53 | FromDiscord | <demotomohiro> You can also give object types to generics. |
23:17:43 | FromDiscord | <arkanoid> I've found the asnwer, it's `astToStr(id)`. demotomohiro you should add it to your macro guide! |
23:19:32 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=YLNnweHV |
23:22:00 | FromDiscord | <carrocho> sent a code paste, see https://play.nim-lang.org/#pasty=MBHFxnzE |
23:24:20 | FromDiscord | <demotomohiro> @arkanoid Thank you, I will add about `astToStr`. |
23:27:31 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=YLfNdqgG |
23:31:11 | FromDiscord | <carrocho> sent a long message, see https://pasty.ee/eShRhcBe |
23:33:26 | FromDiscord | <carrocho> sent a long message, see https://pasty.ee/JCWVPpFi |
23:33:54 | FromDiscord | <carrocho> (edit) "https://pasty.ee/zMMDGDyK" => "https://pasty.ee/eSqpCTaV" |
23:43:46 | FromDiscord | <demotomohiro> > `dao: DAO[e]`↵You cannot pass the field to generic parameter.↵You can pass the type of field to generic parameter like `dao: DAO[Entidate]`. |
23:46:18 | FromDiscord | <carrocho> In reply to @demotomohiro "> `dao: DAO[e]` You": I tried that before https://media.discordapp.net/attachments/371759389889003532/1333221509056954530/image.png?ex=67981ac9&is=6796c949&hm=53b79422e4803117aa44e15496b495ef785b18317166b9fd44b3a06cd6d41bf8& https://media.discordapp.net/attachments/371759389889003532/1333221509451350099/image.png?ex=67981ac9&is=6796c949&hm=66e8c38b6b296f9bd98a435887909588d73346078ff86346eb93cfc1130b9448& |
23:49:17 | * | kasimir_ left #nim (#nim) |
23:49:22 | * | kasimir_ joined #nim |
23:50:02 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=fTaoPVpf |
23:50:41 | * | beholders_eye quit (Ping timeout: 248 seconds) |
23:56:41 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=FZiWekGw |
23:59:40 | FromDiscord | <carrocho> i dont know why, but it worked now, ty. But now I have another problem, how I create a method or proc to return instance like: https://media.discordapp.net/attachments/371759389889003532/1333224871039340627/image.png?ex=67981deb&is=6796cc6b&hm=cf803f3cc01fa6e14db8d06d076047a96cbb31822df148c588c7f40d23d21c82& |