| 00:00:57 | FromDiscord | <Beans.> Thanks for the help! |
| 00:30:37 | FromDiscord | <impbox [ftsf]> hmm does strscans handle unicode? |
| 00:30:55 | FromDiscord | <Elegantbeef> Kinda |
| 00:31:07 | FromDiscord | <Elegantbeef> If your pattern has unicode it'll work, but it's not unicode awatre |
| 00:31:14 | FromDiscord | <impbox [ftsf]> nods gotcha |
| 00:31:21 | FromDiscord | <impbox [ftsf]> probably not very safe then |
| 00:31:35 | FromDiscord | <Elegantbeef> The only unicode aware module is the `unicode` ones |
| 00:56:06 | * | arkurious quit (Quit: Leaving) |
| 00:58:10 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
| 01:00:56 | * | Gustavo6046 joined #nim |
| 01:28:28 | * | neurocyte0 joined #nim |
| 01:31:06 | * | neurocyte quit (Ping timeout: 268 seconds) |
| 01:31:06 | * | neurocyte0 is now known as neurocyte |
| 01:44:39 | * | pch_ joined #nim |
| 01:46:17 | arfy | hi. why am I getting the error "cannot evaluate at compile time in the following code snippet? |
| 01:46:24 | arfy | case key.ord |
| 01:46:24 | arfy | of -1: sleep(100) |
| 01:46:24 | arfy | of '1'.ord .. len(devices) + 49: |
| 01:46:58 | arfy | can the case statement not evaulate the lenth of a sequence at compile-time? |
| 01:47:02 | arfy | evaluate |
| 01:47:11 | FromDiscord | <Elegantbeef> well`len(devices)` isnt a constant |
| 01:47:25 | * | pch quit (Ping timeout: 252 seconds) |
| 01:47:36 | arfy | that's what I thought |
| 01:58:19 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3z6y |
| 02:01:00 | FromDiscord | <impbox [ftsf]> ahh file already existed in /tmp/ but owned by another user |
| 02:08:05 | nrds | <Prestige99> Hey impbox, do you use sdl2_nim keycode.nim's key constants? |
| 02:08:12 | FromDiscord | <impbox [ftsf]> yep |
| 02:08:46 | nrds | <Prestige99> I'm attempting to expose `keycode.nim` by exporting it, but get an error about scancode.nim's contants not existing |
| 02:08:50 | nrds | <Prestige99> Familiar with the issue? |
| 02:08:59 | FromDiscord | <impbox [ftsf]> what's the error? |
| 02:09:19 | nrds | <Prestige99> https://github.com/Vladar4/sdl2_nim/blob/master/sdl2_nim/private/keycode.nim#L119 SCANCODE_CAPSLOCK doesn't exist |
| 02:09:28 | nrds | <Prestige99> all SCANCODE_* isn't known |
| 02:10:16 | FromDiscord | <impbox [ftsf]> https://github.com/Vladar4/sdl2_nim/blob/master/sdl2_nim/private/scancode.nim guess you'll need to include this also |
| 02:10:16 | nrds | <Prestige99> Tried exporting keycode and scancode, same issue.. maybe I should just export sdl |
| 02:11:05 | FromDiscord | <impbox [ftsf]> how are you importing them? |
| 02:11:24 | nrds | <Prestige99> sdl2_nim/private/[scancode, keycode] then export scancode, keycode |
| 02:11:35 | FromDiscord | <impbox [ftsf]> yeah import from sdl2_nim not private |
| 02:12:19 | FromDiscord | <impbox [ftsf]> `from sdl2_nim import Scancode, Keycode` |
| 02:12:28 | FromDiscord | <impbox [ftsf]> `export Scancode, Keycode` |
| 02:12:36 | FromDiscord | <impbox [ftsf]> (i think should work) |
| 02:13:11 | nrds | <Prestige99> ah that works, thanks :) |
| 02:57:11 | nrds | <Prestige99> Is there a way to warn about invoking procs without exception handling? Like in the whole project. Been browsing the manual but haven't seen a mention of it |
| 02:58:34 | FromDiscord | <leorize> there's a way to enforce handling, but no warnings mode |
| 02:58:58 | FromDiscord | <leorize> `{. push: raises: [] .}` on top of your module |
| 03:00:56 | nrds | <Prestige99> Hm okay |
| 03:01:30 | * | Gustavo6046 quit (Remote host closed the connection) |
| 03:01:44 | * | Gustavo6046 joined #nim |
| 03:03:54 | nrds | <Prestige99> That's too bad actually, would be a great feature to have |
| 03:16:27 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
| 03:16:48 | * | Gustavo6046 joined #nim |
| 03:59:56 | FromDiscord | <Rika> Well it is there, it’s just gonna error out instead of warn |
| 04:06:01 | * | supakeen quit (Quit: WeeChat 3.2.1) |
| 04:06:30 | * | supakeen joined #nim |
| 04:24:13 | arfy | hi. is it possible to compile a project as a universal binary on mac OS? |
| 04:28:39 | FromDiscord | <Rika> I remember someone in the forum asking that, maybe search? |
| 04:29:13 | FromDiscord | <Rika> I don’t have the link on hand and I can’t get it |
| 04:29:19 | arfy | yeah, still getting used to the mac toolchain, more used to linux. mac odesn't have ldd! like really? |
| 04:30:09 | FromDiscord | <Rika> That’s strange |
| 04:37:52 | * | ecs quit (Remote host closed the connection) |
| 04:39:08 | nrds | <Prestige99> Hm for OOP, is there an easy way to deal with overriding or casting the constructor of the super type? |
| 04:40:19 | nrds | <Prestige99> e.g. Bar is a ref object of Foo, and I want to override a method. But in order to do this I need to create a new Bar, but don't want to basically copy and paste foo's "constructor" proc |
| 04:40:33 | FromDiscord | <Elegantbeef> https://nimdocs.com/beef331/oopsie/oopsie.html |
| 04:40:42 | FromDiscord | <Elegantbeef> `copy`/`copyas` |
| 04:41:31 | nrds | <Prestige99> ah yes that's exactly it |
| 04:41:58 | FromDiscord | <Elegantbeef> Guess i should have an inline `copy` |
| 04:42:20 | FromDiscord | <Elegantbeef> https://github.com/beef331/oopsie for the repo 😛 |
| 04:42:23 | nrds | <R2D299> itHub: 7"Nim oop helper module" |
| 04:42:55 | nrds | <Prestige99> oop really needs some love in Nim |
| 04:44:39 | nrds | <Prestige99> This only seems to copy the fields, hm.. I sort of need to slap the code into this constructor like a template, I think |
| 04:45:19 | FromDiscord | <Elegantbeef> Call the parent constructor then copy fields to this element |
| 04:45:30 | FromDiscord | <leorize> a pattern that might be useful is to write `initT(var T)` procs |
| 04:45:49 | FromDiscord | <leorize> then child types can call `initParent(result[])` |
| 04:46:09 | nrds | <Prestige99> Any examples? |
| 04:46:30 | nrds | <Prestige99> Oh I see what you mean |
| 04:51:15 | * | ecs joined #nim |
| 04:54:53 | nrds | <Prestige99> So it still complains that result is of the subtype, maybe missing something here |
| 04:55:34 | FromDiscord | <impbox [ftsf]> `initParent(result.Parent)` |
| 04:55:59 | nrds | <Prestige99> ohhh nice, thanks |
| 06:36:27 | * | pch_ is now known as pch |
| 07:01:49 | * | tdc joined #nim |
| 07:07:37 | nrds | <Prestige99> Running into an error, game is crashing but there's like 0 helpful info. Any way to output more useful info? https://play.nim-lang.org/#ix=3z7o |
| 07:08:10 | nrds | <Prestige99> Maybe it's something happening with a c lib, so it can't provide much? |
| 07:09:10 | FromDiscord | <Elegantbeef> Most likely |
| 07:20:19 | * | PMunch joined #nim |
| 07:22:50 | * | pch quit (Remote host closed the connection) |
| 07:23:31 | * | pch joined #nim |
| 07:47:32 | * | max22- joined #nim |
| 07:49:55 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
| 07:50:24 | * | Gustavo6046 joined #nim |
| 07:52:13 | FromDiscord | <impbox [ftsf]> error this should be golf |
| 07:52:47 | FromDiscord | <impbox [ftsf]> prestige, compile with `-d:debug`? |
| 07:53:01 | FromDiscord | <impbox [ftsf]> run it not via nimble, will remove the excess debugging |
| 07:53:09 | FromDiscord | <impbox [ftsf]> (edit) "run it not via nimble, will remove the excess ... debugging" added "nimscript" |
| 07:57:36 | FromDiscord | <Rika> what? |
| 07:57:41 | FromDiscord | <Rika> golf? |
| 08:19:27 | FromDiscord | <impbox [ftsf]> `Error: execution of an external program failed: '/home/avahe/programming/nim/notgolf/bin/notgolf '` |
| 08:56:25 | PMunch | Damn it, why can't Nim import a module only for compile-time use.. |
| 08:57:12 | PMunch | I use the `os` module in my macro, but trying to call that macro from a project with --os:any fails because the OS module isn't supported.. |
| 08:59:47 | FromDiscord | <Rika> Huh good ping |
| 08:59:50 | FromDiscord | <Rika> Point |
| 09:00:02 | PMunch | And is there a staticExec that doesn't include stderr? |
| 09:01:11 | FromDiscord | <haxscramper> no |
| 09:01:17 | FromDiscord | <haxscramper> gorge also squashes everything |
| 09:01:30 | FromDiscord | <haxscramper> there is no way to execute something on compile-time and get stderr and stdout separately |
| 09:01:40 | PMunch | -_- |
| 09:01:41 | FromDiscord | <Elegantbeef> gorge is an alias for staticExec |
| 09:02:26 | FromDiscord | <haxscramper> You are working on the wrapper generator |
| 09:02:30 | FromDiscord | <haxscramper> you need this for wrapper generator\ |
| 09:02:31 | FromDiscord | <haxscramper> ? |
| 09:02:36 | PMunch | Yup |
| 09:02:40 | PMunch | Well, need is a strong word |
| 09:02:50 | FromDiscord | <haxscramper> Doing some C codegen in the nimcache dir |
| 09:02:51 | FromDiscord | <Elegantbeef> does `when defined(nimVm)` not work for the compile time import? |
| 09:03:00 | FromDiscord | <Rika> Is there a reason gorge combines the out and err |
| 09:03:09 | FromDiscord | <Rika> ignore the extra “the” |
| 09:03:19 | FromDiscord | <fae> i dont understand this https://play.nim-lang.org/#ix=3z7O |
| 09:03:21 | FromDiscord | <haxscramper> because someone wrote it this way |
| 09:03:26 | FromDiscord | <haxscramper> it mease ZERO sense to me |
| 09:03:31 | FromDiscord | <haxscramper> makes\ |
| 09:03:37 | FromDiscord | <haxscramper> FFS who even thought about it |
| 09:03:44 | PMunch | Basically I have created a nice program that outputs a JSON definition of the C I give it. then I parse that JSON in Nim and generate Nim code |
| 09:03:55 | PMunch | But the program will also output warnings on stderr.. |
| 09:04:34 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/blob/version-1-4/compiler/gorgeimpl.nim#L25 |
| 09:05:15 | FromDiscord | <Rika> In reply to @PMunch "But the program will": Maybe put a silent flag I don’t know |
| 09:06:04 | PMunch | @fae, openArray[untyped] isn't available as an openArray on compile-time, it's a NimNode that will represent an openArray[untyped] on runtime |
| 09:06:19 | FromDiscord | <Elegantbeef> Eh the issue is the generated code |
| 09:06:35 | FromDiscord | <Elegantbeef> I mean yea use varargs or similar |
| 09:06:52 | FromDiscord | <Elegantbeef> but the emitted code is doing `for x in []` |
| 09:07:09 | FromDiscord | <Elegantbeef> Which is a compiler error https://play.nim-lang.org/#ix=3z7Q |
| 09:07:29 | FromDiscord | <Elegantbeef> Though it errors in a different spot |
| 09:08:08 | FromDiscord | <Elegantbeef> x in that for loop doesnt have a type which is why it says `empty` |
| 09:08:58 | FromDiscord | <Elegantbeef> Also why the compiler errors at cgen |
| 09:09:56 | FromDiscord | <fae> is there a way to retain the type information of it being a `seq[Hash]` |
| 09:10:15 | FromDiscord | <Elegantbeef> `newLit(hashes)` should work |
| 09:10:35 | FromDiscord | <fae> also, i feel like what I am currently trying to do would be a lot simpler if I could just create an `array[typedesc]` heh |
| 09:10:52 | FromDiscord | <Elegantbeef> `varargs[untyped` |
| 09:10:53 | FromDiscord | <Elegantbeef> `varargs[untyped]` |
| 09:10:54 | PMunch | @ElegantBeef, I can do `when defined(nimVM)` but then my macro doesn't see the module as imported.. |
| 09:11:01 | FromDiscord | <Elegantbeef> or `tuple` |
| 09:11:37 | FromDiscord | <Elegantbeef> actually `varargs[typedesc]` |
| 09:12:38 | FromDiscord | <fae> was hoping to be able to pass in multiple lists |
| 09:13:07 | FromDiscord | <Elegantbeef> Then keep the openarray |
| 09:13:10 | * | Vladar joined #nim |
| 09:13:16 | FromDiscord | <Elegantbeef> The issue isnt the open array https://play.nim-lang.org/#ix=3z7T |
| 09:13:32 | FromDiscord | <Elegantbeef> The issue was that you were writting `for x in []` |
| 09:14:29 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3z7U for example |
| 09:15:20 | FromDiscord | <fae> currently inspecting expand macros of this newlit example, thanks |
| 09:15:45 | FromDiscord | <Elegantbeef> It just emits the code it'd require to manually make it |
| 09:16:13 | FromDiscord | <Elegantbeef> You can encode it into an array if you wanted aswell, though for empties you'd need to do something special |
| 09:17:08 | FromDiscord | <fae> it still fails with an empty array https://play.nim-lang.org/#ix=3z7V |
| 09:21:16 | FromDiscord | <Elegantbeef> The hell it was just working \:D |
| 09:21:47 | FromDiscord | <Elegantbeef> Ah was the `typedesc` |
| 09:22:20 | FromDiscord | <fae> sent a code paste, see https://play.nim-lang.org/#ix=3z81 |
| 09:22:30 | FromDiscord | <fae> and just hash at runtime |
| 09:22:35 | FromDiscord | <fae> but i really dont want to use rtti |
| 09:22:41 | FromDiscord | <fae> or the typeinfo module |
| 09:22:53 | FromDiscord | <Elegantbeef> Well this does work https://play.nim-lang.org/#ix=3z82 |
| 09:23:17 | FromDiscord | <fae> sweet |
| 09:23:21 | FromDiscord | <fae> tyty |
| 09:23:29 | FromDiscord | <fae> time to go fumble around some more lol |
| 09:23:50 | FromDiscord | <Archion> Hoi |
| 09:24:13 | FromDiscord | <Elegantbeef> Hello |
| 09:25:00 | FromDiscord | <Archion> A |
| 09:25:15 | FromDiscord | <Archion> Why bot? |
| 09:25:20 | FromDiscord | <Elegantbeef> There are 25 other letters you can put together and make a sentence |
| 09:25:27 | FromDiscord | <Elegantbeef> Cause i'm a scary man on matrix |
| 09:26:01 | FromDiscord | <Archion> O_o |
| 09:26:10 | FromDiscord | <Archion> For me its more than 25 |
| 09:26:38 | FromDiscord | <Archion> There are á é í ó etc.. |
| 09:29:10 | FromDiscord | <haxscramper> Why people are so confused by bridges |
| 09:29:30 | FromDiscord | <Elegantbeef> No the bridge is heavily defended |
| 09:30:08 | FromDiscord | <Elegantbeef> Stargate reference aside it's cause they see `bot` and it's intelligent(well not with me speaking, but you get the point) |
| 09:34:14 | FromDiscord | <fae> If I join irc will I suddenly understand macros |
| 09:34:50 | FromDiscord | <fae> I feel that’s the next logical step |
| 09:34:55 | FromDiscord | <Elegantbeef> Nah you have to make a PR to fix a bug atleast 5 times before this happens |
| 09:35:24 | FromDiscord | <fae> I’ll get right on it 😅 |
| 09:36:32 | FromDiscord | <Elegantbeef> Good luck |
| 09:36:38 | FromDiscord | <Elegantbeef> I need sleep so i'm outta here |
| 09:37:39 | FromDiscord | <fae> Night |
| 09:53:16 | arfy | hi all |
| 09:53:33 | * | neurocyte quit (Quit: The Lounge - https://thelounge.chat) |
| 09:58:53 | * | neurocyte0 joined #nim |
| 09:58:53 | * | neurocyte0 quit (Changing host) |
| 09:58:53 | * | neurocyte0 joined #nim |
| 10:02:48 | * | arkanoid quit (Quit: WeeChat 2.8) |
| 10:05:22 | FromDiscord | <SuperHelios> sent a long message, see http://ix.io/3z8i |
| 10:06:52 | FromDiscord | <dom96> Pretty sure it's @Archion asking "why bot" all the time |
| 10:06:58 | FromDiscord | <Archion> Yes |
| 10:07:13 | FromDiscord | <dom96> It's the only way to relay messages between Matrix and Discord (as well as other non-Discord chats) |
| 10:07:58 | FromDiscord | <Archion> And how to use nim? |
| 10:18:00 | FromDiscord | <haxscramper> If you use `fmt""` it is treated as generalized string literal↵(@SuperHelios) |
| 10:18:06 | FromDiscord | <haxscramper> It says so in the documentation for strformat |
| 10:18:14 | FromDiscord | <haxscramper> And so everything is parsed literally |
| 10:18:37 | FromDiscord | <haxscramper> If you need to use escaped string you can use `&"some text\""` |
| 10:20:04 | FromDiscord | <SuperHelios> In reply to @haxscramper "If you use `fmt""`": so is it expected to print a single double quote when 2 of them are used? |
| 10:44:08 | FromDiscord | <haxscramper> yes |
| 10:44:33 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#lexical-analysis-raw-string-literals |
| 10:44:39 | FromDiscord | <haxscramper> > ↵> To produce a single " within a raw string literal, it has to be doubled\:↵> |
| 11:49:58 | NimEventer | New thread by QMaster: Might be a bug in compiler, see https://forum.nim-lang.org/t/8435 |
| 11:53:08 | FromDiscord | <Rika> i dont know what the hell the code in their snippet does lmfao |
| 11:55:21 | FromDiscord | <Rika> i doubt the bug is in generics, its just the (imo) crazy usage of inheritance |
| 12:02:58 | * | max22- quit (Ping timeout: 268 seconds) |
| 12:03:03 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3z8U |
| 12:03:11 | FromDiscord | <haxscramper> With ` ConnectionStrBool = distinct bool` |
| 12:03:30 | FromDiscord | <haxscramper> Sounds like something weird is going on |
| 12:04:01 | FromDiscord | <Rika> i still feel like it has something to do with the inheritance |
| 12:04:08 | FromDiscord | <Rika> but those shouldnt match each other yeah |
| 12:04:43 | FromDiscord | <haxscramper> ah |
| 12:04:43 | FromDiscord | <haxscramper> he is an idiot yes |
| 12:05:10 | FromDiscord | <haxscramper> well, who could've guessed that he can't debug this pile of execute overloads themselves |
| 12:06:02 | * | supakeen quit (Quit: WeeChat 3.2.1) |
| 12:06:32 | * | supakeen joined #nim |
| 12:07:26 | FromDiscord | <Rika> kinda harsh but okay |
| 12:08:12 | FromDiscord | <haxscramper> well, I minimized the core for them at least |
| 12:08:27 | FromDiscord | <haxscramper> so it kind of cancels out |
| 12:08:49 | FromDiscord | <haxscramper> Just not a big fan of these zero-effort "dump whole code tell me what is wrong" questions |
| 12:09:28 | FromDiscord | <Rika> i mean yeah low effort |
| 12:11:38 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3z8Y |
| 12:11:42 | FromDiscord | <haxscramper> Swapping last two object declarations |
| 12:12:32 | FromDiscord | <Rika> thats funky |
| 12:14:32 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3z90 |
| 12:14:36 | FromDiscord | <haxscramper> Also fails |
| 12:15:13 | FromDiscord | <haxscramper> leorize had something similar not too long ago |
| 12:19:11 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=3z92 |
| 12:19:24 | FromDiscord | <Goel> (edit) "https://play.nim-lang.org/#ix=3z92" => "https://play.nim-lang.org/#ix=3z93" |
| 12:20:00 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3z94 |
| 12:20:07 | FromDiscord | <Goel> In a single line |
| 12:20:46 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3z95 |
| 12:20:52 | FromDiscord | <Goel> Oh i need one tab, ok thanks |
| 12:21:04 | FromDiscord | <haxscramper> s/one tab/two spaces/ |
| 12:36:55 | * | PMunch quit (Quit: Leaving) |
| 12:40:20 | * | arkurious joined #nim |
| 12:53:42 | * | max22- joined #nim |
| 13:52:49 | * | pro joined #nim |
| 13:58:29 | * | tdc quit (Quit: Leaving) |
| 14:51:16 | FromDiscord | <Gumber> Does anyone in here work on or maintain NimGL by any chance? |
| 15:20:22 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
| 15:33:39 | FromDiscord | <@hjarausch_gitlab-5fa43a7bd73408> sent a code paste, see https://play.nim-lang.org/#ix=3zaD |
| 15:34:43 | * | Gustavo6046 joined #nim |
| 15:39:30 | FromDiscord | <Rika> jesus someone swap the bridge... |
| 15:39:35 | FromDiscord | <Rika> i cant read this |
| 15:42:01 | FromDiscord | <Rika> well i cant help since the example works (as you said) |
| 15:42:08 | FromDiscord | <Rika> that means you removed the offender... |
| 15:42:55 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
| 15:47:49 | * | Gustavo6046 joined #nim |
| 16:03:55 | * | stkrdknmibalz quit (Ping timeout: 252 seconds) |
| 16:09:28 | FromDiscord | <dom96> In reply to @Rika "jesus someone swap the": yeah, might be time to ask to get FromGitter back nicely |
| 16:09:40 | FromDiscord | <dom96> annoying thing is that Gitter automatically bridged itself to our Matrix channel... |
| 16:09:47 | FromDiscord | <dom96> so we'd have to unlink that |
| 16:10:09 | FromDiscord | <dom96> I don't have time for this kind of bureaucracy |
| 17:08:14 | FromDiscord | <fae> Trying to understand this better, I think I'm missing something subtle about how `result` works |
| 17:08:16 | FromDiscord | <fae> https://play.nim-lang.org/#ix=3zb5 |
| 17:10:28 | FromDiscord | <Rika> entity is a ref, refs are nil by default |
| 17:10:55 | FromDiscord | <Rika> need to do `new result` before to initialise |
| 17:11:12 | FromDiscord | <fae> ahh |
| 17:11:17 | FromDiscord | <Rika> in spawn2 `result = Entity()` implicitly makes new |
| 17:11:37 | FromDiscord | <juan_carlos> `new result` because is `ref`. |
| 17:11:40 | FromDiscord | <Rika> yes |
| 17:12:13 | FromDiscord | <fae> tyty |
| 17:12:25 | FromDiscord | <juan_carlos> yw |
| 17:21:16 | FromDiscord | <Rika> 👌 |
| 17:30:25 | * | pro left #nim (WeeChat 3.2) |
| 17:30:28 | * | pro joined #nim |
| 17:37:21 | * | vicfred joined #nim |
| 17:51:25 | * | max22- quit (Ping timeout: 260 seconds) |
| 18:12:39 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=3zbn |
| 18:13:10 | FromDiscord | <Goel> (edit) "https://play.nim-lang.org/#ix=3zbn" => "https://play.nim-lang.org/#ix=3zbo" |
| 18:16:06 | FromDiscord | <Rika> What do you mean? |
| 18:16:13 | FromDiscord | <Rika> Like the first byte aka the header? |
| 18:16:26 | FromDiscord | <Rika> Or do you mean the first pixel of the PNG? |
| 18:16:27 | * | pro quit (Ping timeout: 265 seconds) |
| 18:17:16 | FromDiscord | <Goel> The content of `encoded` so as it says it should contain the raw bytes, in this case the first raw byte. What i don't understand is the "`string/Seq[T]` |
| 18:17:24 | FromDiscord | <Goel> (edit) "content" => "contents" |
| 18:17:25 | FromDiscord | <Yardanico> In reply to @Goel "How can i read": wait why are you encoding png after loading it? |
| 18:17:29 | FromDiscord | <Rika> Yeah |
| 18:17:51 | FromDiscord | <Yardanico> loadPNG32 already gives you a PNG |
| 18:17:55 | FromDiscord | <Rika> The pixel is in “png.data” the first entry (“[0]”) |
| 18:18:21 | FromDiscord | <Rika> Though |
| 18:18:46 | FromDiscord | <Rika> There are two pixels if the PNG is 4bpp and so on |
| 18:18:51 | FromDiscord | <Goel> for example i wanted to do like `echo encoded[0]` to read the first raw byte |
| 18:19:01 | FromDiscord | <Rika> Raw byte?? |
| 18:19:03 | FromDiscord | <Rika> As in the header |
| 18:19:08 | FromDiscord | <Rika> Like the png header |
| 18:19:14 | FromDiscord | <Rika> Why? |
| 18:19:26 | FromDiscord | <Yardanico> In reply to @Goel "for example i wanted": if you just want to read the first byte, then you don't have to load it as PNG |
| 18:19:29 | FromDiscord | <Yardanico> just read the first byte of the file |
| 18:26:10 | * | crem quit (Ping timeout: 260 seconds) |
| 18:26:27 | * | crem joined #nim |
| 18:27:49 | FromDiscord | <Goel> Ok done thanks, and now if i get it right (probably not) if i read data from `echo repr png.data[0]` this should be the first byte? |
| 18:30:47 | * | nrds quit (Remote host closed the connection) |
| 18:33:00 | * | nrds joined #nim |
| 18:35:23 | FromDiscord | <Rika> Of the image itself |
| 18:40:20 | FromDiscord | <Goel> I'm not doing it right, reading all data from png.data gives me all `char = 255` |
| 18:49:42 | FromDiscord | <Rika> Is your image white |
| 19:12:02 | FromDiscord | <Goel> Nope, its not |
| 19:12:31 | FromDiscord | <Smarc> Is there a way to play .ogg files in nim? The ogg nimble package gives me a 404 |
| 19:12:53 | * | stkrdknmibalz joined #nim |
| 19:23:12 | FromDiscord | <Alea> do you always have to do Vector2(x: num, y: num)? |
| 19:23:23 | FromDiscord | <Alea> I'd love to do without the x y labels |
| 19:24:02 | nrds | <Prestige99> Usually would make something like proc initVector2(x: int, y: int): Vector2 = ... |
| 19:24:20 | nrds | <Prestige99> Then you could let v = initVector2(3, 56) |
| 19:28:30 | FromDiscord | <Alea> A good point |
| 19:29:40 | * | crem quit (Ping timeout: 240 seconds) |
| 19:33:12 | FromDiscord | <Goel> v: Vector2 (0.0, 0.0)↵you don't neet do put the labels |
| 19:33:22 | FromDiscord | <Goel> (edit) "v: Vector2 ... (0.0," added "=" |
| 19:51:59 | * | crem joined #nim |
| 19:54:25 | FromDiscord | <Varriount> Zevv: Out of curiosity, what is it about Nim's AST that you find makes it hard to work with? |
| 19:55:00 | FromDiscord | <Varriount> Especially versus a more specific AST? |
| 20:20:47 | FromDiscord | <Rika> In reply to @Goel "v: Vector2 = (0.0,": Only works on tuples |
| 20:20:59 | arfy | hi. is it possible, and/or recommended to recursively call a function from within a try... except block? As part of the except clause |
| 20:22:15 | FromDiscord | <Rika> You can |
| 20:22:36 | FromDiscord | <Rika> There is a recursion limit of course |
| 20:22:44 | FromDiscord | <Rika> Like in most non functionally oriented languages |
| 20:23:24 | arfy | yay. only want to have one code point in this function to set a flag. Try open specified config file. if cannot open, try again with defaults. if defaults don't exist, create new ones. |
| 20:27:53 | * | Vladar quit (Quit: Leaving) |
| 20:38:31 | * | supakeen quit (Remote host closed the connection) |
| 20:38:55 | * | supakeen joined #nim |
| 20:43:44 | FromDiscord | <Smarc> Is there a way to play .ogg files in nim? The ogg nimble package gives me a 404 |
| 20:44:25 | * | arfy uses nimbass, but it's not free as in beer. |
| 20:45:22 | FromDiscord | <Smarc> I'd like to play different (small) portions of the .ogg file on different keystrokes, would that be possible (with nimbass)? |
| 20:45:46 | arfy | yes I'm pretty sure nimbass can seek in ogg files. |
| 20:46:17 | arfy | I'm using it myself to essentially, recreate a cart machine. |
| 20:51:49 | FromDiscord | <Smarc> hm, not even the example on the github readme is actually working for me |
| 20:52:05 | arfy | what platform? |
| 20:52:09 | FromDiscord | <Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3zcb |
| 20:52:12 | FromDiscord | <Smarc> throws me several errors like BASS_Init not known |
| 20:52:17 | FromDiscord | <Smarc> Manjaro |
| 20:52:42 | arfy | this is after nimble install nimbass? |
| 20:52:51 | FromDiscord | <Smarc> yes |
| 20:53:38 | arfy | hmmm |
| 20:53:46 | FromDiscord | <Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3zcc |
| 20:53:57 | * | arfy left #nim (Closing Window) |
| 20:54:07 | * | arfy joined #nim |
| 20:54:36 | FromDiscord | <Elegantbeef> You need two pointers |
| 20:54:48 | FromDiscord | <Elegantbeef> the last two parameters are pointers you're passing `Dword, nil` |
| 20:54:54 | arfy | ah. |
| 20:55:08 | arfy | easy. change the forth argument to nil. |
| 20:55:09 | FromDiscord | <Elegantbeef> Also those casts probably are useless |
| 20:55:17 | FromDiscord | <Elegantbeef> You can just do `Dword(44100)` |
| 20:55:24 | arfy | that format in the example works on windows |
| 20:55:27 | FromDiscord | <Smarc> I actually just c&p the readme example :) |
| 20:55:30 | FromDiscord | <Smarc> ah |
| 20:55:32 | arfy | I have to do the same thing on mac. |
| 20:56:05 | arfy | I don't even bother with the dword. I just use 44100. |
| 20:56:20 | FromDiscord | <Elegantbeef> Yea it's just an alias it's not a distinct |
| 20:56:23 | FromDiscord | <Elegantbeef> Didnt look at the source before i spoke |
| 20:58:11 | FromDiscord | <Smarc> Those docs are .. huge. So how do I play some simple .ogg file? |
| 21:07:28 | arfy | https://play.nim-lang.org/#ix=3zcj |
| 21:10:56 | FromDiscord | <Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3zck |
| 21:11:24 | FromDiscord | <Elegantbeef> `cint(device)` |
| 21:11:35 | arfy | oops |
| 21:11:40 | FromDiscord | <Elegantbeef> or `cint(-1)` |
| 21:11:43 | arfy | knew i was forgetting something |
| 21:11:47 | FromDiscord | <Elegantbeef> cmon arfy you're ruining people's lives |
| 21:12:21 | arfy | :P |
| 21:12:35 | FromDiscord | <Smarc> compiles, but does not play any sound :P |
| 21:14:23 | arfy | don't forget to change "test.ogg" to something that actually exists. |
| 21:14:35 | arfy | also, maybe -1 didn't work for some reason. try 1 for device. |
| 21:16:03 | FromDiscord | <Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3zcm |
| 21:16:17 | FromDiscord | <Smarc> tried both, 1 and -1, but it does not play anything. the .ogg exists in the same directory |
| 21:16:51 | FromDiscord | <Elegantbeef> Anyone got docs for this library? |
| 21:17:37 | arfy | I have the docs of the original library as a chm file |
| 21:19:10 | arfy | try outputting the result of BASS_ErrorGetCode after the call to BASS_Init |
| 21:21:29 | * | xet7 quit (Remote host closed the connection) |
| 21:22:32 | * | xet7 joined #nim |
| 21:23:03 | FromDiscord | <Smarc> outputs 46 |
| 21:23:33 | FromDiscord | <Smarc> BASS_ERROR_BUSY |
| 21:23:47 | arfy | probably means device is in use |
| 21:24:25 | FromDiscord | <Smarc> okay, I figured what blocked it, now the error code is 0 |
| 21:24:32 | FromDiscord | <Smarc> which means OK, but still no sound |
| 21:24:52 | arfy | buh? yep, now confused == true |
| 21:25:13 | FromDiscord | <Smarc> okay, a sleep(5000) at the end did the trick! |
| 21:25:29 | FromDiscord | <Smarc> thanks you guys for your help |
| 21:25:39 | arfy | oh... oops yeah that would do it. |
| 21:25:49 | arfy | sound starts playing then immediately exits |
| 21:26:31 | arfy | yeah. I really should put a nicer wrapping on this lib. or at least see if authro wants to. |
| 21:26:35 | arfy | author |
| 21:26:39 | FromDiscord | <Smarc> I'll be back later to figure out how to play just a little part of the .ogg on keystroke :P |
| 21:27:07 | arfy | illwill will be helpful here. |
| 21:28:24 | FromDiscord | <Smarc> I'll get back to that, gotta go to bed now :) See you guys soon! |
| 21:32:51 | * | supakeen quit (Remote host closed the connection) |
| 21:33:16 | * | supakeen joined #nim |
| 21:33:50 | arfy | my thoughts on nim's stdlib. I like it. it covers all the esentials, not too small or too big. very much like python. system could be a little more modular though |
| 21:36:42 | FromDiscord | <Elegantbeef> Yea the core devs do want to make system smaller and split it up |
| 21:36:51 | FromDiscord | <Elegantbeef> Like `io` being included in system for instance |
| 21:44:46 | * | ozzz quit (Ping timeout: 265 seconds) |
| 22:03:27 | * | ozzz joined #nim |
| 22:07:08 | * | ozzz quit (Read error: Connection reset by peer) |
| 22:10:15 | * | ozzz joined #nim |
| 22:15:50 | * | ozzz quit (Read error: Connection reset by peer) |
| 22:19:41 | * | ozzz joined #nim |
| 22:25:49 | * | ozzz quit (Read error: Connection reset by peer) |
| 22:29:13 | * | ozzz joined #nim |
| 22:43:08 | * | vicfred quit (Quit: Leaving) |
| 22:48:03 | * | max22- joined #nim |
| 23:13:06 | * | perro quit (Remote host closed the connection) |
| 23:13:10 | * | stkrdknmibalz quit (Ping timeout: 260 seconds) |
| 23:45:53 | NimEventer | New thread by EnteryName: Nim in Action, see https://forum.nim-lang.org/t/8436 |
| 23:58:40 | * | max22- quit (Remote host closed the connection) |