00:05:59 | FromDiscord | <Patitotective> warcrime, beef? https://media.discordapp.net/attachments/371759389889003532/1030270208025317436/unknown.png |
00:12:17 | FromDiscord | <Elegantbeef> Why wouldnt it be legal↵(@Bung) |
00:22:59 | FromDiscord | <Elegantbeef> No clue↵(@Patitotective) |
00:23:46 | FromDiscord | <Elegantbeef> What's that for? |
00:29:34 | * | derpydoo joined #nim |
00:38:02 | FromDiscord | <Patitotective> sent a long message, see http://ix.io/4d63 |
00:38:09 | FromDiscord | <Patitotective> (edit) "http://ix.io/4d63" => "http://ix.io/4d64" |
00:38:27 | FromDiscord | <Elegantbeef> Did you consider `mixin decode`? |
00:38:52 | FromDiscord | <Elegantbeef> Like what are you trying to work around |
00:38:53 | FromDiscord | <Patitotective> i did not |
00:39:22 | FromDiscord | <Elegantbeef> Also you likely should change the ringabout example |
00:40:05 | FromDiscord | <Elegantbeef> They tried to remove identifiable information on github and you just added it back 😄 |
00:40:59 | FromDiscord | <Patitotective> In reply to @Elegantbeef "Like what are you": work around myself↵i should better look for an already existing code that deserializes stuff |
00:41:06 | FromDiscord | <Patitotective> In reply to @Elegantbeef "They tried to remove": didnt know 🧠 |
00:41:23 | FromDiscord | <Elegantbeef> Though there are other things that point to them |
00:41:24 | FromDiscord | <Elegantbeef> So who knows |
00:42:32 | FromDiscord | <Elegantbeef> When you're using generic procedures like this you'll generally want to do `mixin` decode so people can override their procedures↵(@Patitotective) |
00:42:47 | FromDiscord | <Elegantbeef> This is how Jsony, jsonutils, and other serialise libraries work |
01:01:52 | FromDiscord | <Patitotective> perhaps naming all the procedures `decode` doesnt help my brain to try to understand what it wrote |
01:17:17 | FromDiscord | <! Nilts> how would I turn `helloworld` to `[0x68,0x65,0x6C,0x6C,0x6F,0x77,0x6F,0x72,0x6C,0x64]` and back again in nim? |
01:19:45 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4d6e |
01:21:07 | FromDiscord | <! Nilts> Thanks! but is from valid? |
01:21:24 | FromDiscord | <Patitotective> no |
01:21:26 | FromDiscord | <Patitotective> use something else |
01:21:45 | FromDiscord | <! Nilts> ok |
01:25:30 | FromDiscord | <Elegantbeef> From string to openarray[byte] can be done with `toOpenArrayByte(s, 0, s.high)` |
01:25:39 | FromDiscord | <Patitotective> 🧠 |
01:25:49 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4d6g |
01:26:25 | FromDiscord | <Patitotective> In reply to @not logged in "i get this: `@[72,": huh? |
01:26:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6i |
01:27:18 | FromDiscord | <Elegantbeef> Those arent hex those are binary values |
01:27:22 | FromDiscord | <Elegantbeef> decimal values rather |
01:27:25 | FromDiscord | <Elegantbeef> I'll get it right eventually |
01:28:23 | FromDiscord | <! Nilts> In reply to @Elegantbeef "Those arent hex those": i want hex, also what imports do i need for your latest snippet |
01:28:30 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
01:29:15 | FromDiscord | <Elegantbeef> You want the hex representation of a string? |
01:29:26 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/strutils.html#toHex%2Cstring |
01:29:40 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/strutils.html#fromHex%2Cstring |
01:29:45 | FromDiscord | <Elegantbeef> With my code you dont need anything |
01:30:04 | FromDiscord | <Elegantbeef> Whoops there is no fromHex for strings 😄 |
01:30:39 | FromDiscord | <Elegantbeef> `parseHexStr` |
01:30:47 | FromDiscord | <Patitotective> beef's high, he writes urls manually |
01:31:04 | FromDiscord | <Elegantbeef> I dont do drugs pat! |
01:33:22 | * | arkurious quit (Quit: Leaving) |
01:35:03 | FromDiscord | <! Nilts> In reply to @Elegantbeef "https://nim-lang.org/docs/strutils.html#toHex%2Cstr": what it gives it a string not a seq. is the split fun in nim just spilt? |
01:35:12 | FromDiscord | <Bung> In reply to @Elegantbeef "Why wouldnt it be": see there's test case ensure errorhttps://github.com/nim-lang/Nim/pull/20549 |
01:36:01 | FromDiscord | <! Nilts> (edit) "fun" => "func" |
01:37:23 | FromDiscord | <Elegantbeef> Those are different though |
01:37:48 | FromDiscord | <Elegantbeef> `var iii = it` does nothing but instantiate the closure iterator |
01:38:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6k |
01:38:54 | FromDiscord | <! Nilts> In reply to @not logged in "what it gives it": i need to turn 48656C6C6F20576F726C64 into a seq with every 2 chars. |
01:40:26 | FromDiscord | <huantian> what are you trying to do? maybe it would be better to just encode your strings as base64 instead of hex |
01:40:47 | FromDiscord | <ChocolettePalette> 48, 65, 6C... ?Just create an empty seq and populate it with those characters |
01:41:11 | FromDiscord | <Elegantbeef> The question in my world is why do you need to have the string representation of the binary data 😄 |
01:41:41 | FromDiscord | <! Nilts> In reply to @huantian "what are you trying": i kind know how to use hex, i have no clue how to use b64 to mess with and edit bytes and bits. |
01:41:43 | FromDiscord | <Patitotective> In reply to @Elegantbeef "This is how Jsony,": whats this monster https://github.com/nim-lang/Nim/blob/version-1-6/lib/std/jsonutils.nim#L149 |
01:41:48 | FromDiscord | <ChocolettePalette> To send it via json maybe to further receive it and encode to binary again |
01:42:02 | FromDiscord | <Bung> tests/closure/tinvalidclosure4.nim |
01:42:15 | FromDiscord | <Elegantbeef> base....6.... |
01:42:52 | FromDiscord | <Elegantbeef> That is invalid though bung |
01:43:00 | FromDiscord | <Bung> so what's this problem, it works why illegal |
01:43:05 | FromDiscord | <Elegantbeef> `proc b {.nimcall.} = echo v` requires capturing `v` |
01:44:18 | FromDiscord | <Elegantbeef> What does this print with your changes |
01:44:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6l |
01:46:15 | FromDiscord | <Bung> I must get out of my bed first |
01:46:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6m |
01:46:47 | FromDiscord | <Patitotective> In reply to @Bung "I must get out": its almost bedtime, what are you saying |
01:47:21 | FromDiscord | <Elegantbeef> `a` being used inside the local proc causes the compiler to raise by copy the parameter into the closure's environment |
01:52:51 | FromDiscord | <Bung> In reply to @Patitotective "its almost bedtime, what": I sleep at about 6 am , now it's 10 am, I wake up |
01:53:08 | FromDiscord | <Elegantbeef> 4 hours of sleep and now you're looking at closures |
01:53:17 | FromDiscord | <Patitotective> In reply to @Elegantbeef "4 hours of sleep": lmao |
01:53:21 | FromDiscord | <Elegantbeef> I'm sorry for your loss |
01:54:26 | FromDiscord | <Patitotective> In reply to @Bung "I sleep at about": healthy |
01:54:34 | FromDiscord | <Bung> oh just tried the code |
01:54:37 | FromDiscord | <Bung> Hello300↵5 |
01:55:36 | FromDiscord | <Elegantbeef> hmph not what i expected |
01:56:00 | FromDiscord | <Elegantbeef> I guess where `a` points to is valid in this case.... hmmm |
01:57:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6y |
01:57:14 | FromDiscord | <Elegantbeef> Try that if you dont mind |
01:57:20 | FromDiscord | <Elegantbeef> If you do tell me to sod off |
01:59:04 | FromDiscord | <Bung> this is bad cgen |
01:59:11 | FromDiscord | <Elegantbeef> There you go |
01:59:15 | FromDiscord | <Bung> @mtinvalidclosure7.nim.c:188:18: error: incompatible types when assigning to type 'tyProcT4eqaYlFJYZUv9aG9b1TV0bQ' {aka 'void ()(void)'} from type 'tyProcHzVCwACFYM9cx9aV62PdjtuA' ↵ 188 | result = T2_; |
01:59:35 | FromDiscord | <Elegantbeef> The compiler is at odds of what is valid 😄 |
02:00:09 | FromDiscord | <Elegantbeef> It's an illegal capture regardless nimcalls cannot have an environment, that code requires an environment to function outside of `outer` |
02:00:30 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4d6B |
02:00:47 | FromDiscord | <Bung> the old version nim only do s.typ.kind check in illegalCapture |
02:00:49 | FromDiscord | <Elegantbeef> If you remove `nimCall` it'll work with no issue |
02:02:23 | FromDiscord | <Elegantbeef> Well it also uses `illegalCapture` |
02:02:24 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=4d6B" => "https://play.nim-lang.org/#ix=4d6C" |
02:02:45 | FromDiscord | <Elegantbeef> The old code is right in this case |
02:03:10 | FromDiscord | <Elegantbeef> The bug is `owner.typ.callConv == ccNimCall and tfExplicitCallConv notin owner.typ.flags` should be `(owner.typ.callConv == ccNimCall and tfExplicitCallConv notin owner.typ.flags)` i thinks |
02:03:29 | FromDiscord | <Elegantbeef> Fuck |
02:03:46 | FromDiscord | <Elegantbeef> Anyway |
02:04:41 | FromDiscord | <Bung> I say very old version like s.typ.kind in {tyVar,....} |
02:04:54 | FromDiscord | <Elegantbeef> I might be wrong with that line |
02:05:00 | FromDiscord | <Elegantbeef> Need to look at the bug again |
02:06:11 | FromDiscord | <Elegantbeef> Yea relooking at it the bug isnt in this proc |
02:06:24 | FromDiscord | <Elegantbeef> the bug is that `markAsClosure` is getting called in a state that it shouldnt |
02:08:40 | FromDiscord | <Bung> now problem become from "which is invalid capture" to "which is valid markAsClosure " |
02:08:54 | FromDiscord | <Elegantbeef> Yes |
02:10:12 | FromDiscord | <Bung> current behavior is like when it access outer variable it call `markAsClosure ` |
02:10:48 | FromDiscord | <Elegantbeef> I see that, there seems to be a case where it shouldnt be called but it is |
02:15:55 | FromDiscord | <Bung> I can make closure iterater pass markAsClosure , but not sure if it's right |
02:17:27 | FromDiscord | <Bung> if something illegalCapture in `it` should check on `it` its self |
02:18:18 | FromDiscord | <Elegantbeef> Does it error at 475 or 499? |
02:21:06 | FromDiscord | <Mr.Ender> sent a code paste, see https://play.nim-lang.org/#ix=4d6G |
02:21:07 | FromDiscord | <Bung> sent a code paste, see https://paste.rs/uPN |
02:21:14 | FromDiscord | <Mr.Ender> sorry for overposting |
02:21:36 | FromDiscord | <Mr.Ender> (edit) "sorry for overposting ... " added "my discord was scrolled up so I did not see these messages" |
02:22:16 | FromDiscord | <Bung> dont be |
02:22:46 | FromDiscord | <huantian> In reply to @Mr.Ender "Hello im trying to": you might have better luck using <https://github.com/jiro4989/setup-nim-action> |
02:22:57 | FromDiscord | <Mr.Ender> In reply to @huantian "you might have better": Ill have a look into it |
02:23:07 | FromDiscord | <huantian> I don't know what it uses to install nim, but it's always been the easiest way for me to install the latest version of nim on github actions |
02:26:37 | FromDiscord | <Mr.Ender> ok |
02:29:19 | FromDiscord | <Elegantbeef> Yea bung whatever wrong is subtly wrong and i'm not seeing it |
02:32:37 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4d6J |
02:33:04 | FromDiscord | <Bung> In reply to @Elegantbeef "Yea bung whatever wrong": I just modify one line make all these test case pass |
02:33:20 | FromDiscord | <Elegantbeef> Yea but that one test shouldnt pass |
02:34:06 | FromDiscord | <Bung> which one? |
02:34:18 | FromDiscord | <Elegantbeef> The one you removed |
02:35:08 | FromDiscord | <Bung> it's s till illegal capture |
02:35:23 | FromDiscord | <Elegantbeef> So why did you remove it? |
02:35:59 | FromDiscord | <Bung> the modified I just made seconds ago make this result. |
02:36:03 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/ORH |
02:36:04 | FromDiscord | <Elegantbeef> Ah |
02:36:19 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4d6K |
02:36:30 | FromDiscord | <Elegantbeef> Yea that seems to be right |
02:37:07 | FromDiscord | <Bung> yea, it will not mark it as closure |
02:37:18 | FromDiscord | <Bung> the issue one |
02:37:31 | FromDiscord | <Elegantbeef> I'm thinking semantically and yea i'm fairly certain that's 100% right 😄 |
02:38:03 | FromDiscord | <Elegantbeef> The procedure is checked to see if it needs an environment |
02:38:06 | FromDiscord | <sOkam!> If so, I'm missing it |
02:38:10 | FromDiscord | <Bung> hmm, I'll just push it see what others see or maybe there are CI fails... |
02:38:13 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4d6L |
02:38:20 | FromDiscord | <Bung> (edit) "see" => "say" |
02:38:23 | FromDiscord | <Elegantbeef> If you use streams properly yes↵(@sOkam!) |
02:38:42 | FromDiscord | <Elegantbeef> Streams are what you're likely doing but better |
02:38:44 | FromDiscord | <sOkam!> Is there a manual entry about them? |
02:38:52 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/streams.html |
02:39:01 | FromDiscord | <Elegantbeef> Every library has docs |
02:39:14 | FromDiscord | <Elegantbeef> every stdlib module has docs |
02:39:29 | FromDiscord | <sOkam!> Well, but some are just the prototype without any text |
02:41:41 | FromDiscord | <ChocolettePalette> This one has both text and examples doe |
02:42:50 | FromDiscord | <sOkam!> This is for a TGA implementation PR for pixie, btw↵Seems like treeform was using strings because they found them to be 10-50% faster than streams |
02:43:20 | FromDiscord | <Elegantbeef> Eh with 2.0 that's not likely the case |
02:44:12 | FromDiscord | <Elegantbeef> Anyway you can do the same with the string it's just silly |
02:44:51 | FromDiscord | <sOkam!> kk ty ✍️ |
02:45:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6M |
02:46:01 | NimEventer | New thread by KerryC: Introducing PhylogeNi and BioSeq, see https://forum.nim-lang.org/t/9528 |
02:51:32 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4d6O |
02:53:32 | FromDiscord | <Elegantbeef> Guess what i suggest isnt right |
02:56:47 | FromDiscord | <Bung> hmm. tests/closure/tmacrobust1512.nim fails. |
02:57:27 | FromDiscord | <Bung> it try get env param, however markAsClosure and addClosureParam are called same time. |
03:08:51 | * | derpydoo quit (Quit: derpydoo) |
03:29:36 | FromDiscord | <sOkam!> Is the LSP being dumb here, or am I the dumb one? https://media.discordapp.net/attachments/371759389889003532/1030321449174573147/unknown.png |
03:30:11 | FromDiscord | <Elegantbeef> Likely the former |
03:31:29 | FromDiscord | <sOkam!> actually the latter, its a let 🤦♂️ |
03:31:48 | * | xet7 joined #nim |
04:15:35 | FromDiscord | <Prestige> Error message could've been more helpful eh |
04:16:31 | FromDiscord | <Elegantbeef> immutable mismatches are the most common that confuse people |
04:18:36 | FromDiscord | <Patitotective> wonder how the compiler sorts the mismatches, would be nice to have the ones that match signature but expect mutable arguments |
04:18:46 | FromDiscord | <Elegantbeef> PRs welcome |
04:19:44 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/compiler/sigmatch.nim#L2219-L2281 |
04:41:03 | FromDiscord | <Mr.Ender> sent a code paste, see https://play.nim-lang.org/#ix=4d7b |
04:41:27 | FromDiscord | <Elegantbeef> Given they're both constants the latter might be better |
04:41:38 | FromDiscord | <Elegantbeef> If they are not constants the former likely will be better |
04:41:43 | FromDiscord | <Mr.Ender> ok |
05:05:05 | FromDiscord | <sOkam!> Is there something that can iterate through the bytes of any type?↵Saying something like `for byte in someCustomTypedVar: #doThing` |
05:17:18 | FromDiscord | <Bung> how to solve nimscript error when run `koch temp` during `git bitsect` ,when back to v1.4 it will be error |
05:46:16 | * | kenran joined #nim |
05:55:00 | * | kenran quit (Remote host closed the connection) |
06:16:28 | * | kenran joined #nim |
06:45:27 | FromDiscord | <fbpyr> sent a code paste, see https://play.nim-lang.org/#ix=4d7z |
06:46:47 | FromDiscord | <Elegantbeef> https://github.com/juancarlospaco/psutil-nim/blob/master/src/psutil.nim#L277-L295 |
06:46:49 | FromDiscord | <Elegantbeef> It's not exported |
06:47:04 | FromDiscord | <Elegantbeef> you can do `import psutil/psutil_inux` |
06:47:10 | FromDiscord | <Elegantbeef> God i hate that naming |
06:49:57 | FromDiscord | <fbpyr> oh I see. Elegantbeef thank you! |
06:55:32 | * | neceve quit (Quit: ZNC - https://znc.in) |
06:58:29 | * | neceve joined #nim |
07:04:28 | * | PMunch joined #nim |
07:05:13 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
08:20:03 | * | genpaku quit (Remote host closed the connection) |
08:20:44 | * | genpaku joined #nim |
08:30:49 | FromDiscord | <untoreh> is a case expr on a `static` wrapped type resolved at compile time? |
08:31:22 | FromDiscord | <untoreh> or more in general to other kind of expression to I guess |
08:31:27 | * | rockcavera quit (Remote host closed the connection) |
09:14:48 | * | sagax joined #nim |
09:47:29 | NimEventer | New thread by tubbs: Access type from two different files, see https://forum.nim-lang.org/t/9529 |
10:13:22 | FromDiscord | <Bung> In reply to @untoreh "or more in general": yeah as it's named as `static` |
10:42:02 | * | jmdaemon quit (Ping timeout: 268 seconds) |
11:21:00 | * | arkurious joined #nim |
11:27:25 | * | jjido joined #nim |
11:54:18 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:08:50 | FromDiscord | <AbdullahLn> ها |
12:22:17 | FromDiscord | <rdb> sent a code paste, see https://play.nim-lang.org/#ix=4d8O |
12:22:48 | FromDiscord | <jos> generally speaking, is using a c library directly in nim tolerable? or should you wrap it up |
12:29:50 | PMunch | @jos, well you need to do some kind of wrapping |
12:30:01 | PMunch | Or rather, you need to tell Nim how the C library works |
12:30:23 | PMunch | But using a C-interface library in Nim isn't a problem, it's a bit clumsy at times, but works well enough |
12:30:43 | PMunch | To automatically generate the wrapping you can have a look at Futhark |
12:32:10 | FromDiscord | <Phil> In reply to @rdb "So, when I do": They are implicitly assumed to be the same type unless you explicitly make them different |
12:32:13 | PMunch | I plan on writing an article on this hopefully in the near future, as there are some tricks to get a library fully integrated with async and garbage collection |
12:33:20 | FromDiscord | <rdb> In reply to @Isofruit "They are implicitly assumed": By "explicitly make them different" you mean by doing `proc myfunc[T0, T1, T2: float32 | float64](tup: tuple[x: T0, y: T1, z: T2]) = ...` ?↵That does seem to work, thank you, and good to know that the behaviour is intended. |
12:33:25 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4d8P |
12:34:15 | FromDiscord | <rdb> Also, good to know about SomeFloat. 🙂 |
12:35:22 | FromDiscord | <Phil> sent a long message, see http://ix.io/4d8Q |
12:35:34 | FromDiscord | <rdb> Thank you! |
12:36:13 | FromDiscord | <Phil> You can also very easily make them yourself via Type aliasing:↵`type A = float64 | float32 | float` etc., thouh you might already be aware of this |
12:36:25 | FromDiscord | <Phil> (edit) "thouh" => "though" |
12:36:49 | FromDiscord | <Bung> don't rely generic type constraints it's not fully complete |
12:37:18 | FromDiscord | <Phil> It hasn't screwed me over yet and I've used generics fairly in depths |
12:38:16 | FromDiscord | <Phil> Though mostly the type constraint that a type must be a subtype of model |
12:38:19 | FromDiscord | <Bung> the default match state is matched |
12:38:59 | FromDiscord | <Bung> so in some case that should not match but it takes as a generic without constraints |
12:40:44 | * | PMunch quit (Quit: Leaving) |
12:42:21 | NimEventer | New thread by drkameleon: From too many copies to too few, see https://forum.nim-lang.org/t/9530 |
12:47:24 | FromDiscord | <fbpyr> in regex ( https://github.com/nitely/nim-regex ) does anybody know if there is a way to retrieve the originating re string back from the `Regex` object?↵(for debugging purpose..) |
12:50:48 | * | PMunch joined #nim |
12:56:13 | * | jjido joined #nim |
12:56:45 | * | derpydoo joined #nim |
14:06:32 | * | PMunch quit (Quit: Leaving) |
14:17:04 | * | ox is now known as oz |
14:22:04 | * | kenran quit (Remote host closed the connection) |
14:22:26 | * | rockcavera joined #nim |
14:22:26 | * | rockcavera quit (Changing host) |
14:22:26 | * | rockcavera joined #nim |
14:27:16 | * | derpydoo quit (Quit: derpydoo) |
14:33:27 | FromDiscord | <auxym> I use regex a lot instead of the stdlib re, but no, I'm not aware of a way to do that. there's the groups proc that takes the string as a third arg. |
14:33:53 | FromDiscord | <auxym> You could make your own wrapper object/procs that wrap regex though, and store the string in that? |
14:34:13 | FromDiscord | <Rika> wasnt this asked a while back? |
14:42:37 | FromDiscord | <fbpyr> thank you @auxym 🙂↵indeed regex is nice, so I do not need handle an extra dll on win10..↵↵hah wrapping it - interesting idea, I will give it a try. |
14:55:00 | FromDiscord | <auxym> Yeah, I'd just create a wrapper around the https://nitely.github.io/nim-regex/regex/nfatype.html#RegexMatch that adds a field for the original string. Then create your own match/find proc that stores the string and returns your new wrapper type |
15:10:33 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
15:31:30 | * | derpydoo joined #nim |
16:24:11 | * | rez joined #nim |
16:34:48 | FromDiscord | <! Nilts> What kinds of errors can i raise? |
16:36:22 | FromDiscord | <Patitotective> In reply to @not logged in "What kinds of errors": any `object of Exception` https://nim-lang.org/docs/manual.html#exception-handling-raise-statement |
17:38:12 | FromDiscord | <Phil> Can I replace a symbol with the value of the symbol at compile-time? |
17:40:00 | FromDiscord | <Patitotective> sent a long message, see http://ix.io/4da2 |
17:41:49 | FromDiscord | <Phil> SomeTable is your own creation? |
17:42:25 | FromDiscord | <Patitotective> `SomeTable[A, B] = (Table[A, B] or OrderedTable[A, B])` |
17:45:05 | FromDiscord | <Phil> Hmmm the type checking matches |
17:46:49 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4da3 |
17:47:22 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4da3" => "https://play.nim-lang.org/#ix=4da4" |
17:47:38 | FromDiscord | <Patitotective> hmm |
18:11:55 | FromDiscord | <Patitotective> In reply to @Patitotective "This does not make": @ElegantBeef welp |
18:29:07 | * | kenran joined #nim |
18:50:17 | FromDiscord | <Patitotective> the problem seems to be that the body of the `proc decodeHook[T](a: var SomeTable[string, T], b: KdlNode)` proc is what makes `compiles(decodeHook(a, b))` fail |
18:50:38 | FromDiscord | <Patitotective> (edit) removed "proc" |
18:50:56 | * | kenran quit (Remote host closed the connection) |
18:51:13 | FromDiscord | <Patitotective> i think this will work better overloading procedures |
18:51:23 | * | kenran joined #nim |
18:52:18 | FromDiscord | <Patitotective> (edit) "procedures" => "procs instead of `when T is type`" |
18:53:09 | * | kenran quit (Remote host closed the connection) |
18:55:13 | FromDiscord | <Patitotective> or if there were a procedure that finds an overload that matches some signature `overloads(foo(args))` |
18:59:01 | * | wallabra_ joined #nim |
19:01:11 | FromDiscord | <Ekopalypse> sent a code paste, see https://play.nim-lang.org/#ix=4dam |
19:01:15 | * | wallabra quit (Ping timeout: 250 seconds) |
19:01:15 | * | wallabra_ is now known as wallabra |
19:37:41 | FromDiscord | <Horizon [She/Her]> In reply to @PMunch "I plan on writing": Oh neat |
19:38:09 | * | kenran joined #nim |
19:38:14 | FromDiscord | <Horizon [She/Her]> Tbh i need to poke around in Futhark to make it not export numbered identifiers for better autocompletion |
19:45:59 | * | kenran quit (Read error: Connection reset by peer) |
20:16:49 | * | ttkap joined #nim |
20:22:50 | * | wallabra quit (Remote host closed the connection) |
20:23:05 | * | wallabra joined #nim |
20:30:55 | FromDiscord | <michaelb.eth> making use of `setControlCHook`, is it possible to have the exit code be `0` instead of `130` when the user stops the process with ctrl-c? |
20:31:53 | FromDiscord | <michaelb.eth> if in another shell I do `kill -SIGINT [pid]` the proc I passed to `setControlCHook` runs and the exit code is `0` |
20:32:09 | FromDiscord | <michaelb.eth> but when pressing ctrl-c I get `130` |
20:32:55 | FromDiscord | <michaelb.eth> I guess there's nothing necessarily wrong with it, but quitting a program like e.g. `top` by pressing ctrl-c results in exit code `0` |
20:33:29 | FromDiscord | <michaelb.eth> iow, if ctrl-c is the normal/expected way to stop the program, seems like `0` would be more appropriate |
20:36:15 | FromDiscord | <enthus1ast> i wonder i you can call exit(0) in the handler |
20:38:48 | * | kenran joined #nim |
20:39:45 | FromDiscord | <michaelb.eth> actually nevermind, `quit(QuitSuccess)` is working as expected. It's because I'm invoking the built executable with `make run`, so it's `make` that's exiting with `130` |
20:40:14 | FromDiscord | <michaelb.eth> (edit) "expected." => "expected, i.e. resulting in exit code `0`." |
20:45:00 | * | derpydoo quit (Quit: derpydoo) |
20:47:33 | * | kenran quit (Remote host closed the connection) |
21:10:46 | * | jmdaemon joined #nim |
21:13:25 | strogon14 | I just handle all signals, including SIGINT, with my own signal handlers: https://github.com/SpotlightKid/jacket/blob/master/examples/signal.nim |
21:14:48 | strogon14 | use it with e.g.: setSignalProc(signalCb, SIGABRT, SIGHUP, SIGINT, SIGQUIT, SIGTERM) |
21:26:23 | FromDiscord | <michaelb.eth> nice |
22:12:24 | * | xet7 quit (Remote host closed the connection) |
22:27:41 | FromDiscord | <Elegantbeef> Do you have a more specific overload?↵(@Patitotective) |
22:29:17 | FromDiscord | <Patitotective> In reply to @Elegantbeef "Do you have a": :p i found the issue `compiles(decodeHook(a, b))` indend finds the correct overload but the body of the procedure had a compile error so it caused the `compiles` proc to return false |
22:29:25 | FromDiscord | <Patitotective> (edit) "issue `compiles(decodeHook(a," => "issue↵`compiles(decodeHook(a," |
22:29:31 | FromDiscord | <Patitotective> (edit) "indend" => "indeed" |
22:29:39 | FromDiscord | <Patitotective> (edit) "return false" => "fail" |
22:29:44 | FromDiscord | <Patitotective> (edit) "fail" => "return false" |
22:30:50 | FromDiscord | <Elegantbeef> Yea quit using the compiles check |
22:30:53 | FromDiscord | <Elegantbeef> There is no reason to |
22:31:01 | FromDiscord | <Elegantbeef> just do `decode` and carry on |
22:32:52 | FromDiscord | <Patitotective> In reply to @Elegantbeef "just do `decode` and": buuuut custom hooks are named `decodeHook`↵should i also name them `decode`? |
22:33:20 | FromDiscord | <Elegantbeef> I dont see why you'd need `hook` |
22:33:52 | FromDiscord | <Patitotective> 🤷♂️ jsonutils does that |
22:36:28 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4db4 |
22:36:29 | FromDiscord | <Elegantbeef> Dont use a `compiles` check for dispatching the generic interface, use overloading |
22:38:08 | FromDiscord | <Patitotective> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4db4": :] |
22:38:34 | FromDiscord | <Elegantbeef> Nim's dispatch chooses the most precise procedure for overloads, so you can without hassle get a nice API |
22:45:07 | FromDiscord | <Patitotective> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4db4": if `decode` is `save`, what would `encode` be? 🤔 `unsave` :p |
22:45:18 | FromDiscord | <Elegantbeef> Whatever you want |
22:45:32 | FromDiscord | <Elegantbeef> You can name it whatever |
22:45:49 | FromDiscord | <Patitotective> you know im really bad at naming things |
22:46:02 | FromDiscord | <Elegantbeef> You could use `kdlDecode` and `kdlDecodeHook` or whatever |
22:46:08 | FromDiscord | <Elegantbeef> Point was mostly you dont need a `when compiles` |
23:07:46 | FromDiscord | <Patitotective> this is a bit more what i want https://play.nim-lang.org/#ix=4db7 |
23:08:49 | FromDiscord | <Elegantbeef> I dont get the point of `saveStr` and `saveString` but you do you |
23:09:39 | FromDiscord | <Patitotective> In reply to @Elegantbeef "I dont get the": huuuuuuuuuuuh? i may be blind but i dont see any `saveString` |
23:09:50 | FromDiscord | <Elegantbeef> sorry saveint |
23:09:53 | FromDiscord | <Elegantbeef> Brain fart |
23:16:26 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4db9 |
23:16:54 | FromDiscord | <Patitotective> `proc decodeHook[T: array](a: KdlVal, v: var T)` works |
23:24:12 | FromDiscord | <Patitotective> is there a way to do `proc foo[T](...): T` instead of `proc foo[T](_: typedesc[T], ...): T`? https://play.nim-lang.org/#ix=4dbb |
23:26:08 | FromDiscord | <huantian> uh wdym |
23:27:26 | FromDiscord | <Patitotective> i want to be able to call `foo` like this `foo[int]()` instead of `foo(int)` |
23:28:45 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4dbc |
23:31:40 | FromDiscord | <Elegantbeef> Yea it does |
23:31:40 | FromDiscord | <Elegantbeef> Pat is... being pat |
23:32:35 | FromDiscord | <Patitotective> hMMmMMm |
23:32:50 | FromDiscord | <Patitotective> these bugs try to gaslight me |