00:03:04 | FromDiscord | <evoalg> ok I forked https://github.com/nim-lang/Nim |
00:04:00 | FromDiscord | <Elegantbeef> now you'll want to go to `lib/system.nim` and add your runnable example |
00:04:58 | FromDiscord | <Patitotective> I'm creating a nimble library and I was wondering what should be included into main module (`niprefs.nim`), should I just export all the other modules? |
00:05:34 | FromDiscord | <Elegantbeef> You could it's up to you, you dont need a "main" module for a library |
00:06:21 | FromDiscord | <Patitotective> Oh, really? Thanks :uos |
00:06:30 | FromDiscord | <Patitotective> (edit) ":uos" => "๐" |
00:07:33 | FromDiscord | <evoalg> I've gone to Nim/tree/devel/lib/system ... but that's not lib/system.nim |
00:07:55 | FromDiscord | <Elegantbeef> You cloned the repo right? |
00:08:23 | FromDiscord | <Elegantbeef> After forking you want to clone your fork, then go to that directory on your drive |
00:08:31 | FromDiscord | <evoalg> I forked it ... oh there's a system.nim and a system folder ... that was my problem |
00:08:47 | FromDiscord | <evoalg> oh I don't do it on the github site? |
00:09:09 | FromDiscord | <Elegantbeef> I mean you can but life is easier working in a proper environment |
00:09:17 | FromDiscord | <evoalg> ok |
00:11:36 | FromDiscord | <Elegantbeef> Hmm i dont know if there is a good way to properly test this... |
00:12:01 | FromDiscord | <Elegantbeef> Ideally the runnable example has a assurance it works, but you need to send the ctrl+c to the program somehow |
00:12:29 | FromDiscord | <evoalg> oh so a runnable example isn't just meant as an example for users? |
00:12:53 | FromDiscord | <Elegantbeef> Well it is, but ideally you have assurances that it works |
00:13:24 | FromDiscord | <Elegantbeef> I cant think of how to assure this so i'd say just write an example and make a PR and either it'll get accepted or you'll get told to sod off but have learned how to make a PR |
00:14:18 | FromDiscord | <congusbongus> there should be a way to send signals to programs in tests, it might be more involved in compiled languages in nim but it's possible |
00:14:27 | FromDiscord | <congusbongus> (edit) "in" => "like" |
00:14:29 | FromDiscord | <evoalg> examples are good ... there are lots of cases where I ended up coming here and asking you because there were no examples ... or that's at least how if feels to me, being new |
00:15:16 | FromDiscord | <exelotl> yep we can always benefit from more examples |
00:15:32 | FromDiscord | <evoalg> I would imagine (but might be quite wrong) that most people checking out a language wouldn't come on irc / discord etc |
00:17:23 | FromDiscord | <evoalg> ahhh some of the examples are put in with comments ... I will do that |
00:17:57 | * | rlp10 quit (Ping timeout: 240 seconds) |
00:19:58 | * | rlp10 joined #nim |
00:22:41 | FromDiscord | <evoalg> ok beefy I added an example, and I pushed it back to my forked nim ... now how do I create a PR? |
00:24:30 | * | rlp10 quit (Read error: Connection reset by peer) |
00:25:17 | * | krux02 quit (Remote host closed the connection) |
00:26:08 | * | rlp10 joined #nim |
00:27:05 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzโฆ) |
00:28:23 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/pulls the big green button or if you view your repo it'll say "recent commit in X, pullrequest" or similar |
00:29:24 | FromDiscord | <Elegantbeef> Well the main issue is that it'd require importing other libraries just for the testโต(@congusbongus) |
00:29:37 | FromDiscord | <Elegantbeef> I suppose that's not a big issue |
00:30:16 | arkanoid | once I have a enum with string symbols, is there a convenient way to get that enum value from the string? |
00:31:11 | FromDiscord | <Elegantbeef> `import std/strutils; let myEnm = parseEnum[MyEnumType](myStr)` |
00:31:34 | arkanoid | is it fast? otherwise I would map it the other way around |
00:31:49 | FromDiscord | <Elegantbeef> Warning in the case of `type Colors = enum r = "red", g = "green", b = "blue"` both `"r"` and `"red"` are accepted |
00:32:12 | FromDiscord | <Elegantbeef> It's relatively fast it converts the string to a nim normalized string then compares using hashes iirc |
00:33:09 | FromDiscord | <evoalg> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/pulls the big green": and it should be devel? |
00:33:18 | FromDiscord | <Elegantbeef> Actually it might just has the normalized string |
00:33:26 | FromDiscord | <Elegantbeef> Yep from your branch to `nim/devel` |
00:34:01 | arkanoid | thanks |
00:34:31 | FromDiscord | <evoalg> I clicked on the big green button "New pull request" but I can't then click on "Create pull request" |
00:35:45 | FromDiscord | <evoalg> and I dunno if that's what I'm supposed to do ... when I went to my forked nim (instead of clicking on the big green button) I can't see where it says "recent commit in X, pullrequest" |
00:36:00 | FromDiscord | <Elegantbeef> Click `"compare across forks"` then click the `headRepository` and click yours |
00:36:00 | FromDiscord | <Elegantbeef> Should be like this |
00:36:01 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/933157816645058560/image.png |
00:36:02 | FromDiscord | <Elegantbeef> of course replace my repo with yours |
00:37:28 | FromDiscord | <Elegantbeef> Assuming you pushed to devel you can just copy this link and replace `beef331` with your github name https://github.com/nim-lang/Nim/compare/devel...beef331:devel |
00:38:39 | FromDiscord | <evoalg> I think I did it ... with the compare across forks way |
00:39:17 | FromDiscord | <evoalg> https://github.com/nim-lang/Nim/pull/19416 |
00:39:49 | FromDiscord | <Elegantbeef> Nice though i dont know about using `## Example` |
00:41:01 | FromDiscord | <evoalg> it looked like there were other ones like that (that weren't runnable examples) |
00:42:14 | FromDiscord | <Elegantbeef> Is there an example of it elsewhere? |
00:42:14 | FromDiscord | <Elegantbeef> Ah it's full of it ๐ |
00:42:15 | FromDiscord | <evoalg> I can sort of see why people just put it on stackoverflow ... it'd be better in the docs though |
00:42:24 | FromDiscord | <evoalg> hehe yea |
00:42:33 | FromDiscord | <Elegantbeef> I dont see why |
00:42:44 | arkanoid | is it better to name it atLargeUtf8String or arLargeUTF8String? |
00:42:55 | FromDiscord | <Elegantbeef> It might be a bit odd to learn but nothing bad will happen |
00:43:14 | FromDiscord | <Elegantbeef> It's Nim it doesnt matter, but NEP says former |
00:45:34 | FromDiscord | <evoalg> I guess people find it easier to "stackoverflow" it with less time spend by them instead of "fighting" to get it on the system docs ... and eg if I have something to look up in python my first choice is SO as then it's usually explained beautifully with examples and gotchas |
00:46:07 | FromDiscord | <evoalg> but I agree it's better in the docs |
00:46:42 | FromDiscord | <evoalg> (or both) |
00:47:35 | FromDiscord | <evoalg> ... and thank you beefy for patiently showing me how to create a PR ๐ |
00:47:54 | FromDiscord | <Elegantbeef> No problem |
00:48:59 | FromDiscord | <Elegantbeef> For reference https://github.com/nim-lang/Nim/blob/version-1-6/lib/system.nim#L200 |
00:49:46 | FromDiscord | <evoalg> ahhhh ok |
00:50:16 | arkanoid | thanks again |
00:51:08 | FromDiscord | <Elegantbeef> To quickly explain `rebase` allows you to modify the git history `HEAD~1` goes back 1 commit from where you are, everything else i think is self explanatory ๐ |
00:51:15 | FromDiscord | <Elegantbeef> No problem ark |
00:53:37 | FromDiscord | <evoalg> hang on ... `rebase` ... you're talking to me beefy? What should I do? |
00:54:25 | FromDiscord | <Elegantbeef> Reread my message that starts with "you are missing" |
00:55:00 | FromDiscord | <evoalg> I can't see that message? |
00:55:01 | FromDiscord | <Elegantbeef> I'm suggesting you to edit your last commit with one that has the codeblock statement is basically what that means |
00:55:07 | arkanoid | if I have a enum with string symbol like type MyEnum = enum; meFoo: "bar", how can I print "meFoo"? |
00:55:49 | FromDiscord | <Elegantbeef> You are missing `.. code-block:: Nim` so you may want to to `git rebase -i HEAD~1` replace `pick` with `edit` add code block then `git add --all` followed by `git rebase --continue` and `git push --force` |
00:55:59 | FromDiscord | <Elegantbeef> Matrix bridge working now? |
00:56:24 | FromDiscord | <Elegantbeef> Probably should've wrote periods and commas ๐ |
00:56:34 | FromDiscord | <evoalg> I can see it now ๐ |
00:57:10 | FromDiscord | <Elegantbeef> You are missing `.. code-block:: Nim`.โตSo you may want to do`git rebase -i HEAD~1` replace `pick` with `edit`.โตAdd the code block stuff then `git add --all` followed by `git rebase --continue` and `git push --force`โตThere we go probably more readable! ๐ |
00:57:42 | FromDiscord | <Elegantbeef> I dont know if you can arkanoid without making something to do it |
00:58:00 | FromDiscord | <Elegantbeef> the whole `a = "yourStr"` intentionally overwrites `$` |
01:01:02 | FromDiscord | <evoalg> I think I did it ... will that only update my forked one? |
01:01:26 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/pull/19416/files ehhh! |
01:01:37 | FromDiscord | <Elegantbeef> You've learned to git! ๐ |
01:02:30 | arkanoid | Elegantbeef, I've enabled --stylecheck:hint, and it is saying "'atUtf8String' should be: 'atUTF8String'" |
01:02:47 | arkanoid | well, I hope it is coming from nim, vscode may be doing something |
01:03:02 | FromDiscord | <Elegantbeef> Well yea declaration has to match call with styleCheck |
01:03:50 | FromDiscord | <Elegantbeef> Here you go arknoid https://play.nim-lang.org/#ix=3MIY |
01:04:05 | FromDiscord | <Elegantbeef> You also provided me with yet another typed macro for my updated macro tutorial! ๐ |
01:04:23 | arkanoid | :D |
01:04:29 | arkanoid | thanks a lot! |
01:04:51 | arkanoid | what do you mean with "Well yea declaration has to match call with styleCheck"? |
01:05:09 | arkanoid | argh! here the stile checker is saying the opposite! |
01:05:25 | FromDiscord | <Elegantbeef> `styleCheck` ensures that the callsites have the same identifiers as declared iirc |
01:05:44 | FromDiscord | <Elegantbeef> Oh nvm that's Nim's style guid by default |
01:05:54 | arkanoid | 'atUtf8String' should be: 'atUTF8String', 'atLargeUTF8String' should be: 'atLargeUtf8String' |
01:06:09 | FromDiscord | <Elegantbeef> > โตIn the age of HTTP, HTML, FTP, TCP, IP, UTF, WWW it is foolish to pretend these are somewhat special words requiring all uppercase. Instead treat them as what they are\: Real words. So it's parseUrl rather than parseURL, checkHttpHeader instead of checkHTTPHeader etc. |
01:06:15 | FromDiscord | <Elegantbeef> That's from NEP1 |
01:07:23 | nrds | <Prestige99> Seems a bit weird, I would capitalize abbreviations personally |
01:07:56 | FromDiscord | <Elegantbeef> Given that people say "json" as "jason" and "gui" as "gooey" i dont know |
01:08:12 | arkanoid | in my case it is suggesting two completely opposite things |
01:08:32 | FromDiscord | <Elegantbeef> I think it cannot reasonable enforce style checks |
01:09:03 | FromDiscord | <evoalg> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/pull/19416/files eh": hehe ... I haven't learned git, but I'm taking notes - thank you once again ๐ |
01:09:58 | FromDiscord | <Elegantbeef> No problem, the best part is you can now document things once you find they're under documented, you've become the change you want to see ๐ |
01:14:45 | FromDiscord | <evoalg> true |
01:17:35 | arkanoid | does nim have a "null type" I can use as T? |
01:17:49 | FromDiscord | <Elegantbeef> `void`? |
01:18:13 | FromDiscord | <Elegantbeef> If you want void but different you can do `type NoType = distinct void` |
01:22:52 | arkanoid | right! thanks, sorry for the naive questions |
01:23:20 | arkanoid | I have to deal with multiple languages every day, it's hard to draw a line and switch context |
01:28:28 | FromDiscord | <Patitotective> Is there an equivalent for _Python_ class properties in _Nim_? (Fields that call a procedure) |
01:28:46 | FromDiscord | <Elegantbeef> yes properties ๐ |
01:29:04 | FromDiscord | <Patitotective> lol |
01:29:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3MJ8 |
01:29:58 | FromDiscord | <Elegantbeef> Whoops the `a=` should be `myType: var MyType` |
01:30:09 | FromDiscord | <Patitotective> damn, _Nim_'s so cool lol ๐ |
01:30:10 | FromDiscord | <Patitotective> thanks |
01:32:18 | arkanoid | do you know if there a way to ask the compile to reorder index of literal arrays with char index? |
01:32:57 | FromDiscord | <Elegantbeef> I dont think so |
01:33:03 | FromDiscord | <Elegantbeef> Atleast if i understand what you want |
01:33:09 | arkanoid | I mean this https://play.nim-lang.org/#ix=3MJ9 |
01:33:31 | FromDiscord | <Elegantbeef> Yea there is not |
01:33:38 | FromDiscord | <Elegantbeef> You could make a macro for it though |
01:34:10 | FromDiscord | <Elegantbeef> But there's also an issue that it's non contiguous |
01:34:21 | arkanoid | is that a problem? |
01:34:46 | arkanoid | I just wanted to avoid hash map given that index is char |
01:34:56 | arkanoid | but yeah, it's premature optimization |
01:37:56 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3MJb is what you could do |
01:38:24 | FromDiscord | <Elegantbeef> You then can do `yourChar in formatChars` before indexing the array |
01:38:47 | FromDiscord | <Elegantbeef> Or you can just index and get `taInvalid` |
01:39:20 | NimEventer | New post on r/nim by TheDarkMode: noesisengine and nim?, see https://reddit.com/r/nim/comments/s7e1hq/noesisengine_and_nim/ |
01:39:58 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3MJc |
01:40:02 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3MJc" => "https://play.nim-lang.org/#ix=3MJd" |
01:40:45 | FromDiscord | <Elegantbeef> I'd personally do `newPrefs(table.objectV, path)` but ymmv |
01:40:56 | arkanoid | Elegantbeer, very elegant, very beef. Thanks! |
01:41:17 | FromDiscord | <Elegantbeef> Lol no problem |
01:43:58 | FromDiscord | <Elegantbeef> I dont know my view is repeating oneself is silly, so when possible dont do it |
01:47:49 | arkanoid | and now is possible to have a map of MyEnum -> Type? Like atUInt8 : int8 |
01:48:04 | arkanoid | array[ArrowType, typedesc] seems not valid |
01:48:05 | FromDiscord | <Elegantbeef> No |
01:48:18 | FromDiscord | <Elegantbeef> `typedesc` is compile time information |
01:49:06 | arkanoid | ok, time for large "case" i suppose |
01:49:10 | FromDiscord | <Patitotective> How can I clean all whitespaces from a string? https://nim-lang.org/docs/strutils.html#Whitespace |
01:49:16 | FromDiscord | <Patitotective> (edit) "https://nim-lang.org/docs/strutils.html#Whitespace" => "(https://nim-lang.org/docs/strutils.html#Whitespace)" |
01:50:40 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/strutils.html#strip%2Cstring%2Cset%5Bchar%5D |
01:50:52 | FromDiscord | <Elegantbeef> Depending what you're doing ark https://play.nim-lang.org/#ix=3MJe will work |
01:52:01 | arkanoid | mmm ok |
01:52:51 | arkanoid | I have to do it at runtime: I'm reading a string that represents a datatype, and I have to resolve it's sizeof |
01:53:13 | arkanoid | so I have to run a parser first, then find out the type/object, then sizeof it |
01:53:20 | FromDiscord | <Patitotective> In reply to @Elegantbeef "https://nim-lang.org/docs/strutils.html#strip%2Cstr": I want to remove whitespaces inside the string too (`"Hello world" -> "Helloworld"`) |
01:55:06 | FromDiscord | <Elegantbeef> Time to iterate over all the characters only adding the result if it's not whitespace |
01:56:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3MJf |
01:57:50 | FromDiscord | <Patitotective> why this `result = newString(s.len)`? |
01:58:12 | FromDiscord | <Elegantbeef> To preallocate the result buffer to a known larger size so `add` doesnt cause any allocations |
01:58:34 | FromDiscord | <Elegantbeef> The max size of the result is the length of s, but the min size can be 0..s.len |
01:58:44 | FromDiscord | <Elegantbeef> i gues `0..<s.len` |
01:58:53 | FromDiscord | <Patitotective> ๐ |
01:59:07 | FromDiscord | <Elegantbeef> By preallocating a string to max size we avoid multiple allocations while doing `.add` |
02:00:11 | FromDiscord | <Elegantbeef> You could also do an inplace variation that modifies the `var string` but I didnt feel like implementing it |
02:20:32 | FromDiscord | <Yardanico> In reply to @Patitotective "why this `result =": As Beef said, it preallocates, but he made a slight mistake - if you want to still use add you need to use newStringOfCap instead of just newString |
02:21:10 | FromDiscord | <Patitotective> In reply to @Yardanico "As Beef said, it": lol thanks ๐ |
02:21:49 | FromDiscord | <Elegantbeef> Ah right |
02:21:55 | FromDiscord | <Elegantbeef> Sue me |
02:23:29 | FromDiscord | <Patitotective> How can I create a procedure with optional parameters? Not default, parameters that when given modify the resultโต(Maybe different procedures?) |
02:24:04 | FromDiscord | <Elegantbeef> Overload is one way, but give an example of what you're after |
02:25:22 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3MJn |
02:25:34 | * | neurocyte0917090 quit (Ping timeout: 250 seconds) |
02:25:41 | FromDiscord | <Elegantbeef> `if key.len > 0` if `prefs.len != 0` |
02:26:10 | FromDiscord | <Elegantbeef> If you dont want that you can also use `std/options` |
02:26:18 | FromDiscord | <Patitotective> In reply to @Elegantbeef "`if key.len > 0`": But, what if the user wants to use an empty table? |
02:26:32 | FromDiscord | <Patitotective> In reply to @Elegantbeef "If you dont want": Hmm, ok |
02:26:35 | FromDiscord | <Patitotective> (edit) "In reply to @Elegantbeef "If you dont want": Hmm, ok ... " added "thanks" |
02:27:26 | FromDiscord | <Rika> In reply to @Patitotective "But, what if the": Do you actually have a distinction between none and empty? |
02:28:06 | FromDiscord | <Patitotective> Yep |
02:28:20 | FromDiscord | <Patitotective> There can be a key that's an empty string |
02:28:35 | FromDiscord | <Elegantbeef> Then options are your best bet |
02:28:42 | FromDiscord | <Elegantbeef> Or overloads ๐ |
02:29:46 | FromDiscord | <Patitotective> In reply to @Elegantbeef "Or overloads ๐": hmm, yea, let me try them |
02:29:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3MJo |
02:35:52 | FromDiscord | <Rika> In reply to @Patitotective "There can be a": Then the table is not empty |
02:36:04 | FromDiscord | <Rika> Ah you mean the key |
02:40:30 | arkanoid | is there a logic behind which value is returned from an array with index with holes when a hole is requestes? |
02:41:00 | arkanoid | it seems to return the same value as the last highest index in array |
02:41:23 | FromDiscord | <Elegantbeef> What do you mean? |
02:41:50 | FromDiscord | <Elegantbeef> Array's are contiguous so there are no holes |
02:43:18 | arkanoid | Elegantbeef: https://play.nim-lang.org/#ix=3MJq |
02:43:47 | FromDiscord | <Elegantbeef> the value will always be the `0`'d value in this case `atInvalid` |
02:43:52 | FromDiscord | <Elegantbeef> remember Nim 0's memory |
02:44:12 | arkanoid | is it an assert or is just a case? |
02:44:23 | FromDiscord | <Elegantbeef> I dont follow |
02:46:21 | FromDiscord | <Elegantbeef> All values will be by default be `atInvalid` if you dont want to check what is implemented make a bitset and check that first |
02:46:28 | FromDiscord | <Elegantbeef> `{'n', 'b', 'c', 'C', ....}` |
02:48:05 | arkanoid | ok |
02:48:44 | arkanoid | sorry I feel my english is not up-to-level sometimes |
02:49:09 | FromDiscord | <Elegantbeef> It's fine, you can provide code which is better than english, cause i'm clearly inept at english aswell |
02:49:10 | arkanoid | I was just asking if I can add a doAssert in that |
02:49:32 | FromDiscord | <Elegantbeef> You can do `assert a in FormatSet` |
02:54:33 | arkanoid | I have an UncheckedArray[MyType] and a length of it, it is possible to generate a type that turns it into something I can pass around as an openArray or similar? |
02:54:36 | arkanoid | without copy |
02:55:19 | arkanoid | at runtime |
02:55:55 | FromDiscord | <Elegantbeef> There is `toOpenArray` |
02:56:42 | arkanoid | it doesn't do copy? |
02:56:48 | FromDiscord | <Elegantbeef> Nope |
02:56:57 | FromDiscord | <Elegantbeef> But you cannot hold onto it as a variable |
02:57:07 | FromDiscord | <Elegantbeef> So you need to send it to a procedure or similar that accepts `openArray[T]` |
02:58:44 | arkanoid | sure |
02:58:52 | arkanoid | sweet sweet openarray |
03:01:37 | arkanoid | damns seems that it wont work for a UncheckedArray[pointer] |
03:08:43 | FromDiscord | <Elegantbeef> Cast to `UncheckedArray[int]` perhaps i dont know |
03:39:29 | * | arkurious quit (Quit: Leaving) |
03:47:09 | arkanoid | I succeeded finally, I had to use templates instead of procs, and it makes sense |
03:47:14 | arkanoid | I cannot return openArray |
03:49:43 | FromDiscord | <Elegantbeef> Ah yes |
03:51:13 | arkanoid | now I'm stuck, at runtime I have a enum value that means a nim type (like atFloat64), and I have a "ptr UncheckedArray[byte]" that I need to cast to "ptr UncheckedArray[float64]" and possibly to openArray after that, but all this at runtime |
03:52:11 | arkanoid | I lack the knowledge to handle types at runtime |
03:52:50 | FromDiscord | <Elegantbeef> Well you need to handle them statically ๐ |
03:53:05 | arkanoid | but how? |
03:53:38 | arkanoid | maybe the answer is here but unsure https://play.nim-lang.org/#ix=3MJe |
03:53:51 | arkanoid | my arg is not static |
03:54:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3MJz |
03:56:07 | arkanoid | like what I'm doing here I guess https://play.nim-lang.org/#ix=3MJA |
03:57:42 | FromDiscord | <Rosen> man's really naming his types "taint" |
03:58:10 | arkanoid | ? |
03:58:34 | FromDiscord | <Elegantbeef> you know you can do `of atBinary, atLargeBinary, atUtf8String, atLargeUtf8String` ๐ |
03:58:52 | FromDiscord | <Elegantbeef> I guess that's to be implemented |
03:58:53 | FromDiscord | <Elegantbeef> Disregard! |
03:58:59 | arkanoid | yes, but these are todo |
03:59:57 | arkanoid | so there's no way to ArrowType -> typedesc at runtime |
04:00:14 | arkanoid | damn, now I feel where python shines |
04:00:25 | arkanoid | but smells everywhere else |
04:03:30 | arkanoid | maybe a large object variant ... |
04:06:47 | FromDiscord | <Elegantbeef> That's basically what you have |
04:26:49 | * | Gustavo6046 joined #nim |
05:46:22 | arkanoid | it always confuses me how you cannot do UFC on iterator |
05:47:15 | arkanoid | I have "template values*[T](arr: ArrowArray): openArray[T] =", I can do "for v in values[int32](arr)", but I can't "for v in arr.values[int32]()" |
05:48:18 | FromDiscord | <Elegantbeef> you can |
05:48:23 | FromDiscord | <Elegantbeef> do `arr.values[: int32]` |
05:48:38 | FromDiscord | <Elegantbeef> generic method call syntax requires `[: T]` |
05:49:13 | arkanoid | how can I discriminate when it is needed and when is not? |
05:53:13 | FromDiscord | <Elegantbeef> Is it a generic you're calling using method call syntax? You need it |
06:06:22 | arkanoid | it happens so rarely that I never figured it out by myself |
06:06:26 | arkanoid | thanks for your patience |
06:06:49 | arkanoid | in the meanwhile, hooray, got my first read from pyarrow structure |
06:07:58 | arkanoid | how was that pragma to raise compile error? {.error.} or something |
06:09:08 | FromDiscord | <Elegantbeef> `{.error: "msg".}` |
06:25:07 | FromDiscord | <evoalg> So beefy, someone corrected my example as it was quite right https://github.com/nim-lang/Nim/pull/19416 ... I don't have to do anything right? |
06:25:15 | * | rockcavera quit (Remote host closed the connection) |
06:36:35 | arkanoid | thanks |
06:39:19 | FromDiscord | <Elegantbeef> No they did not correct it |
06:39:24 | FromDiscord | <Elegantbeef> They gave you what is needed to fixed |
06:39:38 | FromDiscord | <Elegantbeef> So you'll want to follow my instructions again adding the tabs |
06:39:57 | FromDiscord | <Elegantbeef> Or just add the tabs and push |
06:53:00 | FromDiscord | <Elegantbeef> @evoalg\: ^ just to get your attention |
06:53:54 | FromDiscord | <evoalg> I can add the tabs and push without doing that trickiness? |
06:54:44 | FromDiscord | <Elegantbeef> You can, it'll add another commit though depending on your view that's not that great |
06:55:07 | FromDiscord | <Elegantbeef> They squash them all into a single commit anyway, but yea just a think to be cognisant about |
06:56:08 | FromDiscord | <evoalg> so can I click on the drop-down on their code and click commit? |
06:56:41 | FromDiscord | <Elegantbeef> I think so |
06:56:47 | FromDiscord | <Elegantbeef> Havent used github gui much myself |
06:57:41 | FromDiscord | <evoalg> The drop-down on the "Commit suggestion" and click on "Commit changes" ... oh ok .... another question, how do I tell that they didn't commit those changes (and didn't correct it)? |
06:58:06 | FromDiscord | <Elegantbeef> It says "suggested change" and there is no new commit in the history |
06:58:31 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/933254078069354516/image.png |
06:58:40 | FromDiscord | <Elegantbeef> For example of what it looks like if someone adds a commit ontop of yours ๐ |
06:59:29 | FromDiscord | <evoalg> ok ... I clicked commit on the drop down ... I'll try and see if that worked |
06:59:29 | FromDiscord | <Elegantbeef> They missed the last statement! |
07:00:05 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/pull/19416/files#diff-c7ae564e61082887ea50f0d58a637cb12fa78261f51aa4eface24ababfeee299R2330 that poor line isnt indented ๐ |
07:00:44 | FromDiscord | <Elegantbeef> Git does get easier to use the more you use it |
07:01:10 | FromDiscord | <evoalg> oh darn |
07:01:19 | FromDiscord | <evoalg> I should have realized sorry |
07:01:40 | FromDiscord | <evoalg> so it's too late to do the HEAD trick? |
07:01:44 | FromDiscord | <Elegantbeef> Nah |
07:01:52 | FromDiscord | <Elegantbeef> You can always do `git pull` |
07:02:15 | FromDiscord | <evoalg> oh I edited the change ... but maybe I should do a git pull ok |
07:02:28 | FromDiscord | <evoalg> I mean edited it locally |
07:02:48 | FromDiscord | <evoalg> oh it did not like that |
07:03:23 | FromDiscord | <Elegantbeef> you can then do `git rebase -i HEAD~2` `edit` the first `drop` the second, indent it properly doโต`git add --all`โต`git rebase -- continue`โต`git force --push` |
07:03:29 | FromDiscord | <Elegantbeef> Jeez |
07:03:32 | FromDiscord | <Elegantbeef> `git push --force` ๐ |
07:03:46 | FromDiscord | <Elegantbeef> You can either do `git checkout .` to discard your change |
07:03:52 | FromDiscord | <Elegantbeef> Or you can do `git reset --hard` |
07:03:59 | FromDiscord | <evoalg> I only edited it in vim ... I didn't add it locally to git |
07:04:11 | FromDiscord | <Elegantbeef> Ah |
07:04:44 | FromDiscord | <evoalg> I'll undo and do you HEAD~1 trick and then change it? |
07:05:05 | FromDiscord | <Elegantbeef> Well `HEAD~2` now if you want to have a single commit |
07:05:24 | FromDiscord | <evoalg> ok |
07:05:32 | FromDiscord | <Elegantbeef> You can drop the latest commit and edit the first |
07:05:55 | FromDiscord | <evoalg> sorry how do I do that? ... I'm easily confused with git |
07:06:09 | FromDiscord | <Elegantbeef> This message walks you through it |
07:06:20 | FromDiscord | <evoalg> ok |
07:06:35 | FromDiscord | <Elegantbeef> it should be `git push --force` though |
07:06:41 | FromDiscord | <evoalg> ok |
07:06:54 | FromDiscord | <Elegantbeef> Tired mind got starwarsy i guess |
07:07:26 | FromDiscord | <evoalg> lol |
07:07:38 | FromDiscord | <Elegantbeef> `HEAD~2` if you cannot guess allows you to modify the the last two commits |
07:07:44 | FromDiscord | <evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3MJU |
07:07:48 | FromDiscord | <Elegantbeef> `git checkout .` |
07:07:59 | FromDiscord | <Elegantbeef> You saved a file inside the git directory and git knows it |
07:08:27 | FromDiscord | <Elegantbeef> Git's tracking files so it knows when one has changes and will not let you use many commands whilst you have them |
07:08:53 | FromDiscord | <Elegantbeef> `checkout .` should discard changes if you havent committed |
07:09:00 | FromDiscord | <evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3MJV |
07:09:07 | FromDiscord | <evoalg> I change to edit the 2nd ... ignore the 1st? |
07:09:11 | FromDiscord | <Elegantbeef> you didnt do `git pull` |
07:09:13 | FromDiscord | <evoalg> oh |
07:09:20 | FromDiscord | <Elegantbeef> do not modify that just close it |
07:09:28 | FromDiscord | <evoalg> ok |
07:09:40 | FromDiscord | <Elegantbeef> `git pull` now |
07:09:50 | FromDiscord | <Elegantbeef> That'll get your remote changes(from github gui) |
07:10:03 | FromDiscord | <evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3MJW |
07:10:49 | FromDiscord | <evoalg> it's suggesting I do one of those before my next git pull |
07:10:55 | FromDiscord | <Elegantbeef> I guess the first |
07:10:58 | FromDiscord | <evoalg> ok |
07:11:02 | FromDiscord | <Elegantbeef> \Dont know if i've seen that before |
07:12:08 | FromDiscord | <evoalg> I did it ... but I'm still getting: |
07:12:17 | FromDiscord | <evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3MJX |
07:12:23 | FromDiscord | <Elegantbeef> That's right this time |
07:12:24 | FromDiscord | <Elegantbeef> Notice how the commits changed |
07:12:43 | FromDiscord | <Elegantbeef> edit the first one "add an example to" and drop "correct the example" |
07:12:54 | FromDiscord | <evoalg> ohhhhh |
07:13:02 | FromDiscord | <evoalg> now I edit the first? |
07:13:22 | FromDiscord | <evoalg> change pick to edit on the first one? |
07:13:43 | FromDiscord | <evoalg> drop the 2nd... |
07:14:19 | FromDiscord | <Elegantbeef> yes |
07:14:41 | FromDiscord | <Elegantbeef> you now properly format the example then do `git add --all` |
07:15:31 | FromDiscord | <Elegantbeef> then you can do `git rebase --continue` and `git push --force` and should be golden |
07:15:39 | FromDiscord | <Elegantbeef> And this is your intro to git! ๐ |
07:18:47 | FromDiscord | <evoalg> I did it ... I think... |
07:19:01 | FromDiscord | <Elegantbeef> You did! |
07:19:09 | FromDiscord | <Elegantbeef> Congrats |
07:19:38 | FromDiscord | <evoalg> phew ... but I needed lots of hand holding |
07:20:13 | FromDiscord | <Elegantbeef> To be fair i dont imagine most are used to manually rebasing/editing commits |
07:21:05 | FromDiscord | <evoalg> advance trickiness heh ๐ |
07:21:25 | FromDiscord | <Elegantbeef> Think i mainly depends on what they're working on or who they are |
07:21:54 | FromDiscord | <evoalg> those spaces after the hash signs `## ` and then indenting made me stop and think |
07:21:58 | FromDiscord | <Elegantbeef> Eh if you use git more often it's not too magical |
07:23:43 | FromDiscord | <evoalg> so I could have committed additional changes but using advanced ways we made it as if it was right the first time |
07:23:50 | FromDiscord | <Elegantbeef> Yep |
07:25:02 | FromDiscord | <evoalg> if it passes and people have happy with it, will it get updated with the next nim version or something ... not the current one right? |
07:25:08 | FromDiscord | <Elegantbeef> The git history is not any wiser that you panicked hyperventilated and vomited in a paper bag |
07:25:36 | FromDiscord | <Elegantbeef> Yea it'll be in the next minor Nim version `1.8`(or 2.0) unless it's backported |
07:26:00 | FromDiscord | <evoalg> Thanks for your help once again |
07:26:47 | FromDiscord | <Elegantbeef> It will be on the dev docs though |
07:27:05 | FromDiscord | <Elegantbeef> Dev docs hosted here https://nim-lang.github.io/Nim/ |
07:27:40 | FromDiscord | <Elegantbeef> Dont remember if these are generated nightly or after each PR, so no clue how long after your PR will you see your first contribution |
07:27:42 | FromDiscord | <evoalg> ahhh thanks ๐ |
07:27:59 | FromDiscord | <evoalg> that's if it's accepted |
07:28:25 | FromDiscord | <Elegantbeef> Eh it'll probably be |
07:30:37 | FromDiscord | <xflywind> You can use `nim doc -r --lib:lib lib/system.nim` to see whether your changes work. |
07:31:09 | FromDiscord | <xflywind> https://nim-lang.github.io/Nim/contributing.html contains many contributing guides. |
07:31:49 | FromDiscord | <Elegantbeef> Oh right the commit message should've had `[skip CI]` cause it's purely doc |
07:32:12 | FromDiscord | <evoalg> ahhhhh ... thank you both |
07:34:11 | FromDiscord | <xflywind> In reply to @evoalg "ahhhhh ... thank you": I think an extra line is required between example and code examples |
07:34:15 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/933263064839618560/unknown.png |
07:34:36 | FromDiscord | <xflywind> (edit) "code examples" => "`.. code-block`" |
07:34:59 | FromDiscord | <Elegantbeef> Evo is like 3 seconds away from going "Well i thought adding this was going to be simple, but i'm off to go kill a person, be back after lunch" |
07:35:18 | FromDiscord | <evoalg> or have a cry |
07:35:58 | FromDiscord | <enthus1ast> @Patitotective\: yes but you must tweak it to fit your use case https://play.nim-lang.org/#ix=3MJZ |
07:36:04 | FromDiscord | <evoalg> Shall I do the HEAD~1 trick again beefy? |
07:36:27 | FromDiscord | <Elegantbeef> Hey dont look at me I'm not someone that can accept PRs |
07:37:02 | FromDiscord | <xflywind> rebase is not required, PRs are merged by squash automatically. |
07:37:17 | FromDiscord | <enthus1ast> @Patitotective\: eg if you want to replace hex/decimal with numbers or characters |
07:37:50 | FromDiscord | <evoalg> so I could just do another git add, commit & push after editing it with the new line? |
07:37:58 | FromDiscord | <xflywind> yeah |
07:38:08 | FromDiscord | <Elegantbeef> Test locally with what flywind said first though |
07:38:21 | * | PMunch joined #nim |
07:38:44 | FromDiscord | <evoalg> true |
07:38:58 | FromDiscord | <Isofruit> In reply to @Elegantbeef "And this is your": Oh boy, git rebase |
07:40:16 | FromDiscord | <Isofruit> I use almost anything but, I do not run with a lot of branches generally though so I guess that doesn't quite count.โตI use cherry pick more than I use rebase tbh |
07:40:40 | FromDiscord | <evoalg> looks good ... and I should use [skip CI] somewhere in the commit message? |
07:42:08 | FromDiscord | <evoalg> geez I did "git commit" and forgot to do the [skip CI] straight away |
07:42:26 | FromDiscord | <Isofruit> Can always amend if it isn't pushed |
07:42:41 | FromDiscord | <evoalg> I didn't do git push yet |
07:43:18 | FromDiscord | <Isofruit> Git commit - - amend... Imagine I wrote that flag correctly |
07:43:29 | FromDiscord | <Isofruit> On mobile, life is hard |
07:44:07 | FromDiscord | <evoalg> thanks that worked |
07:47:07 | FromDiscord | <evoalg> so I ended up doing `git add .` and `git commit` (and then edited it) and then `git push` ... and I think it updated the PR |
07:47:52 | FromDiscord | <Isofruit> If you commit to a branch that is in pr that commit counts towards the pr |
07:49:20 | FromDiscord | <Isofruit> Effectively the PR isn't on a snapshot of your branch, it's of the entire branch until the pr is merged. That is so you can make refactoring commits after receiving feedback on your pr by the repo owner |
07:50:12 | FromDiscord | <Isofruit> Or whoever else reads the pr |
07:51:08 | FromDiscord | <evoalg> nice that makes life a little better then ๐ |
07:51:40 | * | jjido joined #nim |
07:52:47 | FromDiscord | <Isofruit> Sidenote, I recommend tiny commits and small pr's if other people are involved in the review process |
07:55:36 | FromDiscord | <evoalg> makes sense I guess yea |
08:16:26 | FromDiscord | <evoalg> I dunno who flywind is on git ... I dunno if they are on here but thank you |
08:16:41 | FromDiscord | <Elegantbeef> They're xflywind ๐ |
08:17:04 | FromDiscord | <evoalg> ohhhh all good ๐ |
08:17:43 | szahid | Hello. Why i have 3 on output everytime? https://play.nim-lang.org/#ix=3MKd |
08:17:46 | FromDiscord | <Isofruit> They're literally the main person behind the prologue framework ๐ |
08:18:02 | * | pch joined #nim |
08:18:12 | FromDiscord | <evoalg> oh shows how little I know |
08:18:29 | FromDiscord | <Elegantbeef> `randomize()` szahid |
08:18:32 | FromDiscord | <Elegantbeef> Otherwise it uses the default state |
08:18:52 | FromDiscord | <enthus1ast> 3 sound like a fair random number to me \:) |
08:19:20 | FromDiscord | <evoalg> some languages randomize by default, but not Nim though |
08:19:49 | * | xet7 quit (Ping timeout: 240 seconds) |
08:21:01 | PMunch | @Elegantbeef, yeah we rolled a dice and it came up 3, so that's the random number |
08:21:20 | PMunch | https://xkcd.com/221/ |
08:21:45 | szahid | Elegantbeef thanks! |
08:21:51 | pch | is there a fast way to truncate least significant bits without assuming endianness when working with integers? I need to truncate a 32-bit normalized position to 8 or 16 bits on the fly and store |
08:22:25 | PMunch | pch, well you can stop assuming endianness and check it? |
08:23:38 | pch | more optimal would be to just have a truncate function that Knows:tm: |
08:25:19 | PMunch | Well it'd need to check as well |
08:25:25 | PMunch | So someone has to check |
08:25:52 | PMunch | You can divide the number by a power of two |
08:25:57 | PMunch | That would truncate it |
08:26:02 | pch | yeah just asking if there's a built-in way that Knows |
08:26:07 | pch | true |
08:26:21 | PMunch | And probably be optimised away to a shift optimisation anyways |
08:26:29 | FromDiscord | <leorize> the only way to know is if someone told you, no? |
08:26:54 | pch | well usually The Compiler Knows |
08:27:03 | FromDiscord | <leorize> no matter what the byte ordering is, the data is still correct |
08:27:09 | pch | this is kinkinkijkin btw, working on a project i havent touched in years |
08:28:26 | pch | bit shift left on BE32 divides, on BE8 mangles |
08:29:51 | FromDiscord | <leorize> nim does let you know the endian at compile time, if you're working on native mumbers |
08:30:28 | pch | so just use `when` then... |
08:30:32 | FromDiscord | <leorize> but aren't native numbers always follow a constant shift pattern anyway? |
08:30:58 | PMunch | pch, pretty much, you can of course put that in a template or something |
08:31:01 | pch | possibly? might change between compilers |
08:31:23 | FromDiscord | <leorize> ie. shift-left defined as shift torwards most significant bit and shift-right defined as shifting torwards least significant bit |
08:32:43 | pch | I know there's some wacky reactions you can get from some GCC versions on 32BE8 compiles |
08:32:57 | pch | ie on armv7 with -mbe8 |
08:33:12 | * | xet7 joined #nim |
08:33:32 | PMunch | https://stackoverflow.com/questions/7184789/does-bit-shift-depend-on-endianness |
08:34:21 | pch | ah okay |
08:39:48 | FromDiscord | <Rika> So basically shifts arenโt dependent on endianness unless youโre on PowerPC? |
08:40:07 | PMunch | Seems like it :P |
09:14:44 | * | Vladar joined #nim |
09:21:40 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzโฆ) |
09:51:51 | * | Gustavo6046 quit (Quit: Leaving) |
10:48:23 | FromDiscord | <dizzyliam> sent a code paste, see https://play.nim-lang.org/#ix=3MKG |
10:48:30 | FromDiscord | <dizzyliam> today in cursed things: code justified like text |
10:51:59 | FromDiscord | <congusbongus> No oooooโตThis is why my favourite thing about golang is gofmt |
11:03:39 | FromDiscord | <Tanguy> gofmt is a dictatorship |
11:04:17 | PMunch | @dizzyliam, oh goodness gracious |
11:05:08 | PMunch | @congusbongus, no wonder you started looking into Nim if your favourite feature from Go is it's auto-formatter :P |
11:07:02 | * | Lord_Nightmare quit (Ping timeout: 240 seconds) |
11:07:23 | FromDiscord | <xx_ns> In reply to @karma_corrections "today in cursed things:": i kind of like it |
11:07:33 | FromDiscord | <xx_ns> I'll start formatting my code like this from now on |
11:14:37 | FromDiscord | <Rika> In reply to @Tanguy "gofmt is a dictatorship": Go |
11:23:43 | FromDiscord | <mratsim> And Github is punisshing tab users by displaying tabs as 8 spaces. |
11:24:28 | FromDiscord | <mratsim> like wtf: https://github.com/sel-hamr/42-fractol/blob/master/fractol.h |
11:28:38 | PMunch | @mratsim, Emacs-style code looks like a complete mess if you don't do that, and it doesn't really break anything for code that only uses tabs |
11:29:33 | PMunch | You can also just chuck on ?ts=4 in the URL to change it: https://github.com/sel-hamr/42-fractol/blob/master/fractol.h?ts=4 |
11:29:56 | PMunch | And there's probably a browser extension somewhere out there which applies that automatically for you |
11:31:37 | FromDiscord | <mratsim> TIL |
11:31:50 | FromDiscord | <mratsim> (I was looking for mandelbrot ;)) |
11:39:49 | PMunch | By the way, for those who might not know. It was (is?) common in Emacs to indent C code with four spaces, but replace every eight space with a tab. If you open up code written in this style in another editor it looks completely bonkers, and you start questioning the sanity of the author. |
11:40:25 | PMunch | Had a professor who wrote his pre-code in Emacs, and as his TA I had to answer all the angry emails from students wondering if the professor had gone mad |
11:45:18 | FromDiscord | <Rika> That sounds bonkers even with contextโฆ |
11:46:31 | szahid | What is the correct way to use query parameters with httpClient? just add this to the url string? |
11:47:53 | FromDiscord | <Rika> Yes |
11:48:56 | PMunch | @Rika, well it used to be a thing that even code should save space |
11:49:13 | szahid | Hello Rika :) |
11:49:18 | PMunch | I mean C still has trigraphs in order to support non-ASCII machines :P |
11:49:20 | FromDiscord | <Hamid_Bluri> sent a long message, see http://ix.io/3MKZ |
11:49:30 | FromDiscord | <Hamid_Bluri> wow |
11:49:37 | FromDiscord | <Rika> In reply to @szahid "Hello Rika :)": Hello, whatโs up |
11:49:42 | FromDiscord | <Rika> In reply to @PMunch "<@259277943275126785>, well it used": Ah I see |
11:49:53 | FromDiscord | <Rika> In which case just use tabs for everything no? |
11:49:55 | PMunch | if (my_int == 42) ??( printf("Hello world %d", 42); ??) |
11:49:59 | PMunch | That's valid C |
11:50:18 | FromDiscord | <Hamid_Bluri> ????? |
11:50:27 | FromDiscord | <Rika> Did you mean ??( |
11:50:46 | FromDiscord | <Hamid_Bluri> yeah what is it |
11:51:00 | FromDiscord | <Hamid_Bluri> trigraphs? |
11:51:03 | PMunch | Well if you have more than 5 levels of indentation you start saving again |
11:51:13 | PMunch | Not 100% sure why they did it that way though.. |
11:51:20 | FromDiscord | <Rika> https://riptutorial.com/c/example/23858/trigraphs |
11:51:23 | FromDiscord | <Rika> Cursed |
11:51:34 | PMunch | @Hamid_Bluri, it's for machines that don't have 8-bit ASCII files |
11:51:42 | FromDiscord | <Rika> Imagine a world that wasnโt standardisedโฆ. Wait |
11:52:11 | PMunch | Oh apparently it's ??< and not ??( |
11:52:16 | FromDiscord | <Rika> Yup |
11:52:16 | PMunch | ??( is a square bracket |
11:52:55 | FromDiscord | <Rika> Youโre a square bracket smh |
11:53:09 | PMunch | By the way, trigraph replacement is one of the very first things the compiler does. Even before parsing. So it will replace them in string literals as well :P |
11:53:24 | FromDiscord | <Rika> I mean it should shouldnโt it |
11:53:34 | PMunch | Although nowadays I think you actually have to pass a flag to GCC to enable it |
11:53:47 | FromDiscord | <Rika> Yes, -trigraphs I think |
11:53:49 | PMunch | Oh yeah it's very much a feature |
11:54:23 | PMunch | But it can be confusing if you write something like `printf("What happened??!");` and it prints out "What happened|" |
12:00:15 | FromDiscord | <Rika> Lol |
12:46:45 | * | NimBot joined #nim |
12:47:16 | * | nisstyre joined #nim |
12:49:09 | szahid | im looking for substitute python's list range ex. arr[2:5] |
12:50:16 | szahid | ok. i have.. seq[2..5] |
12:50:41 | FromDiscord | <eyecon> Oooh, let me give the standard answer this time |
12:50:49 | FromDiscord | <eyecon> In reply to @szahid "im looking for substitute": Use slicerator: https://www.notion.so/ardasaltoglu/slicerator-f1693185839a403e8d167a81d8ee583d |
12:51:06 | FromDiscord | <eyecon> Use slicerator: https://github.com/beef331/slicerator |
12:51:31 | FromDiscord | <eyecon> Pasted a wrong link at first, sorry |
12:54:24 | FromDiscord | <Rika> Only if you want an iterator |
12:54:41 | FromDiscord | <Rika> It doesnโt apply if you want a slice value I believe |
13:02:39 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3MLF |
13:03:34 | FromDiscord | <mratsim> In reply to @szahid "ok. i have.. seq[2..5]": seq[2..<5] |
13:30:02 | * | Vladar quit (Quit: Leaving) |
13:33:34 | * | rockcavera joined #nim |
13:33:34 | * | rockcavera quit (Changing host) |
13:33:34 | * | rockcavera joined #nim |
13:36:40 | NimEventer | New thread by GordonBGood: Update on compiling to asmjs or wasm through emscripten..., see https://forum.nim-lang.org/t/8827 |
13:47:13 | FromDiscord | <Rika> In reply to @eyecon "Do you see any": Why not in [] you get or default (removes the var) and in []= you just do the same as []= for tables? |
13:47:33 | FromDiscord | <Rika> You already store the default value, why store it more times in the table? |
13:47:47 | FromDiscord | <Rika> Ah I can see why |
13:48:49 | FromDiscord | <Rika> Eh okay if you need the formerly accessed but not set keys okay |
14:10:46 | NimEventer | New thread by Sauerbread: Privacy offensive - remove Google Analytics from the Nim website, see https://forum.nim-lang.org/t/8828 |
14:15:39 | FromDiscord | <eyecon> In reply to @Rika "Eh okay if you": Thanks! Any comments/criticisms that still apply? |
14:21:01 | FromDiscord | <Rika> I donโt think you can improve this other than using the same []= from tables in []= |
14:21:28 | FromDiscord | <Rika> Because you donโt need to put the default before always putting a new value |
14:26:01 | * | Lord_Nightmare joined #nim |
14:27:47 | FromDiscord | <eyecon> I... don't get it. My use case is, if it helps, generally to have empty `seq`s in the table's unallocated keys so that I can add without checking and creating a new empty `seq`. |
14:29:22 | FromDiscord | <eyecon> Ah, do you mean that I overwrite the value from `mGetOrPut` in any case? |
14:29:29 | FromDiscord | <eyecon> If so, I think you are right |
14:32:19 | FromDiscord | <eyecon> So simply: `proc `[]=`[A, B](self: var DefaultTable[A, B], key: A, value: B) = self.table[key] = value` |
14:33:22 | * | nrds joined #nim |
14:34:19 | FromDiscord | <Rika> Yes |
14:34:26 | FromDiscord | <Rika> Thatโs what I mean yes |
14:34:27 | FromDiscord | <IsaacPaul> In reply to @eyecon "Thanks! Any comments/criticisms that": > proc `[]`[A, B](self: var DefaultTable[A, B], key: A): var B =โต> self.table.mgetOrPut(key, self.defaultvalue)โตYou're lying to the developer. You're saying that there is a value at that key when there isn't. |
14:34:40 | FromDiscord | <Rika> In reply to @IsaacPaul "> proc `[]`*[A, B](self:": Thatโs the point of the data structureโฆ |
14:35:18 | FromDiscord | <IsaacPaul> I don't think you should lie to save a few keystrokes lol |
14:35:25 | FromDiscord | <Rika> Opinion |
14:35:29 | FromDiscord | <Rika> Not helpful in which case |
14:35:44 | FromDiscord | <eyecon> Lie? That's the whole point, to have values automatically created on access |
14:35:56 | FromDiscord | <eyecon> Besides, I'm not overwriting `contains` |
14:36:18 | FromDiscord | <eyecon> So key presence checks still fail for nonexistent keys |
14:36:30 | FromDiscord | <eyecon> I think at least, never needed them |
14:36:54 | FromDiscord | <Rika> I donโt know what your point is |
14:37:41 | FromDiscord | <IsaacPaul> Honestly, the structure sounds problematic from a maintenance prospective. But I have no way to quantify my opinion besides experience ๐ |
14:38:14 | FromDiscord | <Rika> I personally donโt understand why they need it either but I wonโt question it too hard |
14:41:37 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3MMa |
14:41:52 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3MMb |
14:42:12 | FromDiscord | <mratsim> or use array[char, int] ? |
14:42:43 | FromDiscord | <eyecon> But it's a pair of chars to int |
14:42:53 | FromDiscord | <mratsim> ah |
14:43:04 | FromDiscord | <mratsim> then array[uint16, int] |
14:43:04 | FromDiscord | <IsaacPaul> (edit) "https://play.nim-lang.org/#ix=3MMb" => "https://play.nim-lang.org/#ix=3MMc" |
14:43:13 | FromDiscord | <eyecon> That would have been possible, sure |
14:43:25 | FromDiscord | <eyecon> So, pre-allocate all combinations basically |
14:43:48 | FromDiscord | <eyecon> If the value type is not a primitive, like a seq, it gets more complicated |
14:44:21 | * | arkurious joined #nim |
14:44:32 | FromDiscord | <mratsim> array[uint16, seq[Something]]? |
14:47:17 | FromDiscord | <eyecon> Yes, and if the usage is sparse, then we are probably allocating some thousand times empty `seq`s in vain |
14:47:26 | FromDiscord | <eyecon> Not that it's impossible or bad, jut saying |
14:47:35 | FromDiscord | <eyecon> That is definitely an option |
14:49:42 | FromDiscord | <eyecon> Can I say something like Kotlin's "delegate all the unknown actions on this object to this field"? |
14:50:38 | FromDiscord | <eyecon> So that e.g. `items` on a `DefaultTable` automatically is applied to the `.table`? |
14:51:46 | * | Jjp137 joined #nim |
14:53:37 | FromDiscord | <Rika> No |
14:53:42 | FromDiscord | <Rika> Or rather |
14:53:45 | FromDiscord | <Rika> With a macro ๐ |
14:54:05 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3MMl |
14:54:12 | FromDiscord | <eyecon> I tend to take "no"s in this channel as "only with a macro" anyway |
14:54:24 | FromDiscord | <IsaacPaul> (edit) "https://play.nim-lang.org/#ix=3MMl" => "https://play.nim-lang.org/#ix=3MMm" |
14:54:48 | FromDiscord | <Rika> Do you want to distinguish no key from defaulted/accessed before anyway? |
14:54:58 | FromDiscord | <Rika> Do you have a reason to distinguish them |
14:55:06 | FromDiscord | <mratsim> In reply to @eyecon "Yes, and if the": they aren't allocated if they are uninitialized |
14:55:22 | FromDiscord | <Rika> In reply to @mratsim "they aren't allocated if": They arenโt? Huh since when |
14:55:32 | FromDiscord | <eyecon> In the case I wrote about, yes, I did. I can imagine use cases where I wouldn't too |
14:55:58 | FromDiscord | <eyecon> So I implemented `.pairs` which would only iterate in previously set keys' values |
14:56:07 | FromDiscord | <eyecon> It works for my use case |
14:56:12 | FromDiscord | <mratsim> In reply to @Rika "They arenโt? Huh since": a while, there is a check in add(s: var seq): to ensure a seq is allocated |
14:56:17 | FromDiscord | <Rika> Okay so in that case technically Option wouldnโt help you |
14:56:36 | FromDiscord | <mratsim> and if not ia allocates one |
14:56:42 | FromDiscord | <mratsim> (edit) "ia" => "it" |
14:57:04 | FromDiscord | <Rika> In reply to @mratsim "a while, there is": But the default value is an empty seq? Do default values not have any allocations |
14:57:28 | FromDiscord | <IsaacPaul> In reply to @mratsim "they aren't allocated if": ๐ฎ that's good to know |
14:57:33 | FromDiscord | <mratsim> it's ptr+len with a nil pointer |
14:58:32 | FromDiscord | <mratsim> https://github.com/nim-lang/Nim/blob/b24812df5f952427c1266e48c40b7956bdf3d999/lib/system/repr.nim#L163-L165 |
14:58:59 | FromDiscord | <mratsim> so if unitialized you just need to check if len == 0 |
14:59:09 | FromDiscord | <mratsim> and if so you check the pointer if it's nil |
14:59:18 | FromDiscord | <mratsim> and if yes, you allocate only at that point |
15:00:20 | FromDiscord | <Rika> I see |
15:00:49 | FromDiscord | <mratsim> easy to check, cast a array[16, byte] to seq[Foo] and add Foo |
15:03:16 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=3MMH |
15:03:50 | FromDiscord | <mratsim> https://media.discordapp.net/attachments/371759389889003532/933376208954069092/unknown.png |
15:04:11 | FromDiscord | <mratsim> @eyecon ^ |
15:05:46 | FromDiscord | <mratsim> https://media.discordapp.net/attachments/371759389889003532/933376695539478619/unknown.png |
15:07:21 | FromDiscord | <eyecon> I see, thanks |
15:07:33 | FromDiscord | <eyecon> So it's the `add` that allocates |
15:07:46 | FromDiscord | <xflywind> !eval echo (NimMajor, NimMinor, NimPatch) |
15:07:47 | FromDiscord | <demotomohiro> !eval var sq: seq[string]; echo cast[int](sq) |
15:07:49 | NimBot | (1, 4, 8) |
15:07:50 | NimBot | 0 |
15:14:09 | * | noeontheend joined #nim |
15:41:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
16:07:22 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3MN3 |
16:23:45 | PMunch | Hmm, it seems like on of your runnable examples have caused an issue |
16:23:53 | PMunch | Too bad it doesn't say which one.. |
16:24:19 | PMunch | Or is it because /usr/doc/nimdoc.css doesn't exist? That would be silly |
16:27:06 | FromDiscord | <Patitotective> Yea, `usr/doc/nimdoc.css` doesn't exist |
16:37:11 | FromDiscord | <leorize> this is expected if you install Nim through your distro package manager which packages nim according to the FHS |
16:37:48 | FromDiscord | <leorize> simply put\: the compiler is incompatible with Linux's FHS so packaging like that will break a feature or two |
16:38:35 | PMunch | It is generally recommended to grab Nim via choosenim |
16:39:31 | FromDiscord | <Patitotective> I had a problem while installing _Nim_ because my pc is _old_, so Yardanico helped me to install _Nim_ manually |
16:40:21 | FromDiscord | <Patitotective> Maybe that's the problem |
16:40:44 | FromDiscord | <Patitotective> sent a code paste, see https://paste.rs/Opk |
16:40:50 | FromDiscord | <Rika> thats a dev version |
16:40:51 | FromDiscord | <Patitotective> (edit) |
16:40:51 | FromDiscord | <Rika> huh |
16:42:08 | FromDiscord | <Patitotective> Here are the message with Yardanico https://discord.com/channels/371759389889003530/753721959308853319/927965417094410251 |
16:44:22 | PMunch | Hmm, so where did you put Nim? |
16:45:04 | PMunch | Did you copy the binary anywhere? |
16:45:27 | PMunch | I think it looks for some files relative to its own location |
16:45:59 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3MNq |
16:46:05 | FromDiscord | <Patitotective> (edit) |
16:46:07 | PMunch | So I'm guessing you moved it to /usr/bin/nim or something like that, and then it goes looking out of the bin folder, expecting to find the rest of the repository, but ending up in /usr |
16:46:24 | PMunch | Yup, that's exactly what has happened |
16:46:35 | FromDiscord | <Patitotective> So should I reinstall _Nim_? |
16:46:45 | PMunch | Nah I think we can hack this |
16:46:51 | PMunch | Do you still have nimble in the Nim repo folder? |
16:47:34 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3MNr |
16:47:38 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3MNr" => "https://play.nim-lang.org/#ix=3MNs" |
16:47:55 | FromDiscord | <Patitotective> I guess I removed it, should I clone it again? |
16:48:33 | PMunch | Ah, well then we're pretty much in the territory of a reinstall |
16:48:45 | PMunch | But yeah, I guess that's the easiest solution |
16:48:54 | PMunch | But the binary in .nimble is a shim I think |
16:48:58 | PMunch | It just runs another program |
16:50:53 | PMunch | If you run `strace ~/.nimble/bin/nimble --version 2>&1 | grep nimble` you should see the actual location of nimble |
16:51:36 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3MNt |
16:51:40 | FromDiscord | <Patitotective> (edit) |
16:52:07 | FromDiscord | <Patitotective> I already downloaded nim repo again, should I remove my current installation and run `install.sh`? |
16:53:11 | PMunch | Huh, that was actually the right nimble |
16:53:22 | PMunch | Yeah I guess that's the best way of doing it |
16:53:31 | PMunch | Which repo did you download though? |
16:53:42 | PMunch | You probably want to grab the latest stable version |
16:54:08 | FromDiscord | <Patitotective> sent a long message, see http://ix.io/3MNy |
16:54:12 | FromDiscord | <Patitotective> wait |
16:54:19 | FromDiscord | <Patitotective> quite a long url |
16:54:53 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3MNz |
16:55:21 | PMunch | Nah, that will run the same script that errored out for you |
16:55:41 | FromDiscord | <Patitotective> Then manually? |
16:55:50 | PMunch | Grab the one from here: https://github.com/nim-lang/Nim/releases/tag/v1.6.2 |
16:56:46 | PMunch | You should be able to just run the `build_all.sh` script from there |
16:56:58 | PMunch | And then go grab a cup of tea or something, might take a while |
16:57:08 | FromDiscord | <Patitotective> Without removing the actual installation? |
16:57:17 | PMunch | Well you should remove the current one first |
16:57:22 | FromDiscord | <Patitotective> how? |
16:57:54 | PMunch | To be honest I'm not entirely sure how those files ended up where you have them |
16:58:15 | PMunch | Did you run some script to install Nim? |
16:59:01 | FromDiscord | <Patitotective> `install.sh` |
16:59:13 | FromDiscord | <Patitotective> let me see if `uninstall.sh` is in the trash lol |
17:00:05 | FromDiscord | <Patitotective> oh, it is called `deinstall.sh` |
17:00:50 | PMunch | Right, yeah run that |
17:01:28 | FromDiscord | <Patitotective> done, now im going to install _1.6.2_ and go grab a cup of tea |
17:01:28 | FromDiscord | <Patitotective> ๐ |
17:14:31 | PMunch | Is it safe to have the same `const something {.strdefine.}` in two libraries, one which imports the other? |
17:17:23 | FromDiscord | <kevin> anyone know if there's a good DNS server Nim package? Can only find this https://github.com/rockcavera/nim-ndns which is a client ๐ฆ |
17:17:44 | FromDiscord | <enthus1ast> no not that i'm aware of |
17:17:53 | FromDiscord | <enthus1ast> have worked on one, but got bored |
17:18:53 | PMunch | None that I know of, but I've used Unbound with a Nim-written dynamic library with great success |
17:19:14 | FromDiscord | <enthus1ast> but dns got more complicated these days so maybe good idea to use production ready stuff |
17:19:23 | FromDiscord | <mratsim> In reply to @PMunch "Is it safe to": won't you have ambiguous identifier at call site? |
17:19:56 | FromDiscord | <mratsim> I'm surprised Carrier-Grade NAT didn't break just about everything. |
17:20:12 | PMunch | They're not exported, so the module that imports it shouldn't be able to see that it was already put in a const |
17:24:24 | FromDiscord | <Patitotective> In reply to @Patitotective "done, now im going": It is done with `./build_all.sh`, what do I do now? just add `/usr/nim` to the path? |
17:24:45 | FromDiscord | <enthus1ast> i would use choosenim |
17:25:00 | FromDiscord | <enthus1ast> easy to change between versions |
17:26:25 | FromDiscord | <Patitotective> should I use choosenim? @PMunch or is it going to cause any error? |
17:27:08 | PMunch | @Patitotective, don't run choosenim |
17:27:31 | PMunch | @enthus1ast, his problem is that his CPU is too old, the pre-built versions doesn't have support for it |
17:27:53 | PMunch | @Patitotective, where did you download it? |
17:28:22 | PMunch | Basically you should now have a /bin folder |
17:28:34 | PMunch | And it should contain a working version of nim and nimble |
17:28:36 | FromDiscord | <enthus1ast> ic |
17:29:04 | FromDiscord | <Patitotective> In reply to @PMunch "Basically you should now": do i move that directory to `/usr/bin` |
17:29:08 | PMunch | So if you just add that folder to your PATH (hopefully you didn't do all this in /tmp, but if you did just copy it somewhere else) |
17:29:19 | PMunch | No, don't move it, that's what caused your original issue |
17:29:31 | NimEventer | New thread by Chaemon: Bug of newSeqWith with Slice, see https://forum.nim-lang.org/t/8829 |
17:29:32 | PMunch | You need to add that directory to your PATH variable |
17:29:39 | * | pro joined #nim |
17:29:51 | FromDiscord | <Patitotective> Ok |
17:37:06 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3MNT |
17:37:59 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3MNT" => "https://play.nim-lang.org/#ix=3MNU" |
17:38:25 | FromDiscord | <Patitotective> I added it to `~/.bashrc` |
17:38:42 | FromDiscord | <Patitotective> should i add it to `~/.profile`? |
17:39:01 | PMunch | `source .bashrc` |
17:39:31 | PMunch | If you do `echo $PATH` you should see that it is there |
17:39:44 | PMunch | If not you must run `source` or restart your terminal |
17:44:18 | FromDiscord | <Patitotective> ๐ https://media.discordapp.net/attachments/371759389889003532/933416591411015770/Screenshot_from_2022-01-19_12-44-11.png |
17:45:01 | PMunch | You have dots in the actual folder name, and dashes in the one in your path |
17:45:21 | FromDiscord | <Patitotective> oh |
17:46:03 | FromDiscord | <Patitotective> Thaaanks ๐ |
17:46:10 | FromDiscord | <Patitotective> โค๏ธ |
17:46:23 | * | krux02 joined #nim |
17:47:27 | PMunch | No problem :) |
17:48:18 | PMunch | @mratsim, apparently trying to use a `const something* {.strdefine.} = ""` in a `static: echo something` from a module that imports the one where it is defined doesn't work |
17:48:24 | PMunch | Just complains that it is `void` |
17:57:52 | * | jjido joined #nim |
17:59:18 | * | neurocyte0917090 joined #nim |
18:00:23 | * | vicecea quit (Remote host closed the connection) |
18:00:52 | * | vicecea joined #nim |
18:05:39 | NimEventer | New thread by Nycto: Atomics: attempting to call undeclared routine: 'testAndSet', see https://forum.nim-lang.org/t/8830 |
18:06:10 | * | Figworm quit (Quit: Figworm) |
18:13:41 | NimEventer | New thread by Dbaron4: Libmysqlclient.so Not Found, see https://forum.nim-lang.org/t/8831 |
19:03:09 | * | vicfred joined #nim |
19:06:31 | * | Figworm joined #nim |
19:06:54 | * | Figworm quit (Client Quit) |
19:06:57 | * | yassernasc joined #nim |
19:08:29 | FromDiscord | <sigkill> sent a long message, see http://ix.io/3MOo |
19:08:51 | * | Figworm joined #nim |
19:11:56 | NimEventer | New thread by Jayv: Working with tables and strict funcs, see https://forum.nim-lang.org/t/8832 |
19:11:57 | PMunch | Easy fix, use a nimble file |
19:12:25 | PMunch | NimLSP needs to find your project root, it has a couple different ways of doing this, one of which is the nimble file |
19:14:29 | * | rockcavera quit (Remote host closed the connection) |
19:43:27 | * | vicfred quit (Quit: Leaving) |
19:52:59 | * | greaser|q quit (Changing host) |
19:52:59 | * | greaser|q joined #nim |
19:53:02 | * | greaser|q is now known as GreaseMonkey |
20:05:38 | FromDiscord | <Patitotective> In the `runnableExamples` of my library, should I include `import library` or is it obsolete? |
20:06:21 | PMunch | It should import the library it is defined in |
20:16:17 | FromDiscord | <Patitotective> Like |
20:16:19 | FromDiscord | <Patitotective> ? |
20:16:22 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3MOI |
20:19:03 | * | pro quit (Quit: WeeChat 3.4) |
20:21:50 | PMunch | Yes, that should work I believe |
20:29:15 | * | yassernasc quit (Remote host closed the connection) |
21:06:00 | * | rockcavera joined #nim |
21:06:00 | * | rockcavera quit (Changing host) |
21:06:00 | * | rockcavera joined #nim |
21:08:31 | * | Gustavo6046 joined #nim |
21:12:23 | * | vicfred joined #nim |
21:43:35 | * | PMunch quit (Quit: leaving) |
21:43:37 | arkanoid | Is there a good example of C++ OOP wrapping in nim that works with arc? |
21:45:27 | arkanoid | me and the author of nimqml are trying to figure out a solution to port code to arc. The current design works with refc but doesn't work with arc without breaking backward compatibility |
22:21:59 | FromDiscord | <ynfle> Can `staticRead` be given relative paths |
22:22:01 | FromDiscord | <ynfle> (edit) "paths" => "paths?" |
22:25:43 | FromDiscord | <exelotl> yeah, relative to the file in which the staticRead occurs |
22:33:33 | FromDiscord | <ynfle> In reply to @exelotl "yeah, relative to the": Does it also respecte `~` for home dir? |
22:34:11 | FromDiscord | <exelotl> nope, that's a feature of the shell |
22:34:49 | FromDiscord | <ynfle> In reply to @exelotl "nope, that's a feature": Is there a way to simulate that? |
22:35:31 | FromDiscord | <exelotl> maybe you could do `staticRead(getEnv("HOME") & "/path/to/my_file.txt")` |
22:36:00 | FromDiscord | <exelotl> but that will only work if `getEnv` from the `os` module is allowed to be used at compile-time |
22:38:37 | FromDiscord | <exelotl> also it's not exactly a cross-platform solution, for example on windows it would be `getEnv("HOMEDRIVE") & getEnv("HOMEPATH")` |
22:38:53 | FromDiscord | <exelotl> I think |
22:41:07 | FromDiscord | <congusbongus> `getenv("AppData")` in windows |
22:43:04 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzโฆ) |
23:01:30 | * | jjido joined #nim |
23:02:07 | arkanoid | what really is an empty object? https://play.nim-lang.org/#ix=3MPV ? |
23:02:17 | arkanoid | what's inside that byte? |
23:03:41 | FromDiscord | <IsaacPaul> maybe `expandTilde` works ๐คทโโ๏ธ |
23:04:24 | FromDiscord | <Elegantbeef> I think it's just a case of "that's the min size of any object" |
23:04:48 | * | jjido quit (Client Quit) |
23:04:52 | FromDiscord | <Elegantbeef> `dump cast[ptr byte](td.unsafeAddr)[]` will return `0` which makes sense |
23:10:40 | FromDiscord | <Elegantbeef> If you're after a 0 sized type `void` |
23:12:48 | arkanoid | null pointer is pointing to non null data? |
23:13:13 | arkanoid | I mean, I'm reading the first byte of that min object on stack as int |
23:13:57 | FromDiscord | <Elegantbeef> Eh there might be compiler issues to why that doesnt work |
23:14:25 | FromDiscord | <Elegantbeef> You should be doing `cast[byte]` eitherway |
23:14:31 | FromDiscord | <Elegantbeef> and it's still `0` |
23:15:10 | FromDiscord | <Elegantbeef> There is 0 reason to use an empty object in Nim so this is like the most edge casey odd bug |
23:18:30 | FromDiscord | <Elegantbeef> Atleast i dont think there is, could be wrong |
23:23:16 | arkanoid | sure, I'm dealing with metaphysics |
23:23:53 | arkanoid | you're right, if I cast to byte I get zero |
23:24:03 | arkanoid | curios why I'm getting weird int |
23:24:16 | FromDiscord | <Elegantbeef> Cause you're reading memory after the byte |
23:25:58 | FromDiscord | <Elegantbeef> Atleast I think |
23:26:16 | FromDiscord | <Elegantbeef> That metaphysics statement was a joke right? ๐ |
23:26:45 | arkanoid | sure it is |
23:26:51 | arkanoid | it it possible to deal with it anyway? |
23:27:20 | arkanoid | damn, int is 8 bytes |
23:27:28 | arkanoid | I need a coffee |
23:27:33 | FromDiscord | <Elegantbeef> Totally you pretend it doesnt exist and supress thought of it |
23:27:37 | FromDiscord | <Elegantbeef> Int is 8 bytes |
23:27:50 | arkanoid | yeah, was doing silly mistake |
23:27:53 | arkanoid | not it makes esne |
23:27:55 | arkanoid | sense |
23:29:09 | * | Gustavo6046 quit (Remote host closed the connection) |
23:39:32 | * | Gustavo6046 joined #nim |
23:57:53 | nrds | <Prestige99> @Elegantbeef finally getting around to concepts. Is there a way to create a concept that I could "apply" to multiple types? I need to find some documentation on this.. |
23:58:11 | FromDiscord | <Elegantbeef> elaborate on "apply" |
23:58:35 | nrds | <Prestige99> like I want multiple types to have a function named getBounds that returns a Rectangle |
23:58:57 | nrds | <Prestige99> and I want to be able to refer to this concept in a file that takes an object that has getBounds |
23:59:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3MQh |
23:59:27 | FromDiscord | <Elegantbeef> Then your proc would be `proc doThing(b: BoundObject)` |
23:59:44 | nrds | <Prestige99> So say I want a new Foo type that is also a BoundObject? |