00:01:20 | FromDiscord | <albassort> cant get any of these gui libraries to compile |
00:01:26 | FromDiscord | <albassort> having a problem linking with gcc |
00:03:26 | FromDiscord | <albassort> https://github.com/khchen/wNim/tree/master/examples |
00:03:35 | FromDiscord | <albassort> can anyone get these examples to compile? |
00:10:40 | FromDiscord | <guttural666> how can I get the number of fields of an object? |
00:10:45 | FromDiscord | <.tochka> `Error: cannot generate VM code for ` kinda cool |
00:13:02 | FromDiscord | <wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4gY9 |
00:14:36 | FromDiscord | <guttural666> In reply to @wick3dr0se "Could you guys help": https://nim-lang.org/docs/os.html#walkDir.i%2Cstring |
00:14:52 | FromDiscord | <wick3dr0se> I was looking at that proc earlier actually |
00:15:35 | FromDiscord | <wick3dr0se> In reply to @wick3dr0se "would std/os walkDir be": I think walkPattern may be even better? |
00:16:11 | FromDiscord | <.tochka> In reply to @guttural666 "how can I get": there's field iterator in system/iterators, could could via that, maybe there's better way |
00:16:32 | FromDiscord | <.tochka> (edit) "could" => "work" | "that," => "that probably," |
00:16:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/xli |
00:16:57 | FromDiscord | <guttural666> In reply to @.tochka "there's field iterator in": yeah, wanted to avoid the caveman version of var i and then emtpy for looping over the fields just to count 😛 |
00:17:22 | FromDiscord | <guttural666> seems to be the way to go though haha |
00:17:36 | FromDiscord | <Elegantbeef> you can do `static: fieldCount(myObj)` and it does it at CT |
00:17:36 | FromDiscord | <wick3dr0se> So many like `walkPattern("./")` |
00:17:59 | FromDiscord | <guttural666> In reply to @Elegantbeef "you can do `static:": that's way better, thanks! |
00:18:41 | FromDiscord | <guttural666> In reply to @wick3dr0se "So many like `walkPattern("./*")`": https://media.discordapp.net/attachments/371759389889003532/1046218468577509386/image.png |
00:18:43 | FromDiscord | <Elegantbeef> You also could write a macro |
00:20:17 | FromDiscord | <wick3dr0se> Thanks.. I'm trying to write a macro that per each file in current directory, is a directory or regular file |
00:21:01 | FromDiscord | <wick3dr0se> I just got back to learning Nim, so I have to read back through my notes as I'm going |
00:21:55 | FromDiscord | <Elegantbeef> The macro comment was to guttural not you |
00:22:53 | FromDiscord | <wick3dr0se> In reply to @guttural666 "": Actually does what I just described above. Thanks a lot |
00:23:47 | FromDiscord | <guttural666> In reply to @wick3dr0se "Actually does what I": actually yields a tuple of kind and the actual path, but you'll figure it out with the docs |
00:25:32 | FromDiscord | <.tochka> In reply to @.tochka "`Error: cannot generate VM": what could cause that even |
00:25:33 | FromDiscord | <wick3dr0se> In reply to @guttural666 "actually yields a tuple": Hopefully lol. I'm going to attempt writing a small file manager. I managed to write a basic image getter-setter before but this requires more string manipulation and stuff I'm not familiar with yet |
00:26:34 | FromDiscord | <Elegantbeef> What are you using that relies on ``↵(@.tochka) |
00:27:02 | FromDiscord | <.tochka> error is in here https://media.discordapp.net/attachments/371759389889003532/1046220570838175824/image.png |
00:29:24 | FromDiscord | <Elegantbeef> Worth noting your code is equivlent to `abs(v.x abs(v.y abs(v.z)))` |
00:29:40 | FromDiscord | <.tochka> ye fixed it already |
00:29:43 | FromDiscord | <.tochka> lul |
00:30:04 | FromDiscord | <Elegantbeef> Are you calling area at CT for a type that relies on C interop? |
00:30:16 | FromDiscord | <.tochka> ok so looks like problem is in matrix https://play.nim-lang.org/#ix=4gYb |
00:33:34 | * | mahlon joined #nim |
00:33:58 | FromDiscord | <guttural666> sent a code paste, see https://play.nim-lang.org/#ix=4gYd |
00:34:16 | * | mahlon quit (Client Quit) |
00:35:41 | FromDiscord | <Elegantbeef> It's an implicit generic |
00:35:51 | FromDiscord | <Elegantbeef> it's the same as `proc countFields[T: object](obj: T): int` |
00:36:17 | FromDiscord | <guttural666> okay but I do need to specifiy that it is an object when doing it with the [T] syntax |
00:36:24 | FromDiscord | <Elegantbeef> It's a generic constraint |
00:36:37 | FromDiscord | <Elegantbeef> You technically should do `T: object or tuple` to be most specific |
00:36:52 | FromDiscord | <guttural666> ah okay |
00:37:04 | FromDiscord | <Elegantbeef> Though tuples have `typetraits.tuplelen` |
00:40:06 | * | krux02 quit (Remote host closed the connection) |
00:40:45 | FromDiscord | <Elegantbeef> This is an odd bug tochka |
00:41:43 | FromDiscord | <.tochka> tochka the bug hunter |
00:41:46 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4gYf does compile |
00:42:23 | FromDiscord | <guttural666> how do I set the nth element of a generic object? also with a loop over the fields? |
00:42:28 | FromDiscord | <Elegantbeef> RFC\: "Change tochka's name to dragonfly" |
00:42:39 | FromDiscord | <Elegantbeef> Yep↵(@guttural666) |
00:43:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gYh |
00:44:34 | FromDiscord | <Elegantbeef> whoops `enumerate obj.fields` |
00:45:33 | FromDiscord | <Elegantbeef> `when field is T` is needed aswell |
00:45:49 | FromDiscord | <.tochka> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4gYf does compile": looks like changing stuff to template is solution for almost everything |
00:45:52 | * | mahlon joined #nim |
00:46:17 | FromDiscord | <Elegantbeef> For a lot of things since pasting the code directly removes many issues |
00:47:40 | FromDiscord | <guttural666> wait wait, where is the enumerate going? and the when field is T is a type check against the thing I want to put for safety right? |
00:47:55 | FromDiscord | <Elegantbeef> It's not for safety it's cause it's required |
00:48:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gYj |
00:48:54 | FromDiscord | <guttural666> very cool, thanks! |
00:49:01 | FromDiscord | <Elegantbeef> You cannot do `someStringField = 300` |
00:49:43 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Isnt varargs[typed] type supposed to except anything? I get an error for my custom type |
00:50:02 | FromDiscord | <Elegantbeef> Inside a macro/template it should accept anything |
00:50:13 | FromDiscord | <Elegantbeef> Are you perhaps doing `[a, b]` instead of `a, b` |
00:50:30 | * | mahlon quit (Remote host closed the connection) |
00:51:22 | * | mahlon joined #nim |
00:52:37 | FromDiscord | <guttural666> that enumerate macro is really cool |
00:53:07 | FromDiscord | <Elegantbeef> yea it's the 'future' way of doing pairs iterators that just yield the index |
00:53:50 | FromDiscord | <guttural666> yeah, really useful when parallel looping through multiple collections or stuff like that |
00:55:13 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a long message, see http://ix.io/4gYk |
00:55:53 | FromDiscord | <Elegantbeef> You `OriNode` is a `ref object` |
00:55:59 | FromDiscord | <Elegantbeef> Nim does not have a `$` defined for `ref object` |
00:56:59 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > Nim does not have a `$` defined for `ref object`↵I tried adding one, it did nothing |
00:57:26 | FromDiscord | <Elegantbeef> Are you lying to me |
00:57:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gYl |
00:59:56 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gYm |
01:00:02 | FromDiscord | <Elegantbeef> Code or it didnt happen |
01:00:21 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gYo |
01:00:39 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://paste.rs/pV3 |
01:00:59 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gYr |
01:01:12 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gYs |
01:01:23 | FromDiscord | <@thatrandomperson5-6310e3b26da03> what? |
01:01:30 | FromDiscord | <wick3dr0se> It just keeps populating with duplicate edits plus changes 😄 |
01:01:30 | FromDiscord | <Yardanico> there's discord or IRC that are bridged as well, and you can ideally paste the code in a separate service |
01:01:34 | FromDiscord | <Elegantbeef> Provide a reproducable example |
01:01:37 | FromDiscord | <Yardanico> In reply to @wick3dr0se "It just keeps populating": yeah matrix bridge not the best sadly |
01:01:55 | FromDiscord | <huantian> or rather discord doesn't support bridges well |
01:02:05 | FromDiscord | <Yardanico> ? |
01:02:05 | FromDiscord | <wick3dr0se> Likely the case lol |
01:02:08 | FromDiscord | <Yardanico> webhooks work fine |
01:02:23 | FromDiscord | <Yardanico> you can edit webhook msgs too |
01:02:30 | FromDiscord | <Yardanico> it's just a matter of implementing that |
01:02:31 | FromDiscord | <huantian> wait yeah I forgot about that |
01:02:38 | FromDiscord | <huantian> wonder why it doesn't edit the webhook |
01:03:45 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > Provide a reproducable example↵Like [this](https://play.nim-lang.org/#ix=4gYu)? |
01:05:13 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Oh wait |
01:05:14 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sorry |
01:05:19 | FromDiscord | <@thatrandomperson5-6310e3b26da03> my brain ded |
01:05:19 | FromDiscord | <Yardanico> test text |
01:05:25 | FromDiscord | <Yardanico> test text edit edit 2 |
01:05:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gYw |
01:05:45 | FromDiscord | <Yardanico> I think it might be the case that t2bot is using their own custom fork of matrix-discord bridge |
01:05:55 | FromDiscord | <Yardanico> because https://github.com/matrix-org/matrix-appservice-discord/ seems to actually support that |
01:06:03 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/1046230390534320168/image.png |
01:07:00 | FromDiscord | <Elegantbeef> Yea they do suggest running the upstream if self hosting |
01:07:07 | FromDiscord | <Elegantbeef> Odd that they dont arent more recent |
01:07:15 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gYx |
01:07:15 | FromDiscord | <Yardanico> lmao funny staircase text |
01:07:18 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/1046230702976401449/image.png |
01:07:46 | FromDiscord | <Elegantbeef> Someone really should go to matrix or discord instead of using gitter |
01:07:56 | FromDiscord | <Elegantbeef> I know gitter is matrix backed but it still does fucky things |
01:08:31 | FromDiscord | <Yardanico> that too, idk how they are still alive |
01:09:25 | FromDiscord | <Elegantbeef> It's now matrix based and owned by element, so it's odd that it does things like using css for code blocks |
01:09:43 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/1046231314090700841/unknown.png |
01:09:51 | FromDiscord | <Yardanico> anyone remember we still have the irc bridge? 💀 |
01:10:06 | FromDiscord | <Elegantbeef> Hey zevv uses it! |
01:10:12 | FromDiscord | <Yardanico> is it even alive |
01:10:19 | FromDiscord | <Elegantbeef> It is |
01:10:21 | FromDiscord | <Elegantbeef> Pmunch also uses it |
01:10:25 | FromDiscord | <Elegantbeef> So does a few others |
01:10:42 | FromDiscord | <wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4gYz |
01:10:51 | FromDiscord | <Elegantbeef> No but using tuples there is a sin |
01:11:05 | FromDiscord | <wick3dr0se> What should I use? |
01:11:09 | FromDiscord | <Elegantbeef> An object |
01:11:20 | FromDiscord | <Elegantbeef> A car is a unique entity not all `(int, string)` is a car |
01:11:34 | FromDiscord | <Elegantbeef> `type Car = object` then do what you did for the latter |
01:13:27 | FromDiscord | <sneakyfish> Question about enums. Let's say I have two files A and B. I write a proc that takes in an enum in A. I import that file into B. Do i need to define the enum in A so i don't have to write it again in B and other files that use A? |
01:13:34 | FromDiscord | <wick3dr0se> Ok thanks. I'll have to look more into objects and tuples. I get confused between all the various types. Theres enums and God knows whatever else |
01:14:07 | FromDiscord | <Yardanico> In reply to @sneakyfish "Question about enums. Let's": it's the same for all types, not just enums - you can export the type |
01:14:10 | FromDiscord | <Yardanico> with `` |
01:14:24 | FromDiscord | <Yardanico> ah, your question is a bit different |
01:14:45 | FromDiscord | <Yardanico> Nim doesn't do well with recursive imports so the usual option is to separate shared types into a separate file like `types.nim` and import it in all files |
01:15:20 | FromDiscord | <sneakyfish> Ahh I see |
01:15:24 | FromDiscord | <Elegantbeef> There are also delayed imports which can be used |
01:15:29 | FromDiscord | <Elegantbeef> But that depends on your required design |
01:15:32 | FromDiscord | <sneakyfish> So i'd need to import both A and a type |
01:16:31 | FromDiscord | <sneakyfish> Yeah, I just started contrubuting to a git repo so im not to sure about the full design. |
01:17:30 | FromDiscord | <sneakyfish> I could just use a string tbh. I just thought it would look nicer |
01:17:45 | FromDiscord | <Elegantbeef> Using enums are the correct way so they're the way to do it |
01:18:00 | FromDiscord | <Elegantbeef> Using strings or integers is a path of madness that only clueless programmers partake |
01:18:21 | FromDiscord | <sneakyfish> 😅 |
01:18:37 | FromDiscord | <sneakyfish> okay cool. Enums then |
01:30:23 | FromDiscord | <sneakyfish> btw are cases preferred? in other langs i used something like x = { 'test': procTest } to cut down on a large amount of ifs. |
01:31:04 | FromDiscord | <Elegantbeef> case statements are generally better |
01:31:21 | FromDiscord | <sneakyfish> cool thanks |
01:37:35 | FromDiscord | <Yardanico> In reply to @sneakyfish "btw are cases preferred?": as yet another feature you can index arrays with any ordinal type |
01:37:47 | FromDiscord | <Yardanico> not for procs of course, but for normal key/value if the key is ordinal |
01:37:51 | FromDiscord | <Yardanico> = an enum value |
01:38:03 | FromDiscord | <Elegantbeef> Enum indexed arrays are lovely |
01:38:06 | FromDiscord | <Yardanico> <https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features/98854ba8d6d792f8f635f05e60cd9d66be69d9bf#using-enums-as-array-indexes> |
01:38:11 | FromDiscord | <Elegantbeef> It's a shame how few languages support them |
01:38:13 | FromDiscord | <Yardanico> and this is very fast and efficient and all that |
01:38:17 | FromDiscord | <sneakyfish> oh great |
01:38:20 | FromDiscord | <sneakyfish> thanks!! |
01:39:02 | FromDiscord | <Yardanico> and yes, stemming from that same feature nim arrays can start at any int value, not just 0 |
01:45:14 | FromDiscord | <sneakyfish> In reply to @Yardanico "not for procs of": this looks like it works with procs as well |
01:45:25 | FromDiscord | <Yardanico> yes it will, but your procs need to all have the same type |
01:45:29 | FromDiscord | <Yardanico> which is the same even for tables though |
01:45:40 | FromDiscord | <sneakyfish> oh i see |
01:46:00 | FromDiscord | <sneakyfish> got it, it's limited on type |
01:46:03 | FromDiscord | <sneakyfish> cool thanks! |
01:46:35 | FromDiscord | <Yardanico> it's just as it would be in any other statically typed language, so if you want to have procs that accept different types, you'd need to do type pruning or encapsulate all different types with inheritance or object variants |
02:18:10 | FromDiscord | <dedraiaken> Is there a convenient way to consume an iterator to do something like this `sorted(table.keys())`? |
02:19:47 | FromDiscord | <Elegantbeef> `toSeq` |
02:21:04 | FromDiscord | <dedraiaken> In reply to @Elegantbeef "`toSeq`": Aha, to the rescue again! Worked. 👍 |
02:35:33 | FromDiscord | <albassort> gtk is cursed |
02:48:34 | FromDiscord | <Yepoleb> Yes |
03:20:52 | FromDiscord | <Tuatarian> I can't test this easily since I'm not at my computer |
03:21:15 | FromDiscord | <Tuatarian> But can you take a (raw) pointer to a generic proc the same way I would for anything else? |
03:21:32 | FromDiscord | <Elegantbeef> You need to take it to the generic instance |
03:21:45 | FromDiscord | <Tuatarian> Meaning? |
03:21:53 | FromDiscord | <Elegantbeef> so `proc doThing(a: auto)` you need to do like `(proc(a: int))(doThing)` |
03:22:02 | FromDiscord | <Tuatarian> I see |
03:22:49 | FromDiscord | <Tuatarian> `(proc[T](a : T))(garbaçao)` doesn't work? |
03:22:59 | FromDiscord | <Elegantbeef> Of course it doesnt |
03:23:03 | FromDiscord | <Tuatarian> Ok that makes sense |
03:23:26 | FromDiscord | <Elegantbeef> Those are not concrete procedures |
03:23:27 | FromDiscord | <Tuatarian> Would the method we used for iterating over all procs with a given name work for generics? |
03:23:59 | FromDiscord | <Elegantbeef> Of course not cause it can have N number of instantiations where N is the number of types you have |
03:24:01 | FromDiscord | <Tuatarian> Given all the real procs are generated at comp time? |
03:24:13 | FromDiscord | <Tuatarian> When is it instantiated? |
03:24:23 | FromDiscord | <Elegantbeef> When something uses it |
03:24:30 | FromDiscord | <Elegantbeef> Either call directly or when you take the address of it |
03:24:43 | FromDiscord | <Tuatarian> So not comptime? |
03:24:52 | FromDiscord | <Tuatarian> That's strange... |
03:25:08 | FromDiscord | <Tuatarian> Or is it comptime but only generated for the cases that are used in code |
03:25:12 | FromDiscord | <Elegantbeef> It's instantiated at compile time, nim is AOT compiled |
03:25:27 | FromDiscord | <Elegantbeef> But it's only instantiated on the case it's used |
03:25:28 | FromDiscord | <Tuatarian> Right |
03:25:41 | FromDiscord | <Elegantbeef> if it instantiated for all types you'd need infinite memory for `proc(a: auto)` |
03:25:53 | FromDiscord | <Tuatarian> Assuming infinite types yeah |
03:26:02 | FromDiscord | <Elegantbeef> Not even infinite types |
03:26:12 | FromDiscord | <Elegantbeef> `proc(a: auto)` implies `proc(a: proc(a: auto))` |
03:26:15 | FromDiscord | <Elegantbeef> Which implies.... |
03:28:11 | FromDiscord | <Tuatarian> I see |
03:28:15 | FromDiscord | <Tuatarian> Infinite nesting yeah |
03:28:23 | FromDiscord | <Tuatarian> I was briefly afk |
03:28:52 | FromDiscord | <Tuatarian> So how would I iterate over all instances of a generic proc in a macro (or is it not possible?) |
03:29:15 | FromDiscord | <Elegantbeef> It's not possible cause as i said there are infinite possible |
03:29:37 | FromDiscord | <Elegantbeef> consider `proc doThing(a: tuple)` or `a: object)` |
03:29:44 | FromDiscord | <Tuatarian> No but they're not all jnstantiated obviously |
03:29:50 | FromDiscord | <Tuatarian> I only care about the ones that exist |
03:30:01 | FromDiscord | <Elegantbeef> Yea Nim doesnt have an API for that |
03:30:20 | FromDiscord | <Tuatarian> Alright that's definitely unfortunate |
03:30:45 | FromDiscord | <Tuatarian> Can I do this at runtime somehow? Does Jim hBe any sort of reflection? |
03:30:57 | FromDiscord | <Tuatarian> This doesn't all need to be comptime, though it would be nice of course |
03:30:58 | FromDiscord | <Elegantbeef> It does have reflection but i wouldnt use it |
03:31:13 | FromDiscord | <Tuatarian> Why not? |
03:31:22 | FromDiscord | <Elegantbeef> Cause runtime reflection is dumb |
03:32:21 | FromDiscord | <albassort> is nim-node interop viable? |
03:32:42 | FromDiscord | <Elegantbeef> There is a nodejs library and you can do system apis so of course |
03:33:28 | FromDiscord | <Elegantbeef> That does the same thing |
03:33:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gYT |
03:34:23 | FromDiscord | <Elegantbeef> Or just do what i said before where you convert the type |
03:34:59 | FromDiscord | <albassort> having one of those days where every library i try to use just doesn't fucking word |
03:35:01 | FromDiscord | <albassort> (edit) "word" => "work" |
03:41:22 | FromDiscord | <albassort> dooo you think dart interop would be viable for flutter |
03:42:05 | FromDiscord | <albassort> hmmmm |
03:42:16 | FromDiscord | <albassort> i guess i could operate using udp |
03:42:52 | FromDiscord | <albassort> alright I think there is not a single good gui platform, I've determined |
03:43:13 | FromDiscord | <Elegantbeef> gui was a mistake |
03:43:34 | FromDiscord | <albassort> indeed |
03:43:42 | FromDiscord | <albassort> abolish X |
03:45:51 | FromDiscord | <albassort> alright im doing this in haskell |
03:46:17 | FromDiscord | <Elegantbeef> Have fun |
03:58:36 | * | arkurious quit (Quit: Leaving) |
04:01:48 | FromDiscord | <yrashk> is there any way to get typing information for parameters from a given `FormalParams` AST node in a macro (it comes untyped as I am rewriting the given code)? |
04:01:56 | FromDiscord | <yrashk> (edit) "get" => "derive" |
04:02:03 | FromDiscord | <Elegantbeef> It has to be `typed` |
04:02:56 | FromDiscord | <yrashk> I see. Sadly, this leads to "typechecked nodes may not be modified" |
04:03:14 | FromDiscord | <Elegantbeef> `copyNimTree` then mutate that |
04:36:01 | FromDiscord | <yrashk> That worked, thanks! |
04:38:16 | FromDiscord | <yrashk> And going from there, what is the correct way to extract a particular parameter's type from that `typed` parameter? My macro is used as a pragma so I am getting the whole ProcDef |
04:39:29 | FromDiscord | <yrashk> or am I still out of luck? |
04:39:53 | FromDiscord | <Elegantbeef> you index it |
04:40:01 | FromDiscord | <Elegantbeef> `myProc.params[0]` is the return type for instance |
04:40:18 | FromDiscord | <Elegantbeef> `echo myProc.treeRepr` shows you the entire tree |
04:40:24 | FromDiscord | <Elegantbeef> you can use helper procs like `params` or `body` or manually index it |
04:40:44 | FromDiscord | <yrashk> but can I get a `typedesc` out of it? |
04:40:56 | FromDiscord | <Elegantbeef> The Nim node is a typedesc |
04:41:19 | FromDiscord | <Elegantbeef> `myProc[3][0]` is a typedesc of the return type |
04:41:21 | FromDiscord | <yrashk> I see. So, basically, `typed` just guarantees that it has been resolved |
04:41:33 | FromDiscord | <Elegantbeef> Correct typed is semantically checked code |
04:41:42 | FromDiscord | <Elegantbeef> untyped is parse but not semantically checked |
04:42:39 | FromDiscord | <yrashk> sent a code paste, see https://play.nim-lang.org/#ix=4gZ6 |
04:42:46 | FromDiscord | <Elegantbeef> `[1]` |
04:42:58 | FromDiscord | <Elegantbeef> `typedesc[int32]` ==`int32` |
04:46:28 | FromDiscord | <Tuatarian> In reply to @Elegantbeef "Really i'd just use": I'm not sure what's happening here |
04:46:36 | FromDiscord | <Tuatarian> I couldn't find anything online about addEventProc |
04:46:56 | FromDiscord | <Elegantbeef> "the same logic we used prior" |
04:46:59 | FromDiscord | <Elegantbeef> I'm sayimg make a macro |
04:47:14 | FromDiscord | <Tuatarian> I have a macro that works for non generic procs |
04:47:27 | FromDiscord | <Elegantbeef> Sure and for generic procs make a new one |
04:48:25 | FromDiscord | <Tuatarian> That would take a generic proc and iterate over all it's used/generated/whatever instances and do something with that? |
04:48:30 | FromDiscord | <Elegantbeef> Where you call the procedure you want with the parameters you want |
04:48:34 | FromDiscord | <yrashk> I think I figured it out, I was looking for `getTypeImpl()` |
04:48:43 | FromDiscord | <Elegantbeef> No you just call the procedure you want which will give you an instantiated symbol |
04:50:04 | FromDiscord | <yrashk> (edit) "I think I figured it out, I was looking for `getTypeImpl()`" => "sent a code paste, see https://play.nim-lang.org/#ix=4gZ8" |
04:50:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gZ9 |
04:51:08 | FromDiscord | <Elegantbeef> Sorry |
04:51:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gZa |
04:52:08 | FromDiscord | <Tuatarian> I see |
04:52:22 | FromDiscord | <Tuatarian> And then do whatever with the instantiated symbol |
04:52:34 | FromDiscord | <Elegantbeef> Correct |
04:52:45 | FromDiscord | <Elegantbeef> But that's the same as `(proc(a: int))(doThing)` |
04:52:52 | FromDiscord | <Tuatarian> Instead of passing the function name as an ident, pass a concrete instance of the function |
04:53:01 | FromDiscord | <Tuatarian> No not quite right? |
04:53:30 | FromDiscord | <Elegantbeef> In the first case you pass a call to the procedure which means you get the symbol to the concrete instance |
04:53:37 | FromDiscord | <Elegantbeef> In the later case you just instantiate it |
04:57:00 | FromDiscord | <Tuatarian> Oh ok |
04:57:13 | FromDiscord | <Tuatarian> And if I want to, I can choose not to care about the actual arguments themselves |
04:57:46 | FromDiscord | <Tuatarian> They're just there to force the appearance of a concrete instance of the symbol |
04:58:36 | FromDiscord | <Elegantbeef> This is the one major downside of monomorphic generics |
05:10:14 | FromDiscord | <huantian> We should add polymorphic generics to Nim then! |
05:23:32 | FromDiscord | <Tuatarian> Beef I think I'd need to do some weird stuff to do this |
05:24:08 | FromDiscord | <Tuatarian> I have a string (expression) which will not be known until runtime |
05:24:34 | FromDiscord | <Tuatarian> And I need to map strings (functions in the expression language) to nim functions |
05:24:43 | FromDiscord | <Tuatarian> That's why I was doing the stuff with raw pointers |
05:25:33 | FromDiscord | <Tuatarian> In theory, I could make it to strings (names of nim functions) but I'm not sure how I'd use that to run a particular nim function at runtime? |
05:25:51 | FromDiscord | <Tuatarian> Especially if that function isn't defined |
05:53:29 | NimEventer | New thread by sls1005: Imported C++ type naming, see https://forum.nim-lang.org/t/9662 |
06:07:29 | FromDiscord | <emanresu3> I'm having trouble understanding `genSym` and how to use it, how does it differ from `ident`? |
06:07:50 | FromDiscord | <emanresu3> Basically I expected `macro mymacro = result = newNimNode(nnkStmtListExpr) result.add(newVarStmt(ident"x", newLit 300))` |
06:08:26 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZl |
06:09:02 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZm |
06:09:22 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZn |
06:09:33 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZo |
06:09:42 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZp |
06:09:57 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZq |
06:10:05 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZr |
06:10:31 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZs |
06:10:32 | Zevv | Yardanico: the bridge works, its pretty noise on irc. this guy "fromdiscord" just won't shut up |
06:10:37 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZt |
06:53:35 | FromDiscord | <leorize> @emanresu3 genSym generates an unique symbol, which also means you can only refer to that symbol via the generated node (or it's copies). |
07:24:02 | FromDiscord | <emanresu3> leorize\: I see so I should store genSym's result in a variable first and only refer to it from the variable, but why not just use `ident`? |
07:25:27 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZC |
07:26:05 | FromDiscord | <leorize> say your macro generates `x` as a temporary variable, but in the same scope the user (or another macro, even) also creates an `x` variable, you don't want the two to collide, basically |
07:27:55 | FromDiscord | <leorize> I'm not sure what do you mean by it's not working, it does compile |
07:28:08 | FromDiscord | <Elegantbeef> it also allows you to create a variable that a user cannot touch |
07:28:15 | FromDiscord | <Elegantbeef> This gives you protection from the user |
07:28:47 | FromDiscord | <emanresu3> Oh I get it, yeah I see the use cases now |
07:28:51 | FromDiscord | <Rika> In reply to @Zevv "<@177365113899057152>: the bridge works,": Not an issue from the discord IRC bridge but an issue of the matrix discord bridge |
07:29:51 | FromDiscord | <emanresu3> Yeah it compiles, but unlike with the other macro the created variable is not seen after the macro is called |
07:29:57 | FromDiscord | <emanresu3> I think because of this |
07:30:43 | FromDiscord | <emanresu3> So I see, it's kinda creating a "locally scoped" scoped symbol only accessible inside the macro |
07:31:47 | NimEventer | New thread by Niminem: Do you have to use 'ref' for the field types within ref objects?, see https://forum.nim-lang.org/t/9663 |
07:31:49 | FromDiscord | <Elegantbeef> You also sometimes want a globally unique symbol |
07:33:28 | FromDiscord | <leorize> yep, in fact this mechanism is basically how templates are "hygienic" |
08:10:15 | * | rockcavera quit (Remote host closed the connection) |
08:14:17 | FromDiscord | <&Makarov/1> yaay i've written elixir pipe operator in nim 🎉 https://media.discordapp.net/attachments/371759389889003532/1046338157660082186/image.png |
08:14:45 | FromDiscord | <Elegantbeef> if only we didnt have UFCS! 😛 |
08:14:49 | FromDiscord | <&Makarov/1> but m still thinking how to make it with a `|>"\n"` |
08:15:17 | FromDiscord | <&Makarov/1> https://media.discordapp.net/attachments/371759389889003532/1046338411193188383/image.png |
08:15:29 | FromDiscord | <Elegantbeef> You cannot |
08:15:37 | FromDiscord | <emanresu3> I wish there was a pipe operator that could accept underscore calls like the dup macro |
08:15:54 | FromDiscord | <&Makarov/1> In reply to @Elegantbeef "You cannot": 🥹 |
08:16:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gZL |
08:16:10 | FromDiscord | <&Makarov/1> alright |
08:16:13 | FromDiscord | <&Makarov/1> seems good also ! |
08:16:22 | FromDiscord | <Elegantbeef> And you can already do that! |
08:16:22 | FromDiscord | <Tuatarian> Beef I'm curious how you would do what you were suggesting |
08:16:39 | FromDiscord | <Tuatarian> In reply to @iWonderAboutTuatara "I have a string": Since all this stuff |
08:16:49 | FromDiscord | <Tuatarian> You can do that by default yeah |
08:16:52 | FromDiscord | <&Makarov/1> but can i code this template to pass "123123" only as the echo first argument ? |
08:17:06 | FromDiscord | <Tuatarian> Just use.whatever and insert newlines where convenient |
08:17:23 | FromDiscord | <Tuatarian> Useful for building an ast with macros |
08:17:29 | FromDiscord | <&Makarov/1> sent a code paste, see https://play.nim-lang.org/#ix=4gZM |
08:17:57 | FromDiscord | <Elegantbeef> I dont get what you're doing tuatara. Are you trying to make a VM? |
08:18:12 | FromDiscord | <Tuatarian> Interpreted programming language |
08:18:47 | FromDiscord | <Tuatarian> But I'm avoiding doing any sort of research just to see how far I can get |
08:18:54 | FromDiscord | <Tuatarian> basically interpreted programming language |
08:19:19 | FromDiscord | <Elegantbeef> Yea the approach you're doing is weird |
08:19:24 | FromDiscord | <Tuatarian> Eventually algebra system but so far this is more or less going to be the same as writing a really basic mathematical expression interpreter |
08:19:38 | FromDiscord | <Tuatarian> How do people normally store functions? |
08:19:56 | FromDiscord | <Tuatarian> At least for "magic" functions which exist in the parent language |
08:20:42 | FromDiscord | <Tuatarian> This is obviously fine if I avoid using generics in my "magic" functions by the way, I'm aware that it's probably wise to do that anyway |
08:21:21 | FromDiscord | <Tuatarian> Actually, maybe it's fine |
08:21:32 | FromDiscord | <Elegantbeef> Well for built in procedures a more normal approach would manually dispatch |
08:21:42 | FromDiscord | <Tuatarian> But I'm definitely invested in the macro at this point :) |
08:22:21 | FromDiscord | <Elegantbeef> Instead of using a table you'd check if the procedure is built in or user then if it's builtin you'd rely on your own logic |
08:22:21 | FromDiscord | <Tuatarian> Yeah I'm not trying to do it in a normal way or anything like that |
08:22:25 | FromDiscord | <Elegantbeef> Otherwise you'd call the user procedure |
08:22:28 | FromDiscord | <Tuatarian> I'm curious to see how far I can get doing it my way |
08:22:52 | FromDiscord | <Tuatarian> (almost certainly objectively worse way, I am aware) |
08:26:05 | FromDiscord | <Elegantbeef> "almost certainly objectively worse" |
08:26:16 | FromDiscord | <Elegantbeef> That's a sentence |
08:37:53 | FromDiscord | <Tuatarian> Technically it isn't since it's a dependent clause but I get the sentiment |
08:45:18 | * | pro joined #nim |
09:01:35 | * | genpaku quit (Remote host closed the connection) |
09:04:42 | * | genpaku joined #nim |
09:33:39 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4h0b |
09:33:48 | FromDiscord | <Rika> Is the alternate syntax bad? |
10:01:58 | * | wallabra quit (Ping timeout: 268 seconds) |
10:43:09 | * | filcuc joined #nim |
10:44:06 | filcuc | probably i would need to RTFM but is there a way to check the nim compiler version and stop compilation if ORC/ARC is request but Nim compiler is <= VERSION |
10:45:32 | filcuc | basically with nimqml ORC/ARC was broken with old nim compiler version. I could enforce this requesting a higher nim compiler version in the .nimble file..but this seems a little bit too much imho |
10:54:14 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=4h0k |
10:55:27 | filcuc | thanks! |
10:55:52 | filcuc | btw when is orc/arc are going to be the default? is this targeted for Nim v2 |
10:55:55 | filcuc | ? |
10:57:10 | FromDiscord | <amadan> Thats the plan iirc↵I know devel atm has orc as the default |
10:59:08 | filcuc | ok but 1.6.10 still uses refc, right? |
10:59:42 | FromDiscord | <amadan> right |
11:09:17 | FromDiscord | <Riku> sent a code paste, see https://play.nim-lang.org/#ix=4h0o |
11:15:03 | * | ltriant joined #nim |
11:29:40 | FromDiscord | <Phil> sent a long message, see http://ix.io/4h0q |
11:31:20 | FromDiscord | <Phil> Though nothing in there on nim interaction with shared libs...hmmm |
11:32:46 | FromDiscord | <Phil> Man, I kinda want module-wide interfaces |
11:34:05 | FromDiscord | <Phil> Or is the trick in procedural programming that every public procedure is its own module? That feels like it'd be slightly insane, but I might be wrong there since I started with OO languages |
11:36:02 | FromDiscord | <Riku> Hmm yeah the article didn't quite get me there sadly. I saw an issue on github about not being able to import functions with no parameters I think though idk, I figured I'd ask here in case someone knew |
11:36:12 | * | ltriant quit (Ping timeout: 264 seconds) |
11:37:45 | FromDiscord | <Phil> Generally, for quick answers the discord works well if somebody that does this kinda thing is available.↵Folks for C/C++ interaction I can think of are Pmunch, ElegantBeef and Yardanico off the top of my head.↵If nobody is there at the moment, the forum is a pretty decent shout, you tend to get an answer there within an hour or two typically |
11:38:15 | FromDiscord | <Riku> Alright thanks for the tip |
11:38:40 | FromDiscord | <Phil> Sorry I couldn't be of more help, I'm mostly webdev that looks into appdev with QT on the side |
11:38:52 | FromDiscord | <Riku> No worries ;o |
11:52:08 | * | junaid_ joined #nim |
11:59:59 | * | filcuc quit (Ping timeout: 265 seconds) |
12:05:54 | * | filcuc joined #nim |
12:08:23 | * | ltriant joined #nim |
12:13:09 | * | ltriant quit (Ping timeout: 260 seconds) |
12:14:14 | * | filcuc quit (Remote host closed the connection) |
12:21:42 | * | ltriant joined #nim |
12:34:11 | FromDiscord | <Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4h0G |
12:35:46 | FromDiscord | <Phil> In reply to @Jessa "i can't figure out": First things first, you are aware of what optionals are? |
12:35:55 | FromDiscord | <Jessa> i isuppose not |
12:36:01 | FromDiscord | <Phil> Alrighty, so you know what null is? |
12:36:10 | FromDiscord | <Phil> or nil in nim I suppose |
12:36:11 | FromDiscord | <Jessa> you mean nil? |
12:36:16 | FromDiscord | <Phil> Yeah |
12:36:22 | FromDiscord | <Jessa> i mean, yes |
12:36:24 | FromDiscord | <Jessa> lol |
12:37:15 | FromDiscord | <Phil> Hey, I don't know how much you know and nil is something you only encounter with ref types 😛↵Anyway, optionals allow you to explicitly express "this value may be nil or not nil"↵It's used so that you don't have to explicitly check "is this value nil or not" everywhere |
12:37:41 | FromDiscord | <Phil> "find" returns you an optional because it might find something or it might not, so it returns an optional.none if it doesn't find anything and an optional.some if it does |
12:38:12 | FromDiscord | <Phil> To get at the actual value inside of the optional you need to call the `get` method on it, which will throw an error if you call get on an optional.none |
12:38:30 | FromDiscord | <Jessa> yes |
12:38:38 | FromDiscord | <Jessa> that makes sense |
12:40:58 | FromDiscord | <Phil> Check. Now the key thing is you're not getting back an `Optional[string]` , you're getting back `Optional[RegexMatch]`↵So `found.get` is of type `RegexMatch`, by calling `.str` on that you're stringifying the entire match, which gives you back the entire string you originally looked on.↵Why it's transformed into a string like that I have no idea |
12:41:33 | FromDiscord | <Phil> The key now would be to stare at the nre lib (or re, no idea where the regexMatch type is from) and see how to extract the actual match from that type |
12:42:38 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L |
12:42:48 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L |
12:42:54 | FromDiscord | <Phil> Actually, the solution is much easier than I just anticipated.↵Looking at the docs reveals the answer:↵https://nim-lang.org/docs/nre.html#RegexMatch https://media.discordapp.net/attachments/371759389889003532/1046405755131154452/image.png https://media.discordapp.net/attachments/371759389889003532/1046405755525402744/image.png |
12:43:10 | FromDiscord | <Phil> In reply to @Chibuzor Bobbi "Hello Everyone ❗ choose": <@&371760044473319454> We've got hostiles! Namely me! Being hostile against this bot! |
12:43:10 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L |
12:43:25 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L |
12:43:30 | FromDiscord | <Jessa> see, that's the thing ↵↵I've been staring at the documentation for a while now, and i don't seem to be able to get the result back-↵the only way ii seem to be able to do it is with a `findAll`, which returns a seq of strings |
12:43:47 | FromDiscord | <Phil> In reply to @Jessa "see, that's the thing": Nah, what you're looking for is `echo found.get.match` |
12:43:52 | FromDiscord | <Jessa> i see |
12:43:54 | FromDiscord | <Jessa> lemme try |
12:44:11 | FromDiscord | <Chibuzor Bobbi> Hi |
12:44:13 | FromDiscord | <Jessa> ah |
12:44:37 | FromDiscord | <Jessa> :ded: |
12:44:59 | FromDiscord | <Jessa> i still have to get usedto this documentation website style |
12:45:20 | FromDiscord | <Jessa> thank you, though |
12:45:23 | FromDiscord | <Chibuzor Bobbi> I invited and got my profit last week and they also have a nice company |
12:45:31 | FromDiscord | <Phil> Fair shout.↵I tend to always just type in the word im searching for in the searchbar and click on the first few results |
12:45:38 | FromDiscord | <Phil> Dear god somebody please ban this idiot |
12:45:43 | FromDiscord | <Chibuzor Bobbi> I well love to invite also |
12:46:11 | FromDiscord | <Jessa> why are they a bot, anyway |
12:46:16 | FromDiscord | <Chibuzor Bobbi> Well it a very good company↵(@Phil) |
12:46:20 | FromDiscord | <Phil> In reply to @Chibuzor Bobbi "Well it a very": Fuck off |
12:46:40 | FromDiscord | <Chibuzor Bobbi> Have you had about Bitcoin mining before |
12:46:51 | FromDiscord | <Phil> In reply to @Jessa "why are they a": They may not actually be a bot, but there's another way of having chats kind of like discord, but via matrix |
12:47:02 | FromDiscord | <Jessa> matrix? |
12:47:05 | FromDiscord | <Phil> This channel and several others are bridged to matrix, essentially relaying posts from there to this server via bots |
12:47:14 | FromDiscord | <Phil> And vice versa |
12:47:17 | FromDiscord | <Jessa> i see |
12:47:30 | FromDiscord | <Phil> Though I'm not sure the versa runs via bots |
12:47:40 | FromDiscord | <Chibuzor Bobbi> Hello 👋 friend are you with me |
12:48:03 | FromDiscord | <scarf> hecc, wish leetcode supported nim |
12:48:11 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0M |
12:48:44 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
12:49:05 | FromDiscord | <Phil> .... Can I apply for mod status for the sole purpose of banning bots? Like, I'm fine with having harsh stipulations that if I ever do something that goes out of line I get tarred and feathered or whatever but god damn these bots are robbing my nerves |
12:49:24 | FromDiscord | <Riku> tarred and feathered lmao |
12:50:09 | FromDiscord | <Chibuzor Bobbi> You don't say things like that just try and see you well love 💕 it↵(@Phil) |
12:50:20 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0N |
12:50:20 | FromDiscord | <planetis> Chibu run! |
12:50:24 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L |
12:50:29 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
12:50:37 | FromDiscord | <planetis> (edit) "Chibu" => "Bobbi" |
12:50:41 | FromDiscord | <Phil> In reply to @Chibuzor Bobbi "You don't say things": I'd love for you to fuck off |
12:50:47 | FromDiscord | <ajusa> Yeah honestly Phil should be a mod |
12:50:53 | FromDiscord | <Riku> In reply to @Chibuzor Bobbi "Hello Everyone ❗ choose": 死ね |
12:51:08 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0O |
12:51:43 | FromDiscord | <Chibuzor Bobbi> I well love 💕 to invite you to this best platform worldwide↵(@ajusa) |
12:51:48 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
12:52:01 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L |
12:52:11 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0R |
12:52:21 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h0S |
12:53:29 | FromDiscord | <guttural666> trying to use find to find the substring \"> so I think I have to escape both \ and ", so I was trying find("\\\">" ....) but that is somehow wrong? can anybody help me out 😄 |
12:53:41 | FromDiscord | <Phil> I hope for a world where people are in sufficiently good material conditions that such morally degrading work like the spamming of scams above is no longer necessary. |
12:54:08 | FromDiscord | <guttural666> (edit) "\">" => "[backslash]">" |
12:54:24 | FromDiscord | <scarf> i mean, if i had 7000 USD i'd keep it myself, not give out to some random people on discord |
12:54:26 | FromDiscord | <guttural666> (edit) "[backslash]">" => "\ ">" | "find("\\\">"" => "find("\ \ \ ">"" |
12:54:27 | FromDiscord | <Phil> In reply to @guttural666 "trying to use find": All I'm parsing from that one is that you are trying to use find, but I'm not quite understanding how |
12:55:13 | FromDiscord | <Rika> :Gladsuna: |
12:55:24 | FromDiscord | <Rika> What a peaceful channel this is right now |
12:55:38 | FromDiscord | <Phil> In reply to @guttural666 "trying to use find": So the actual substring is `'\ ">'` (in between the `'`)? |
12:56:14 | FromDiscord | <guttural666> In reply to @Isofruit "So the actual substring": yes, I had to insert spaces, because Discord reinterpreted what I wrote |
12:56:34 | FromDiscord | <guttural666> I do know how find works, just having trouble escaping the escape character I think? |
12:56:51 | FromDiscord | <scarf> sent a code paste, see https://play.nim-lang.org/#ix=4h0T |
12:56:58 | FromDiscord | <scarf> (edit) "sent a code paste, see https://play.nim-lang.org/#ix=4h0T" => "In reply to @guttural666 "yes, I had to": you may want to use backtick (`) for literal characters" |
12:57:13 | FromDiscord | <scarf> (edit) "use" => "wrap them in" |
12:58:02 | FromDiscord | <Rika> `"\\ \">"` ? |
12:58:36 | FromDiscord | <guttural666> In reply to @Rika "`"\\ \">"` ?": thats what I thought just \ \ to get a \ |
12:58:46 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h0U |
12:59:06 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h0V |
12:59:16 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4h0V" => "https://play.nim-lang.org/#ix=4h0W" |
12:59:20 | FromDiscord | <Rika> Oh if you’re putting “re” before then you don’t need to escape anything with the downside you can’t use " |
12:59:29 | FromDiscord | <Rika> So you’d need triples like what Phil used |
12:59:49 | FromDiscord | <guttural666> okay, thanks for the input gonna try that |
13:00:23 | * | sagax quit (Remote host closed the connection) |
13:01:18 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
13:01:21 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h10 |
13:01:23 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
13:01:23 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
13:01:23 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
13:01:24 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
13:01:24 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
13:01:27 | FromDiscord | <Chibuzor Bobbi> sent a long message, see https://paste.rs/gKi |
13:01:27 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
13:01:28 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
13:01:29 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
13:01:30 | FromDiscord | <Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇� |
13:01:30 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h11 |
13:01:33 | FromDiscord | <Chibuzor Bobbi> sent a long message, see http://ix.io/4h12 |
13:01:33 | FromDiscord | <Chibuzor Bobbi> sent a long message, see https://paste.rs/UDT |
13:01:39 | FromDiscord | <Phil> God damn do I wish for somebody to step on a Lego right now |
13:01:45 | FromDiscord | <Phil> A very specific somebody |
13:01:52 | FromDiscord | <Riku> #modPhil |
13:02:03 | FromDiscord | <scarf> quick, all the mods are sleeping, bring the spams |
13:02:11 | FromDiscord | <guttural666> any way to ban this cretin? |
13:02:17 | FromDiscord | <Phil> There is, but mods be sleepin |
13:02:26 | FromDiscord | <guttural666> how date they haha |
13:02:33 | FromDiscord | <guttural666> (edit) "date" => "dare" |
13:02:44 | FromDiscord | <Phil> By talking to the other gender when they find them... damnit you edited to fast |
13:03:06 | FromDiscord | <guttural666> hahaha, indeed |
13:03:44 | FromDiscord | <scarf> this server could use some more mods tho |
13:04:57 | FromDiscord | <PMunch> Sorry for being so slow to remove and ban.. |
13:05:10 | FromDiscord | <Phil> In reply to @PMunch "Sorry for being so": Thanks for doing the deed! |
13:05:14 | FromDiscord | <PMunch> And yeah, we should definitely get some more mods.. |
13:05:17 | FromDiscord | <Riku> In reply to @PMunch "Sorry for being so": Tysm 😩 |
13:05:37 | FromDiscord | <PMunch> And preferably some auto-spam remover bot |
13:05:50 | FromDiscord | <Phil> ... Can I apply for solely a bot-ban-mod position? |
13:06:03 | FromDiscord | <Phil> I have literally no interest in anything else, but that in particular affects me personally |
13:06:56 | FromDiscord | <ringabout> In reply to @Isofruit "... Can I apply": I'm rooting for you. |
13:07:35 | FromDiscord | <Phil> In reply to @ringabout "I'm rooting for you.": Why are you sudo'ing for me? |
13:07:48 | FromDiscord | <Phil> 😛 |
13:08:03 | FromDiscord | <scarf> In reply to @Isofruit "Why are you sudo'ing": `sudo rm bots` |
13:08:40 | FromDiscord | <Phil> suddenly beef is nowhere to be seen |
13:09:53 | FromDiscord | <Phil> But in actuality, how does one apply for such a position? |
13:10:14 | FromDiscord | <Phil> Do I go on a quest to the secret nim mountains beyond the horizons? |
13:11:03 | FromDiscord | <hotdog> +1 for Phil being a mod! |
13:11:32 | FromDiscord | <ShalokShalom> In reply to @Isofruit "Do I go on": Yes, and you come back with two stone tablets |
13:11:55 | FromDiscord | <ShalokShalom> They shall have the community guidelines engraved in them |
13:12:06 | FromDiscord | <ShalokShalom> Or you may shall be doomed!! |
13:12:14 | FromDiscord | <Phil> Hell no you're not getting me to decide anything other than "you shall not scam-spam" |
13:12:34 | FromDiscord | <ShalokShalom> That's a good first rule 😄 |
13:12:44 | FromDiscord | <Phil> Damnit, he's a crafty one |
13:15:57 | FromDiscord | <scarf> heh, but my dinner was spam |
13:16:08 | FromDiscord | <scarf> (edit) "heh," => "hecc," |
13:16:28 | FromDiscord | <rakgew> `philAsModCounter.inc` |
13:17:35 | FromDiscord | <pmunch> @Phil\: your application has been received. I'll take it up with the other moderators |
13:18:28 | FromDiscord | <Rika> Nice |
13:18:49 | FromDiscord | <Phil> That trip to the nim mountains was faster than anticipated |
13:23:36 | * | ltriant quit (Ping timeout: 265 seconds) |
13:30:48 | * | ltriant joined #nim |
13:35:36 | * | ltriant quit (Ping timeout: 264 seconds) |
13:39:51 | FromDiscord | <ShalokShalom> To come down from a trip can take longer than anticipated 😅 |
13:42:25 | * | ltriant joined #nim |
13:42:53 | FromDiscord | <ShalokShalom> In reply to @PMunch "And preferably some auto-spam": Someone suggested to block t.me links by default |
13:47:24 | * | ltriant quit (Ping timeout: 260 seconds) |
13:54:02 | * | ltriant joined #nim |
13:54:45 | FromDiscord | <𝒹𝒶𝓋𝑒> Hello people! Can anyone tell me if Nim has backwards compatibility with previous versions like golang does? |
13:56:24 | FromDiscord | <Rika> Best effort I believe, if you write code for 1.6 that uses introduced features on 1.6 of course it won’t work for 1.4 but in general it should work |
13:56:50 | FromDiscord | <Rika> Unless it is no longer supported, in which case regression fixes don’t get back ported |
13:58:44 | * | ltriant quit (Ping timeout: 260 seconds) |
14:00:39 | FromDiscord | <𝒹𝒶𝓋𝑒> So i can consider than a 50/50? |
14:00:47 | FromDiscord | <𝒹𝒶𝓋𝑒> (edit) "than" => "that" |
14:01:49 | FromDiscord | <federico3> @𝒹𝒶𝓋𝑒\: 50/50 on what scale? |
14:04:03 | FromDiscord | <Phil> In reply to @𝒹𝒶𝓋𝑒 "Hello people! Can anyone": Just for reference, I developed my web-application starting on from nim 1.6.4 at the end of last year, I jumped onto nim devel in the meantime, I had nothing to adjust because of this so far |
14:04:20 | FromDiscord | <Phil> However, that is while using very few low-level features |
14:04:48 | FromDiscord | <Phil> To me it feels fairly stable with the high-level stuff and I have no clue about lower level stuff such as interactions with C and the like |
14:05:18 | FromDiscord | <Phil> (edit) "nim" => "nim's compiler" | "nim's compilerdevel ... in" added "branch" |
14:05:41 | * | ltriant joined #nim |
14:10:24 | * | ltriant quit (Ping timeout: 264 seconds) |
14:16:04 | FromDiscord | <ali> Any particular framework or is htmlgen enough?↵(@Phil) |
14:17:17 | * | ltriant joined #nim |
14:20:31 | FromDiscord | <Phil> sent a long message, see http://ix.io/4h1q |
14:21:27 | FromDiscord | <federico3> compressing the HTTP Response in the service itself rather than in the HTTP server in front of it? |
14:21:29 | FromDiscord | <Phil> You may see me use a connection-pooling package if you google my main project, but that is no longer needed as norm now comes with its own ability to provide connection pooling |
14:22:00 | * | krux02 joined #nim |
14:22:05 | * | ltriant quit (Ping timeout: 265 seconds) |
14:22:07 | FromDiscord | <Phil> In reply to @federico3 "compressing the HTTP Response": I think by the time I wrote that middleware I'd been so deeply frustrated with anything nginx related because the configuration was such an incredible pain in my keister I wanted to do as little as possible in there |
14:23:09 | FromDiscord | <Phil> I've learned a lot since then, though Reverse-Proxy configuration will never become one of my strong suites, more one I somewhat manage to bumble through.↵But either way, I had very little reason to adjust since then |
14:23:14 | FromDiscord | <Phil> (edit) "adjust" => "adjust/refactor" |
14:24:03 | FromDiscord | <federico3> There are alternatives to Nginx if needed - but exposing services directly is usually really not recommended. Especially for the TLS termination, certificate regeneration etc |
14:24:36 | FromDiscord | <federico3> e.g. haproxy is quite nice |
14:24:53 | FromDiscord | <Phil> I mean, I don't, I do use nginx and did manage to get it all set up and running, after I did I just didn't want to bother looking into how to configure compression |
14:25:41 | FromDiscord | <Phil> The main reason I wrote docs on how to deploy a prologue application with nginx as a reverse proxy was because I never ever wanted to have to do that again without a guide to take over thinking for me |
14:26:04 | FromDiscord | <Phil> Because figuring that crap out was annoying enough the first time |
14:31:38 | * | junaid_ quit (Remote host closed the connection) |
14:32:01 | * | ltriant joined #nim |
14:33:23 | FromDiscord | <Phil> TIL generic methods are deprecated (not procs, just methods for dynamic dispatch) |
14:33:44 | FromDiscord | <Phil> On the one hand, understandable, on the other, I am very lazy and this saddens me in those cases |
14:35:55 | FromDiscord | <𝒹𝒶𝓋𝑒> In reply to @federico3 "<@660882846306795522>\: 50/50 on what": Basically partially supported? |
14:37:04 | * | ltriant quit (Ping timeout: 265 seconds) |
14:43:36 | * | ltriant joined #nim |
14:46:12 | NimEventer | New thread by sls1005: Nimble master, see https://forum.nim-lang.org/t/9666 |
14:49:49 | * | ltriant quit (Ping timeout: 260 seconds) |
14:50:16 | * | ltriant joined #nim |
14:55:24 | * | ltriant quit (Ping timeout: 264 seconds) |
15:01:52 | * | ltriant joined #nim |
15:07:13 | * | ltriant quit (Ping timeout: 268 seconds) |
15:09:33 | * | arkurious joined #nim |
15:13:25 | * | ltriant joined #nim |
15:18:09 | * | ltriant quit (Ping timeout: 265 seconds) |
15:25:01 | * | ltriant joined #nim |
15:30:02 | * | ltriant quit (Ping timeout: 268 seconds) |
15:36:33 | * | ltriant joined #nim |
15:41:21 | * | ltriant quit (Ping timeout: 265 seconds) |
15:42:22 | * | ltriant joined #nim |
15:42:50 | FromDiscord | <yrashk> Curious if there's a standard implementation of an iterator that takes an iterator and drops first n yields? |
15:47:10 | * | ltriant quit (Ping timeout: 265 seconds) |
15:48:07 | * | ltriant joined #nim |
15:52:33 | * | junaid_ joined #nim |
15:52:49 | * | ltriant quit (Ping timeout: 260 seconds) |
15:53:56 | * | ltriant joined #nim |
15:58:59 | * | ltriant quit (Ping timeout: 264 seconds) |
16:00:16 | FromDiscord | <ali> Like a Haskell drop?↵(@yrashk) |
16:02:12 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4h1I |
16:04:40 | FromDiscord | <demotomohiro> Your code is hard to read here as there are many html tags in your code.↵Could you post it in other text sharing service? |
16:05:28 | * | ltriant joined #nim |
16:07:28 | FromDiscord | <@thatrandomperson5-6310e3b26da03> mine? |
16:08:42 | Amun-Ra | yes |
16:09:38 | FromDiscord | <ali> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1046455427405201461): Like a Haskell drop? Or dropWhile ? |
16:09:46 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4h1J |
16:09:59 | Amun-Ra | same thing |
16:10:00 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Ok, well, i did it |
16:10:09 | Amun-Ra | what function raises that OSError? |
16:10:12 | * | junaid_ quit (Remote host closed the connection) |
16:10:21 | * | ltriant quit (Ping timeout: 265 seconds) |
16:10:36 | Amun-Ra | next time look for sth like "paste as plain text" |
16:13:08 | FromDiscord | <yrashk> In reply to @ali "Like a Haskell drop?": Yes, like Haskell drop |
16:13:36 | FromDiscord | <@thatrandomperson5-6310e3b26da03> What do you mean? It looks fine on my side↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>) |
16:14:07 | FromDiscord | <@thatrandomperson5-6310e3b26da03> also, npeg’s matchfile is cuasing the issue |
16:15:38 | Amun-Ra | thatrandomper: that paste looks htmly, https://i.postimg.cc/wv3JB3dX/Screenshot-from-2022-11-27-17-14-49.png |
16:17:03 | * | ltriant joined #nim |
16:17:21 | FromDiscord | <ali> Other than introducing a block to introduce a scope I haven't seen anything other than a trivial loop↵(@yrashk) |
16:19:06 | FromDiscord | <! Nilts> In reply to @Amun-Ra "thatrandomper: that paste looks": that is a problem with the gitter.im link |
16:19:53 | FromDiscord | <! Nilts> (this is @thatrandomperson5's discord account) |
16:21:07 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4h1M |
16:21:48 | * | ltriant quit (Ping timeout: 264 seconds) |
16:21:57 | Zevv | it seems that the file open in matchFile fails with an OS error |
16:22:31 | Zevv | it tries to open your file with memfiles.open(), which does mmap under the hood |
16:22:48 | Zevv | what is your OS, and where does your file live? |
16:24:49 | Amun-Ra | check either open(2) or fopen(2) for possible EINVAL reasons |
16:26:04 | Zevv | it's not just open |
16:26:06 | Zevv | it uses memfile |
16:26:27 | Zevv | it mmaps the whole file into memory, it avoids alloc + read |
16:26:33 | FromDiscord | <! Nilts> In reply to @Zevv "what is your OS,": I think it is on ubuntu and the file lives in a random subdir |
16:26:35 | Amun-Ra | ah |
16:26:46 | Zevv | I'd be interested in an strace dump |
16:26:59 | Zevv | if the problem persists, just read the file yourself and match() it |
16:27:04 | Zevv | instead of doing matchFile() |
16:27:15 | FromDiscord | <! Nilts> In reply to @Zevv "if the problem persists,": ok |
16:27:17 | Zevv | sudo apt install strace && strace <your program> |
16:27:27 | Zevv | i'd like to know what your problem is |
16:28:01 | Zevv | also, never run sudo commands from strangers on irc |
16:28:09 | Zevv | that's just common sense |
16:28:35 | * | ltriant joined #nim |
16:28:55 | Amun-Ra | yupe, curl | sudo is my pet peeve |
16:29:32 | FromDiscord | <! Nilts> In reply to @Zevv "sudo apt install strace": i don't have acess to sudo or apt, i have nixos |
16:29:40 | Zevv | ah ok |
16:29:53 | Zevv | Amun-Ra: well, it's actually no worse then installing whatever on your machine |
16:30:05 | Zevv | I could put stuff in npeg that does 'sudo rm -rf /' somewhere in there |
16:30:07 | Amun-Ra | Zevv: I only install via apt |
16:30:10 | FromDiscord | <nonce> hi guys, any of you have experience with prologue? https://github.com/planety/prologue↵i am struggling to find out how to send a file |
16:30:20 | Zevv | Amun-Ra: fine, then i'll put it in duc or in bucklespring |
16:30:23 | Amun-Ra | "rm -rf /" is safe |
16:30:28 | Amun-Ra | rm -rf /* is not |
16:30:48 | Amun-Ra | Zevv: welcome to debian package team then |
16:31:03 | FromDiscord | <! Nilts> In reply to @Zevv "that's just common sense": i ran strace, it just spit out alot of crap |
16:31:11 | Zevv | it's supposed to do that |
16:31:19 | Zevv | can you post that crap somewhere |
16:31:23 | Amun-Ra | Nilts: could you paste it somewhere online? |
16:31:42 | Zevv | the last fewhundred lines will do, there is likely something like open() and mmap() in there |
16:32:05 | Amun-Ra | I usually look for open|access |
16:32:38 | FromDiscord | <! Nilts> In reply to @Zevv "can you post that": https://hastebin.com/rukunobise.yaml |
16:33:26 | Zevv | mmap(NULL, 0, PROT_READ, MAP_SHARED, 3, 0) = -1 EINVAL (Invalid argument) |
16:33:47 | * | ltriant quit (Ping timeout: 264 seconds) |
16:33:52 | Zevv | ha is your file size 0 maybe? |
16:34:53 | FromDiscord | <! Nilts> In reply to @Zevv "ha is your file": yes, its an empty file |
16:35:25 | Amun-Ra | EINVAL (since Linux 2.6.12) length was 0. |
16:35:30 | Amun-Ra | (man mmap) |
16:35:36 | Zevv | yes, that's where I found it |
16:35:47 | Zevv | because it's not We don't like addr, length, or offset (e.g., they are too large, or not.... |
16:36:01 | Zevv | Nilts: when I'm done peeling potato's I'll make a fix and a new release |
16:36:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h1R |
16:36:15 | Amun-Ra | tbh I'm not a fan of EINVAL on sizes of 0 |
16:36:40 | * | ltriant joined #nim |
16:36:54 | Zevv | EZERO? |
16:37:30 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4h1S |
16:37:53 | Amun-Ra | why not accept it and bail on access beyond the data limit |
16:40:30 | Zevv | ? |
16:40:44 | * | xet7 joined #nim |
16:42:48 | * | ltriant quit (Ping timeout: 264 seconds) |
16:43:44 | Zevv | bwah I don't even know the size there, it's just nims memfiles.open that bails |
16:44:06 | Zevv | pff am i supposed to catch that and try a manual open+read instead . that's silly |
16:44:09 | Amun-Ra | I mean 0 length file is a file, there should be no special case for that |
16:44:19 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4h1W |
16:44:44 | Amun-Ra | and access its data should work just like accessing data beyond any non-zero one |
16:45:27 | Zevv | Sure, I agree |
16:45:38 | Zevv | so the bug is in nims memfiles.open(), not in npeg |
16:45:52 | Zevv | but that doesnt mean I have to let that happen |
16:46:14 | Amun-Ra | mhm |
16:46:17 | Amun-Ra | or… a special case to look for |
16:49:32 | * | ltriant joined #nim |
16:50:09 | Zevv | today is a special day |
16:50:12 | Zevv | npeg will go to 1.0.0 |
16:50:14 | Zevv | I feel lucky |
16:50:58 | Amun-Ra | :> |
16:51:35 | Amun-Ra | well, today is a special day for me too, I fixed an old bug in my retro image viewer :> |
16:52:11 | Zevv | we are feeling lucky! |
16:53:29 | Amun-Ra | \o/ |
16:54:20 | * | ltriant quit (Ping timeout: 265 seconds) |
16:55:19 | * | ltriant joined #nim |
16:57:39 | Zevv | Nilts: please update your npeg and try again |
16:58:24 | * | jmdaemon quit (Ping timeout: 264 seconds) |
17:00:05 | * | ltriant quit (Ping timeout: 268 seconds) |
17:01:07 | * | ltriant joined #nim |
17:06:14 | * | ltriant quit (Ping timeout: 268 seconds) |
17:07:12 | FromDiscord | <EyeCon> I have a question about npeg, maybe I misunderstand something here |
17:07:36 | FromDiscord | <EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=4h28 |
17:07:52 | FromDiscord | <EyeCon> I thought that would list all `code`s and operators |
17:08:13 | FromDiscord | <EyeCon> But it results in `@["Cod Z1Z", "Opr +", "Opr /"]` |
17:08:17 | FromDiscord | <EyeCon> What am I missing? |
17:08:20 | Zevv | first dinner, bbl |
17:11:32 | * | lumo_e joined #nim |
17:12:53 | * | ltriant joined #nim |
17:14:09 | FromDiscord | <EyeCon> Sure, appreciate you taking a look later |
17:17:40 | * | ltriant quit (Ping timeout: 248 seconds) |
17:18:41 | * | ltriant joined #nim |
17:23:32 | * | ltriant quit (Ping timeout: 248 seconds) |
17:23:32 | Zevv | wtf does nim playground change `*` into ` |
17:23:44 | Zevv | |
17:23:48 | Zevv | it doesn't even render here |
17:23:49 | Zevv | the math dot |
17:23:58 | Zevv | it breaks copy paste |
17:24:38 | Zevv | no it's you |
17:24:44 | Zevv | the original ix.io is also broken :) |
17:27:01 | Zevv | ha you're calling `push()` |
17:27:13 | Zevv | but I'm not sure *which* push that is, you didn't define one |
17:30:14 | * | ltriant joined #nim |
17:34:59 | * | ltriant quit (Ping timeout: 264 seconds) |
17:41:49 | * | ltriant joined #nim |
17:43:55 | FromDiscord | <EyeCon> In reply to @Zevv "but I'm not sure": Me? The npeg documentation says:↵↵> A code block capture can also produce captures by calling the push(s: string) function from the code block. Note that this is an experimental feature and that the API might change in future versions. |
17:44:37 | FromDiscord | <EyeCon> The code sample compiles and runs, that's the entire thing |
17:45:04 | Zevv | oooh push(). dang. |
17:45:07 | Zevv | right let me look again |
17:45:18 | Zevv | i'm not /officially/ finished with my dinner, you know |
17:45:41 | FromDiscord | <EyeCon> I'm in no hurry whatsoever |
17:45:50 | FromDiscord | <EyeCon> Appreciate you taking a look |
17:46:08 | Zevv | nah, np. So, what is your expected output? |
17:46:32 | * | ltriant quit (Ping timeout: 265 seconds) |
17:47:27 | FromDiscord | <EyeCon> In reply to @Zevv "nah, np. So, what": I thought I would have pushed all codes and operators, so something like `@["Cod Z1Z", "Opr +", "Cod A1A", "Opr /", "Cod B1B", "Opr +", "Cod -C1C"]` |
17:47:32 | Zevv | right, I noticed |
17:47:38 | * | ltriant joined #nim |
17:48:04 | Zevv | This push() thing, I didn't even rember why this was added |
17:48:36 | FromDiscord | <EyeCon> For poor folks like me who want the captured input transformed before the next step? |
17:48:53 | Zevv | i guess. too bad it's broken |
17:48:56 | Zevv | why have I no tests for that |
17:49:31 | FromDiscord | <EyeCon> OK, c'est la vie, then I'll think of something else, sorry to keep you from dinner |
17:49:41 | Zevv | well, this needs to be fixed or dropped, either way |
17:49:50 | Zevv | so thanks for the report |
17:49:56 | FromDiscord | <EyeCon> Sure, anytime |
17:51:19 | Zevv | I made you a ticket, will pick this up one of these days |
17:51:30 | Zevv | man. You should have come yesterday. I *just* released 1.0.0 today |
17:51:37 | Zevv | after stickign at 0.x for years |
17:52:29 | * | ltriant quit (Ping timeout: 268 seconds) |
17:53:14 | FromDiscord | <EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=4h2e |
17:53:24 | FromDiscord | <EyeCon> In reply to @Zevv "man. You should have": Next time I'll come earlier 😄 |
17:53:43 | Zevv | do you have one of these hipster fonts |
17:53:48 | Zevv | your asterisks are broken |
17:53:52 | Zevv | i can't run your code in nim playground |
17:54:09 | FromDiscord | <EyeCon> I... have difficulties believing that's because of a font? |
17:54:18 | FromDiscord | <EyeCon> Let me paste it into the playground then |
17:54:22 | Zevv | what you are pasting there are not asteriskses |
17:55:20 | FromDiscord | <EyeCon> I'm pretty sure they are, maybe it's something with the bridge? I'm on Discord |
17:55:31 | FromDiscord | <EyeCon> https://play.nim-lang.org/#ix=4h2g |
17:55:42 | Zevv | good. |
17:56:29 | Zevv | it helps if you actually run your match |
17:56:30 | FromDiscord | <EyeCon> Hey, that doesn't run on the playground, I wonder why |
17:56:31 | Zevv | instead of commenting it out |
17:56:58 | FromDiscord | <EyeCon> Very good catch |
17:57:04 | Zevv | i have a keen eye |
17:57:20 | Zevv | My friends call me EyeZevv |
17:58:04 | FromDiscord | <EyeCon> That's what we would call our joint venture probably |
17:58:42 | FromDiscord | <EyeCon> OK, that runs at least on my machine |
17:58:53 | Zevv | good. |
17:59:01 | FromDiscord | <EyeCon> Thanks a lot |
17:59:11 | * | ltriant joined #nim |
17:59:44 | Zevv | yw |
18:04:19 | * | ltriant quit (Ping timeout: 260 seconds) |
18:07:31 | FromDiscord | <@thatrandomperson5-6310e3b26da03> How do i get all attrs of an initialized type in nim? |
18:10:01 | * | krux02 quit (Quit: Leaving) |
18:10:45 | * | ltriant joined #nim |
18:12:56 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h2m |
18:14:05 | * | krux02 joined #nim |
18:14:46 | FromDiscord | <demotomohiro> In reply to @Isofruit "Thanks! I keep forgetting": `of` operator is explained in Nim manual: https://nim-lang.org/docs/manual.html#types-tuples-and-object-types |
18:15:32 | * | ltriant quit (Ping timeout: 265 seconds) |
18:16:57 | FromDiscord | <jtv> Random person: statically, you can use getType() in a macro. If you need it at runtime, use a macro to generate the specific info you need I'd think |
18:19:43 | FromDiscord | <jtv> What's the preferred paradigm for stating that I believe some block is unreachable (and I want the compiler to tell me if it can ever prove otherwise)? Often for me this is the `else` block of a `case` statement. Just let it compile in the runtime code? |
18:21:15 | FromDiscord | <locria> INim has a lot of duplicated code |
18:22:17 | * | ltriant joined #nim |
18:27:12 | * | ltriant quit (Ping timeout: 264 seconds) |
18:28:10 | FromDiscord | <Jessa> color code galore https://media.discordapp.net/attachments/371759389889003532/1046492644819345508/image.png |
18:28:39 | FromDiscord | <Jessa> finally added escapinig and background hex/rg |
18:28:40 | FromDiscord | <Jessa> (edit) "hex/rg" => "hex/rgb" |
18:28:41 | FromDiscord | <Phil> I'm kinda running into the issue that I can't go as fine-grained as I want with my generics =/ |
18:31:41 | FromDiscord | <jtv> In reply to @Jessa "color code galore": Nice, would definitely use that if you release a package |
18:32:26 | FromDiscord | <Jessa> still gotta find out how to actually make a package aha |
18:32:28 | FromDiscord | <Jessa> (edit) "aha" => "ahaha" |
18:32:46 | * | dnh joined #nim |
18:32:46 | FromDiscord | <jtv> In reply to @jtv "Nice, would definitely use": Or else I'll give myself a similar API, I definitely have macros to do such things already |
18:33:52 | * | ltriant joined #nim |
18:34:44 | FromDiscord | <Jessa> the backend definitely isn't optimal or very pretty in areas↵↵but hey, this is me learning how to use nim so /shrug |
18:35:31 | FromDiscord | <jtv> It's a good interface |
18:38:26 | * | ltriant quit (Ping timeout: 256 seconds) |
18:42:13 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h2t |
18:45:25 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h2v |
18:45:27 | * | ltriant joined #nim |
18:45:57 | FromDiscord | <Phil> The goal is to provide a default stringification that the user can "overwrite" if they choose to |
18:46:06 | FromDiscord | <Phil> (edit) "to" => "to, by defining their proc `$` proc/method" |
18:46:23 | FromDiscord | <jtv> Yeah, just provide a base method for the base type; annotate its implementation with {.base.} |
18:47:12 | FromDiscord | <demotomohiro> In reply to @jtv "What's the preferred paradigm": You can put `assert false` or `doAssert false` in unreachable place (it is runtime check though). |
18:47:53 | FromDiscord | <jtv> Thanks, that's a compact way to do it. Was hoping there was an option that might improve the chance of a compile-time error when I make a mistake |
18:48:48 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h2w |
18:49:25 | FromDiscord | <Phil> `echo $x` should've been "model of 'B'" |
18:50:35 | * | ltriant quit (Ping timeout: 264 seconds) |
18:52:31 | FromDiscord | <jtv> Ah, I see. The problem is you don't have as much access to type info at runtime. I'd solve that by adding a macro wrapper to declare your subtypes that automatically adds the method for you, based on the static name |
18:53:33 | FromDiscord | <jtv> In particular, you end up losing naming info, it's just an ID at runtime I believe. |
18:54:14 | FromDiscord | <demotomohiro> In reply to @Isofruit "That doesn't quite work": I don't know how to get runtime type name. |
18:54:42 | FromDiscord | <Phil> Hmmm but then don't I run into the issue that, if the user defines their own `$`proc for B elsewhere, that it comes down to ambiguity issues so they'll have to manually specify whether to use the $ proc implicitly generated somewhere or their own |
18:55:41 | FromDiscord | <jtv> I don't understand that. What ambiguity issues? Wouldn't you want them to use your wrapper to declare subtypes? |
18:55:47 | FromDiscord | <demotomohiro> In reply to @jtv "Thanks, that's a compact": If you have when branches, you can use error/fatal/warning pragma:↵https://nim-lang.org/docs/manual.html#pragmas-error-pragma |
18:57:00 | * | ltriant joined #nim |
18:57:24 | FromDiscord | <Phil> In reply to @jtv "I don't understand that.": I kind of want to do it like an "opt in" feature. I don't want to force the user to define their own `$` proc, but if they do I magically want that theirs is being used instead of my default, with the runtime name ideally. |
18:59:02 | FromDiscord | <Phil> It's not that big a deal overall, this is more cosmetically than anything as I can well live with the default just being `Model #<id>`, having the subtype there would just be a bit nicer |
18:59:38 | FromDiscord | <jtv> In reply to @demotomohiro "If you have when": Well, if I do a when true: discard {.error.}, and the compiler can't prove it's unreachable I'm going to get noise I don't need too. |
18:59:45 | FromDiscord | <Phil> this is all about providing procs that will be used in a virtual fuckload of generics that are being generated |
19:00:28 | FromDiscord | <jtv> Yeah, then just have your macro stash the name in a const variable you define in the base class |
19:00:38 | FromDiscord | <jtv> And have your base method print using that variable |
19:00:42 | FromDiscord | <jtv> (edit) removed "const" |
19:01:34 | FromDiscord | <Phil> That is actually pretty clever |
19:01:56 | * | ltriant quit (Ping timeout: 265 seconds) |
19:02:47 | * | ltriant joined #nim |
19:03:33 | FromDiscord | <Phil> Wait, that still runs into issues, then that macro is still generating its own `$(model: B): string = "model of B"` proc/method/whatever, even when the user defines their `$(model: B): string = "Im a different implementation"` |
19:04:09 | FromDiscord | <jtv> No, I wouldn't have the macro generate your method in that case, just set the variable. |
19:04:24 | FromDiscord | <jtv> The only place you implement the method is in the base class, then people are free to define their own |
19:05:35 | FromDiscord | <Phil> Wait, how does that work then, how does the base-class implemented method know which variable to access for the print?↵Or do you mean by variable to store the class-name in a field of the object itself? |
19:06:24 | FromDiscord | <jtv> Well, you have to have a hidden method that actually sets the variable, that gets called when you're looking for it and it's null. |
19:07:25 | * | ltriant quit (Ping timeout: 260 seconds) |
19:07:38 | FromDiscord | <jtv> Unless you can now set default values for fields, I think I saw that was going in |
19:07:49 | FromDiscord | <jtv> But I think would be an experimental feature if so |
19:08:13 | FromDiscord | <Phil> You can and I am on nim-devel, doesn't work for DateTime fields yet and only does static assignments, though in this case it might not be problematic for the usecase |
19:08:34 | FromDiscord | <Phil> Correction: Does work for DateTime but not distinct DateTime fields |
19:08:55 | FromDiscord | <Phil> ~~I would know, I tried really damn hard to make it work~~ |
19:09:08 | FromDiscord | <jtv> Got it, thanks |
19:11:11 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4h2H |
19:11:12 | FromDiscord | <Phil> In reply to @jtv "Well, you have to": Could you rephrase that? I fail to properly parse the sentence.↵The hidden method is nil? And one would call that hidden method to get the value of the variable that was set and that you're interested in?↵I think I'm lacking the imaginination to see how it works |
19:12:48 | FromDiscord | <Phil> In reply to @demotomohiro "You can get runtime": The users of my lib would be the ones writing the derived types, the goal is to make it unnecessary for them to even know this must be defined.↵If I force them to implement a method, I could as well force them to just implement `$` themselves, the goal is to reduce the amount of things the user of the lib needs to be aware of. |
19:12:54 | FromDiscord | <jtv> Hidden in that the macro generates it but the user doesn't need to know it's there really |
19:13:21 | FromDiscord | <jtv> Like @demotomohiro 's getRuntimeTypeName(), that's the same basic idea |
19:14:06 | FromDiscord | <Phil> Ohhh... let me try that out |
19:14:15 | FromDiscord | <Phil> (edit) "Ohhh... let me try that out ... " added "in a minimal example" |
19:14:23 | * | ltriant joined #nim |
19:16:05 | FromDiscord | <Phil> So the goal would be to essentially generate `getRuntimeTypeName` , hmm |
19:19:14 | * | ltriant quit (Ping timeout: 256 seconds) |
19:24:01 | FromDiscord | <jtv> In reply to @Isofruit "So the goal would": Look at the example macro that generates a wrapper to make things look syntactically like Python's `class`: https://nim-by-example.github.io/macros/ |
19:24:24 | FromDiscord | <jtv> Should make it very easy to do if you copy that |
19:25:26 | FromDiscord | <Phil> In reply to @jtv "Should make it very": Ohhh right, nim by example does have a macro section |
19:25:38 | FromDiscord | <Phil> Though that example seems like it could just be done via template |
19:25:58 | * | ltriant joined #nim |
19:26:28 | FromDiscord | <Phil> Thanks! |
19:27:37 | FromDiscord | <jtv> Well, good point, since you're not having to loop to generate multiple items, etc, you can probably get away with your wrapper being a template. |
19:30:48 | * | ltriant quit (Ping timeout: 264 seconds) |
19:36:22 | FromDiscord | <Screentapper> What is the most popular IDE to use for NIM development, based on your perception? |
19:37:34 | * | ltriant joined #nim |
19:40:52 | FromDiscord | <guttural666> can I loop over the fields of a type and print the field names? |
19:41:36 | FromDiscord | <rakgew> yes iirc via `.fieldPairs` |
19:41:38 | FromDiscord | <planetis> In reply to @guttural666 "can I loop over": Yes it's the fieldPairs iterator |
19:42:29 | FromDiscord | <guttural666> In reply to @planetis "Yes it's the fieldPairs": just looked at that but that seems to need an instance as an input? |
19:42:48 | * | ltriant quit (Ping timeout: 264 seconds) |
19:42:51 | FromDiscord | <rakgew> there was quite the interesting discussion on that over here\:↵https://forum.nim-lang.org/t/5631#35036 |
19:43:03 | FromDiscord | <guttural666> seems to complain if I'm using a typedesc |
19:43:03 | FromDiscord | <rakgew> yes |
19:43:25 | FromDiscord | <rakgew> yep needs an instance |
19:45:31 | FromDiscord | <guttural666> hmm okay, thanks |
19:46:03 | FromDiscord | <rakgew> iirc in snorlogue it is done at compile time on the typedescs |
19:46:32 | FromDiscord | <rakgew> ah nope, it also instanciates |
19:46:43 | FromDiscord | <rakgew> https://github.com/PhilippMDoerner/Snorlogue/blob/9fb8e16099afa3d803d851c9c243be8a4c49f30f/src/snorlogue/service/modelAnalysisService.nim |
19:47:44 | FromDiscord | <rakgew> but I remembered compile time correctly apparently. |
19:49:07 | * | ltriant joined #nim |
19:52:31 | * | nyeaa492842 joined #nim |
19:53:58 | * | ltriant quit (Ping timeout: 268 seconds) |
19:54:40 | * | nyeaa49284 quit (Ping timeout: 260 seconds) |
19:54:54 | * | ltriant joined #nim |
19:56:05 | FromDiscord | <planetis> A macro that does the same with a typedesc wouldn't be complicated and pbl exists in a codebase somewhere |
19:59:04 | FromDiscord | <rakgew> would it be possible to collect all procs coming from a specific module with a macro? |
19:59:35 | * | ltriant quit (Ping timeout: 264 seconds) |
20:02:07 | FromDiscord | <rakgew> I am trying to find a way to collect procs with a specific pragma into a table so I can expose them as functionality (via autocomplete) in a cli tool. |
20:02:28 | FromDiscord | <Phil> In reply to @Screentapper "What is the most": Pretty sure it's VSCode, the nim plugin in IntelliJ is pretty decent as well though |
20:02:46 | FromDiscord | <rakgew> maybe it is easier when they come from a know module. |
20:02:52 | FromDiscord | <demotomohiro> In reply to @Screentapper "What is the most": Here is survey result and there is "What editor do you use when writing Nim?":↵https://nim-lang.org/blog/2022/01/14/community-survey-results-2021.html |
20:02:55 | FromDiscord | <Phil> In reply to @rakgew "ah nope, it also": It instantiates at compile time and iterates over that |
20:03:27 | FromDiscord | <rakgew> intellij works pretty well for me. |
20:03:35 | FromDiscord | <Phil> You can't really get past the need to instantiate, but even if one of the fields is stuff like DateTime you can actually do that |
20:03:57 | FromDiscord | <rakgew> but over console I enjoy `micro` as well. |
20:04:01 | FromDiscord | <Phil> norm for example does something similar for parsing a `Row` instance into a `Model` instance |
20:04:15 | FromDiscord | <Phil> I pushed a bunch of that code to act at compile time, among that the loop itself |
20:05:04 | FromDiscord | <Phil> In reply to @rakgew "but over console I": The only thing I ever use for console is nano to stare at config files |
20:06:29 | * | ltriant joined #nim |
20:10:06 | FromDiscord | <wick3dr0se> Anyone use Nim with Termux? I keep running into library issues. I installed with the package manager |
20:11:29 | * | ltriant quit (Ping timeout: 260 seconds) |
20:12:08 | FromDiscord | <Phil> Googles what Termux is |
20:12:15 | FromDiscord | <Phil> No |
20:12:52 | FromDiscord | <Phil> Wait, how are you developing with an android terminal emulator? |
20:12:58 | FromDiscord | <wick3dr0se> In reply to @Isofruit "*Googles what Termux is*": I'm always surprised that more people don't know of Termux |
20:13:18 | FromDiscord | <wick3dr0se> Its a pain in the ass but I wrote a classic snake game in BASH with Vim from Termux |
20:13:37 | FromDiscord | <wick3dr0se> Nim compiled won't work without root, so I'm using Nimscript |
20:14:06 | FromDiscord | <Phil> But isn't Termux basically for Android?↵Aren't you developing on something x86 based? Or is my google-fu just bad? |
20:14:36 | FromDiscord | <demotomohiro> I have termux and used nim and I didnt see much problems. But Im not using nim on termux recently. |
20:14:39 | FromDiscord | <wick3dr0se> It's a Linux terminal emulator really. It has Linux commands and debian package manager |
20:15:20 | FromDiscord | <wick3dr0se> It's an ARM based device but I don't have access to my PC rn so I'm working with what I can |
20:15:33 | FromDiscord | <wick3dr0se> It's either write small bs or write docs |
20:15:50 | FromDiscord | <Phil> And nobody wants to write docs, understandable |
20:16:05 | FromDiscord | <wick3dr0se> It's dreadful |
20:16:15 | * | wallabra joined #nim |
20:16:52 | FromDiscord | <Phil> I mean, I pretty much wrote the docs for my entire snorlogue lib over the last 2 days, so I feel that |
20:17:12 | FromDiscord | <wick3dr0se> Just another week, then I'll be back and can finally make something worth a crap. The snake game turned out half decent tho. Still needs some amounts of work but code base is tiny↵↵https://github.com/wick3dr0se/snake |
20:17:25 | FromDiscord | <demotomohiro> Nim in termux works almost in the same way as Nim on linux. |
20:17:38 | FromDiscord | <Phil> Huh, nice, I guess one still uses choosenim? |
20:17:41 | FromDiscord | <wick3dr0se> In reply to @demotomohiro "Nim in termux works": How do you execute a binary tho? |
20:18:02 | * | ltriant joined #nim |
20:18:04 | FromDiscord | <Phil> In reply to @wick3dr0se "How do you execute": Can't you just compile with the `--run` flag? |
20:18:25 | FromDiscord | <Phil> That is assuming executing a binary in Termux is not possible in general or sth |
20:18:28 | FromDiscord | <demotomohiro> @wick3dr0se I can run Nim and compile code without root. |
20:19:37 | FromDiscord | <wick3dr0se> Hasn't worked for me, I figured it was a root issue.↵↵I did whoami, copied the psuedo username and chown user:user file.nim and chmod u=x file.nim and still cant nim c -r file or ./file.nim if compiled |
20:21:43 | FromDiscord | <wick3dr0se> https://media.discordapp.net/attachments/371759389889003532/1046521222067920966/Screenshot_20221127-142056_Termux.jpg |
20:22:22 | FromDiscord | <demotomohiro> I can also run compiled executable without root.↵`nim c -r test1.nim` and `./test1` works without root. |
20:22:41 | FromDiscord | <wick3dr0se> Wtf |
20:22:42 | * | ltriant quit (Ping timeout: 256 seconds) |
20:22:59 | FromDiscord | <wick3dr0se> You dont need to even edit permissions? |
20:24:04 | FromDiscord | <demotomohiro> Yes. I have never changed permissions on termux. |
20:24:54 | FromDiscord | <wick3dr0se> I've never been able to execute a C or Nim binary. I have yet to try anything else but that is through factory resets and I have two different Android devices I use with Termux |
20:25:39 | FromDiscord | <demotomohiro> Maybe newer version of android have more strict security and they doesnt allow running compled code. |
20:26:20 | FromDiscord | <amadan> Can you do `cd /data/data/com.termux/files/home` maybe? Your path where the binary is seems bit weird |
20:26:22 | FromDiscord | <demotomohiro> Im using android 8. |
20:29:36 | * | ltriant joined #nim |
20:33:13 | FromDiscord | <demotomohiro> If you are using android 10 or newer: https://github.com/termux/termux-packages/wiki/Termux-and-Android-10 |
20:34:40 | * | ltriant quit (Ping timeout: 268 seconds) |
20:36:21 | FromDiscord | <demotomohiro> `/data/data/com.termux/files/home` is cwd when I run termux. |
20:40:51 | FromDiscord | <Jessa> where can i read about how to set up a package |
20:41:13 | * | ltriant joined #nim |
20:45:40 | * | ltriant quit (Ping timeout: 248 seconds) |
20:46:57 | * | ltriant joined #nim |
20:48:13 | FromDiscord | <Jessa> Nevermind, found it |
20:51:48 | * | ltriant quit (Ping timeout: 264 seconds) |
20:58:12 | FromDiscord | <wick3dr0se> In reply to @amadan "Can you do `cd": Yes I can. I have $HOME path exported in /data/data/com.termux/files/usr/etc/profile and my custom BASH prompt, that's why it looks different |
20:58:31 | * | ltriant joined #nim |
20:58:46 | FromDiscord | <wick3dr0se> My $HOME env is set to /data/data/com.termux/file/home/storage/shared |
21:02:35 | FromDiscord | <wick3dr0se> In reply to @demotomohiro "If you are using": Man that blows.. I'm on Android 11 with a S10e snapdragon variant. I checked out the relevant issue linked and it was back in 2019 when they realized this would be an issue. Still no change to how their environment is set up, which is likely necessary proceeding with Termux.. Not many phones will be around for much longer with less than Android 10 |
21:03:15 | * | ltriant quit (Ping timeout: 265 seconds) |
21:08:17 | * | doomduck joined #nim |
21:09:21 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h34 |
21:09:37 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4h34" => "https://play.nim-lang.org/#ix=4h35" |
21:10:06 | * | ltriant joined #nim |
21:10:06 | FromDiscord | <Elegantbeef> What is that line? |
21:10:13 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4h35" => "https://play.nim-lang.org/#ix=4h36" |
21:10:35 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h37 |
21:11:02 | FromDiscord | <Elegantbeef> I assume the issue is that `varargs[`$`, typed]` does not work for methods |
21:11:19 | FromDiscord | <Elegantbeef> so you probably need to make your `$` call the method `toString` |
21:11:24 | FromDiscord | <Phil> varargs? |
21:11:35 | FromDiscord | <Phil> Like, I know what varargs is, but where is that applied anywhere? |
21:11:51 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h38 |
21:11:53 | FromDiscord | <Elegantbeef> You're calling `echo` i assume |
21:12:17 | FromDiscord | <Phil> Not quite, `$` is called a fuckton to render Model into a string to render it into HTML |
21:13:58 | FromDiscord | <Phil> A very typical use is for example if I have a foreign key field and want to represent that in a dropdown select field.↵To do that I need to represent a possible model-value of a dropdown with a label, the text for that label I get via `$model` |
21:14:15 | FromDiscord | <Elegantbeef> Hmph `$` does work as a method inside `echo` |
21:14:28 | FromDiscord | <Phil> Yeh, generally `$` methods do work |
21:14:57 | FromDiscord | <Elegantbeef> Hard to say what the issue is |
21:15:12 | * | ltriant quit (Ping timeout: 264 seconds) |
21:15:17 | FromDiscord | <Phil> I have the odd assumption that it's to do with how it's all different packages and that the compiler may see that `$` from the main application for specifically EncounterRead, before it sees the base `$` defined in snorlogue |
21:18:17 | FromDiscord | <Phil> Like, the dependency graph looks kinda like this: https://media.discordapp.net/attachments/371759389889003532/1046535455925096578/image.png |
21:18:56 | FromDiscord | <Phil> `EncounterRead` being a child-class of `Model` |
21:19:19 | FromDiscord | <Phil> And it actually works if I move the `$` for `Model` from snorlogue into norm |
21:19:35 | FromDiscord | <Phil> I just want to avoid that because that means coordinating with another package to change for my package which kinda smells like bad design |
21:19:39 | FromDiscord | <Phil> (edit) "I just want to avoid that because that means coordinating with another package to change for my package which kinda smells like bad design ... " added "on my end" |
21:21:39 | * | ltriant joined #nim |
21:26:35 | * | ltriant quit (Ping timeout: 264 seconds) |
21:29:07 | FromDiscord | <Jessa> In reply to @jtv "Nice, would definitely use": Package is currently uner review i suppose↵<https://github.com/nim-lang/packages/pull/2409> |
21:29:54 | FromDiscord | <Elegantbeef> Technically you already released a package since Nimble is decentralised 😄 |
21:31:04 | FromDiscord | <Elegantbeef> Ugh using regex in a colouring library |
21:31:05 | FromDiscord | <Phil> I mean, I install my snorlogue package all the time so I don't have to copy paste stuff around locally |
21:31:18 | FromDiscord | <Phil> And that's not really released at all |
21:31:48 | FromDiscord | <Phil> So basically, if it's on github, it is kinda released |
21:31:56 | FromDiscord | <Elegantbeef> You know you can just `nimble develop`? |
21:32:26 | FromDiscord | <Phil> I can? |
21:32:33 | FromDiscord | <Elegantbeef> You can |
21:32:38 | FromDiscord | <Jessa> In reply to @Elegantbeef "Ugh using regex in": thanks for your nice feedback |
21:32:43 | FromDiscord | <Elegantbeef> It sym links that project into your nimble path |
21:32:47 | FromDiscord | <Elegantbeef> Then you can just work on all your packages |
21:33:14 | * | ltriant joined #nim |
21:33:17 | FromDiscord | <Phil> That is actually pretty sick |
21:33:33 | FromDiscord | <Elegantbeef> Well jessa i'll provide more feedback |
21:35:03 | FromDiscord | <Phil> In reply to @Jessa "thanks for your nice": Question, would a "Color" enum not also have worked? |
21:35:11 | FromDiscord | <Phil> instead of a colors table |
21:35:44 | FromDiscord | <Jessa> In reply to @Isofruit "Question, would a "Color"": i tried, i didn't really know how to make it work↵↵as i couldn't really do `someEnum[stringValue]` for the value |
21:35:53 | FromDiscord | <Phil> IIRC you still could've associated each enum with its own int value which should've worked I think (would that be what's considered a holey enum?) |
21:35:56 | FromDiscord | <Jessa> so i resorted to something that may or may not be the best |
21:36:30 | FromDiscord | <Elegantbeef> You can do `someEnum[stringValue]` |
21:37:03 | FromDiscord | <Phil> In reply to @Jessa "so i resorted to": It's perfectly valid, enum would just be my own personally preferred choice |
21:37:37 | FromDiscord | <Jessa> In reply to @Elegantbeef "You can do `someEnum[stringValue]`": https://media.discordapp.net/attachments/371759389889003532/1046540323242922145/image.png |
21:37:49 | * | ltriant quit (Ping timeout: 260 seconds) |
21:39:03 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h3e |
21:39:11 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4h3e" => "https://play.nim-lang.org/#ix=4h3f" |
21:39:36 | FromDiscord | <Phil> Well, I guess `MyEnum(5)` would be clearer |
21:39:53 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4h3d no regex required |
21:40:16 | FromDiscord | <Phil> Oh is this about hex to rgb conversion? |
21:40:36 | FromDiscord | <Jessa> i thought you were mad about regex for the finding the parts in the string |
21:40:45 | FromDiscord | <Elegantbeef> I dont like regex at all |
21:41:05 | FromDiscord | <Elegantbeef> It's unreadable and unclear |
21:41:08 | FromDiscord | <Jessa> hear that from a lot of people surprisingly↵↵most of them being "hurr durr, hard to read" |
21:41:10 | FromDiscord | <Jessa> hahaha yea |
21:41:21 | FromDiscord | <Phil> I have no problem with regex generally, though I also had to work with it for ages so I'm somewhat biased |
21:41:31 | FromDiscord | <Jessa> i think it's fine for this simple-ish task |
21:41:45 | FromDiscord | <Jessa> if you get into the whole face onto keyboard shit i can understand it |
21:42:13 | FromDiscord | <Elegantbeef> Eh i have an inane distaste of wasteful APIs 😄 |
21:42:27 | FromDiscord | <Elegantbeef> It needlessly allocates and does a bunch of fun stuff |
21:42:34 | FromDiscord | <Jessa> ¯\_(ツ)_/¯ |
21:44:49 | * | ltriant joined #nim |
21:45:14 | FromDiscord | <Jessa> after package thingy is passed, can you immediately install it using the nimble install after refreshing it's package library/ |
21:45:15 | FromDiscord | <Jessa> (edit) "library/" => "library?" |
21:45:21 | FromDiscord | <Elegantbeef> Yes |
21:45:43 | FromDiscord | <Elegantbeef> But like i said you can just do `nimble install packageurl` as is |
21:46:44 | FromDiscord | <Jessa> i think i may have done something wrong then?↵↵as it doesn't seem to show up when i type `nimble install nimcolor` |
21:46:51 | FromDiscord | <Jessa> or install for that matter |
21:46:58 | FromDiscord | <Phil> I would like to throw in interest to not use acronyms or shorthands. Those force me, the reader, to have to think about what that shorthand irepresents and I desire to be lazy.↵`input` > `inp` |
21:46:58 | FromDiscord | <Elegantbeef> the package url |
21:47:00 | FromDiscord | <Elegantbeef> Not the package name |
21:47:12 | FromDiscord | <Jessa> ah |
21:47:12 | FromDiscord | <Phil> (edit) "irepresents" => "represents" |
21:48:35 | FromDiscord | <Elegantbeef> You can pull `s: string` from my cold dead hands |
21:49:15 | FromDiscord | <Phil> How can I do that when they're warm, alive, and you're actually holding that s with your feet ? |
21:50:15 | FromDiscord | <Phil> Sidenote, doc-comments on public procs are pretty useful. Particularly since they automatically get used by the nim-docs that get generated |
21:50:25 | FromDiscord | <Jessa> In reply to @Isofruit "I would like to": i tend to use acryonims that are still understandable.↵`inp`, is easily understandable as input |
21:50:38 | FromDiscord | <Jessa> In reply to @Isofruit "Sidenote, doc-comments on public": good point, i still wanted to look into tha |
21:50:39 | FromDiscord | <Jessa> (edit) "tha" => "that" |
21:50:53 | FromDiscord | <Jessa> though, probably another time x3 |
21:51:37 | FromDiscord | <Phil> Setting up a github workflow to automatically compile the docs and publish them to github pages is somewhat painful, but I managed by copious amounts of theft from the prologue repos |
21:51:49 | FromDiscord | <Phil> Took like an hour or so |
21:52:14 | * | dtomato4 quit (Quit: The Lounge - https://thelounge.chat) |
21:53:51 | FromDiscord | <Phil> In reply to @Jessa "i tend to use": The reason I prefer the "no acronym" rule in general because what's still understandable and what isn't depends on the amount of context one has.↵I have no idea for example what "reg" here is. And I needed to think for 2 seconds to note that "col" is for "color" here, not "column" which my first thought was since my primary pastime is webdev and thus DB interaction https://media.discordapp.net/attachme |
21:54:24 | FromDiscord | <Elegantbeef> > primary pastime is webdev and thus DB interaction↵Hey it's ok to admit you're wrong |
21:54:44 | * | dtomato4 joined #nim |
21:55:06 | FromDiscord | <yrashk> Is it possible to set a define in a nimscript? (kind of like what `switch` does but analogous to `-d:flag` instead of `--a:b`) |
21:55:27 | * | ltriant quit (Ping timeout: 268 seconds) |
21:55:37 | FromDiscord | <Elegantbeef> `--define: flag` inside a config.nims or `myProject.nim` |
21:55:57 | FromDiscord | <planetis> It's just switch template |
21:56:00 | FromDiscord | <yrashk> Thanks. Alternatively, is it possible to get project's name from a macro? I know I can get project's path, but don't seem to be able to find a way to get project name like I can in nimscript |
21:56:31 | * | ltriant joined #nim |
21:56:43 | * | dtomato4 quit (Client Quit) |
21:56:45 | FromDiscord | <yrashk> (edit) "Alternatively, is" => "Is" |
21:56:57 | doomduck | hey guys, anyone using hot code reloading in nim successfully? |
21:58:11 | * | dtomato4 joined #nim |
21:58:20 | FromDiscord | <Elegantbeef> I dont know of anyone that's seriously used Nim's HCR which is sad |
21:58:28 | FromDiscord | <planetis> In reply to @yrashk "Thanks. Is it possible": Maybe macros.getProjectPath |
21:58:29 | FromDiscord | <Elegantbeef> It does not work as well as it is advertised |
21:58:55 | FromDiscord | <yrashk> In reply to @planetis "Maybe macros.getProjectPath": Yeah, I am aware of getProjectPath |
22:00:11 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h3i |
22:00:16 | FromDiscord | <Jessa> Oooo |
22:00:27 | doomduck | Elegantbeef yeah I noticed there's a bunch of open issues, but it'd be so nice to have it work, not many languages even advertise such a feature |
22:00:37 | FromDiscord | <Jessa> there's the one line thing i've been lookiing for |
22:00:41 | FromDiscord | <Jessa> thank you |
22:00:42 | doomduck | I'd 100% jump on nim if it worked :D |
22:00:45 | FromDiscord | <Phil> one line thing? |
22:00:55 | FromDiscord | <Phil> Ternary operator equivalent you mean? |
22:00:55 | FromDiscord | <Jessa> one line if statement like that |
22:00:58 | FromDiscord | <Jessa> yes |
22:00:59 | FromDiscord | <Jessa> that |
22:01:08 | FromDiscord | <Jessa> always forget iit's name |
22:01:12 | FromDiscord | <demotomohiro> @doomduck Nim's hot code reloading with GLFW sample.↵This code worked 3 years ago:↵https://gist.github.com/demotomohiro/64050496bb615c50fa608d7105509a53 |
22:01:15 | * | ltriant quit (Ping timeout: 265 seconds) |
22:01:17 | FromDiscord | <Phil> Kinda wish we had the questionmark - colon syntax in nim |
22:01:35 | FromDiscord | <Elegantbeef> ternary operator is awful! |
22:02:12 | FromDiscord | <Elegantbeef> The mere existence of it means some one somewhere will think they're wise and chain it, then you're sitting there starring at it going "What the fuck is going on here" |
22:02:17 | doomduck | I mean the demo on the blog works too, but what about this https://github.com/nim-lang/Nim/issues/11974 |
22:02:19 | * | ltriant joined #nim |
22:02:22 | FromDiscord | <Phil> Like, the if-else does the trick, at this point I just feel like `condition ? ontrue : onfalse` is almost on the same level as the if statement in terms of widespreadedness |
22:02:33 | doomduck | or just like any of the super strange issues with the HCR tag :D |
22:02:58 | doomduck | also if I understand correctly the HCR tests are disabled? or maybe I misread in one of the commits |
22:03:02 | FromDiscord | <Yepoleb> In reply to @Elegantbeef "The mere existence of": it's great for optimizing code based on the assumption that less lines = faster |
22:03:05 | FromDiscord | <Phil> In reply to @Elegantbeef "The mere existence of": Beef about to discover that any language feature can be abused for evil |
22:03:24 | FromDiscord | <Elegantbeef> I mean i also think single line if expressions are awful phil |
22:03:27 | FromDiscord | <Elegantbeef> So.... yea |
22:03:38 | FromDiscord | <Elegantbeef> Ternary operator is always used on a single line |
22:03:39 | FromDiscord | <Phil> It's not about less lines of code, it's about being able to avoid mutable variables |
22:03:51 | FromDiscord | <Elegantbeef> What? |
22:03:59 | FromDiscord | <Phil> At least for me |
22:04:05 | FromDiscord | <Yepoleb> 🤔 |
22:04:09 | FromDiscord | <Elegantbeef> Nim allows you to avoid mutable variables with if expressions |
22:04:12 | FromDiscord | <Elegantbeef> So i dont get your point |
22:04:21 | FromDiscord | <Jessa> In reply to @Elegantbeef "The mere existence of": i love doing that sometimes, for the fun of it |
22:04:23 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h3l |
22:04:33 | FromDiscord | <planetis> I would look in the source how projectName is implemented |
22:04:34 | FromDiscord | <Jessa> then get extremely mad at myself the next day when there's a bug in it |
22:05:01 | FromDiscord | <Elegantbeef> What's your point phil? |
22:05:19 | FromDiscord | <Elegantbeef> I think everyone that sincerely uses Nim agrees that the above is off |
22:05:21 | FromDiscord | <Phil> Because that means allowing myself the possibility to fuck up 10 lines later and manipulate x when I shouldn't and bam, issue generated |
22:05:50 | FromDiscord | <Elegantbeef> Oh you're just explaining why you used the if expression |
22:06:28 | FromDiscord | <Phil> Yeh, I was making a case for why ternary or basically doing a one-liner if-else expression is valid, because imo the alternative is way worse |
22:06:44 | FromDiscord | <Jessa> a singular ternary is useful |
22:06:51 | FromDiscord | <Jessa> chaining it into more than 1 is aweful |
22:06:59 | * | ltriant quit (Ping timeout: 260 seconds) |
22:07:03 | FromDiscord | <Elegantbeef> why do you specify one line if expression |
22:07:04 | FromDiscord | <Elegantbeef> Like why is a multi line if expression not valid 😄 |
22:07:04 | FromDiscord | <Jessa> IMIO |
22:07:09 | FromDiscord | <Phil> I have not once in my life seen ternary chained |
22:07:10 | FromDiscord | <Phil> Ever |
22:07:16 | FromDiscord | <Elegantbeef> Cmon! |
22:07:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h3m |
22:07:18 | FromDiscord | <Phil> I didn't even know people did that until you guys brought it up |
22:07:29 | FromDiscord | <Elegantbeef> I've quite a bit |
22:07:40 | FromDiscord | <Elegantbeef> "Hey can you help with this" then they showcase an eldritch horror |
22:07:44 | FromDiscord | <Jessa> lolol |
22:08:15 | FromDiscord | <Jessa> i did that to myself at one poiint, but in python using list comprehensions, walrus operators and ternary operators all in one line |
22:08:25 | FromDiscord | <Phil> Man, the few times I help out I haven't stumbled over it yet |
22:08:31 | FromDiscord | <Jessa> Jynxed it |
22:08:52 | FromDiscord | <Elegantbeef> When you do phil you will wish death upon the inventor of the ternary operator |
22:08:57 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h3n |
22:09:12 | FromDiscord | <Elegantbeef> https://stackoverflow.com/questions/62885773/how-to-chain-ternary-operators |
22:09:20 | FromDiscord | <Elegantbeef> Vertical code \> horizontal |
22:09:22 | FromDiscord | <Elegantbeef> Fite me |
22:09:32 | FromDiscord | <Phil> If the first answer is not "don't" I will be severely disappointed |
22:09:57 | FromDiscord | <Phil> I have read the first answer |
22:10:03 | FromDiscord | <Phil> Not only am I severely disappointed |
22:10:09 | FromDiscord | <Elegantbeef> It gets even worse the more you look https://www.geeksforgeeks.org/c-nested-ternary-operator/ |
22:10:22 | FromDiscord | <Phil> I am shocked, aghast, disgusted and sickened |
22:10:39 | FromDiscord | <Phil> The symbols beef, what do they mean! |
22:10:42 | FromDiscord | <Phil> (edit) "mean!" => "mean?!" |
22:10:43 | FromDiscord | <Elegantbeef> Fine phil we'll do `let x = (int(condition) + 1) 5` |
22:11:00 | FromDiscord | <Phil> blinks |
22:11:02 | FromDiscord | <Phil> What even is that |
22:11:14 | FromDiscord | <Elegantbeef> The same as `if condition: 10 else 5` |
22:11:34 | FromDiscord | <Phil> wait, that coerces boolean to 0 or 1, that entirely depends on one being the double of the other |
22:11:37 | FromDiscord | <Elegantbeef> `true` == `1` `(1 + 1) 5 == 10` |
22:11:56 | FromDiscord | <Elegantbeef> `false` == `0` `(0 + 1) 5 == 5` |
22:12:10 | FromDiscord | <Elegantbeef> It works for your example so stuff it! |
22:12:55 | FromDiscord | <Phil> Can you actually alias `if`with `?` and `else` with `:` I wonder... wait no, that'd have to be a macro, even if it worked |
22:13:53 | * | ltriant joined #nim |
22:14:02 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4h3o |
22:14:15 | FromDiscord | <Elegantbeef> No you cannot↵(@Phil) |
22:14:20 | FromDiscord | <Elegantbeef> You can make `?:` work though |
22:14:39 | FromDiscord | <Phil> I'd be tempted to use the evils package but it goes against the grain in terms of syntax so at that point I might as well stick with single-lining if-else statements |
22:14:45 | FromDiscord | <Phil> (edit) "evils" => "elvis" |
22:15:25 | FromDiscord | <Phil> In reply to @demotomohiro "I used ?: operator": .... I desire to veto the code above |
22:15:40 | FromDiscord | <Elegantbeef> Too bad you're not on the security council |
22:15:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h3p |
22:15:57 | FromDiscord | <Elegantbeef> Bit of a hack but this works |
22:16:21 | FromDiscord | <Phil> how does the colon work? |
22:16:35 | FromDiscord | <Elegantbeef> Block syntax |
22:16:38 | FromDiscord | <Elegantbeef> `:` can be used to provide the next parameter |
22:16:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h3q |
22:17:22 | * | lumo_e quit (Quit: Quit) |
22:18:11 | FromDiscord | <Phil> In that case, isn't the above less of a hack and more of a perfectly functional implementation of a `?` operator?↵Am I overlooking any typical edgecases where that operator would break? |
22:19:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h3r |
22:19:19 | FromDiscord | <Phil> Fuck no |
22:19:20 | FromDiscord | <Phil> Curse that |
22:19:42 | FromDiscord | <Phil> I consider that breaking an intended feature |
22:19:48 | FromDiscord | <Phil> And an actual improvement |
22:20:16 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h3s |
22:20:37 | FromDiscord | <Phil> ~~in an ideal world, the above would also break simply because it's also ugly as hell~~ |
22:21:18 | FromDiscord | <Elegantbeef> If ugly things were to be broken i'd be severely damaged! |
22:21:36 | * | jmdaemon joined #nim |
22:22:22 | * | lumo_e joined #nim |
22:22:23 | FromDiscord | <Phil> You're safe beef, you're not a language syntax |
22:22:34 | FromDiscord | <Elegantbeef> beef-lang exists |
22:22:34 | FromDiscord | <Phil> As far as I'm aware |
22:22:36 | FromDiscord | <Elegantbeef> Checkmate! |
22:22:54 | FromDiscord | <Phil> Are |
22:23:03 | FromDiscord | <Phil> Are you the personification of beef lang? |
22:23:27 | FromDiscord | <Elegantbeef> Nah I'm not overly specialised garbage |
22:23:36 | FromDiscord | <Elegantbeef> I'm rather generic garbage |
22:23:39 | FromDiscord | <Phil> Are you the sentience of beef-lang and learn nim simply because your own language was too painful? |
22:23:56 | FromDiscord | <Phil> (edit) "learn" => "learned" |
22:24:43 | * | pro quit (Quit: pro) |
22:32:31 | * | adium quit (Write error: Connection reset by peer) |
22:33:12 | FromDiscord | <Jessa> In reply to @Elegantbeef "Checkmate!": do i hear chess? |
22:41:00 | * | dnh quit (Ping timeout: 264 seconds) |
22:45:31 | FromDiscord | <huantian> In reply to @Elegantbeef "Fine phil we'll do": it's branchless! |
22:45:32 | FromDiscord | <huantian> definitely |
23:39:42 | * | krux02 quit (Remote host closed the connection) |
23:46:10 | * | lumo_e quit (Quit: Quit) |