How to prevent nim generate C code access parent type through `Sup` field?

2022-03-16 Thread Dabod
I found that my C code is missing a line... typedef struct { Parent base; int y; } Child; Run

How to debug segmentation fault memory issue??

2022-03-16 Thread Chubak
Good solutions. Thanks.

Memory leak

2022-03-16 Thread WayneCavanaugh
Well, listen to me please! fix the ram

Cant't change the name of main html file in the output of `nim doc`?

2022-03-16 Thread kaushalmodi
In static site generator lingo, it's a better convention to generate `index.html` so that we have "pretty URLs". * Ugly URL: `example.com/foo.html`. The ".html" is needed to be added in the URL. * Pretty URL: `example.com/foo/index.html`. Now that URL can be accessed using `example.com/foo/

How to prevent nim generate C code access parent type through `Sup` field?

2022-03-16 Thread Dabod
I see, thank you for the clarify.

Naylib - yet another raylib wrapper becomes available

2022-03-16 Thread planetis
You're not wrong, but as the doc say: "Note how the set turns enum values into powers of 2." It means that I could write something like this: type Config {.size: sizeof(int32).} = enum Dummy FullscreenMode WindowResizable WindowUndecorated

How to prevent nim generate C code access parent type through `Sup` field?

2022-03-16 Thread PMunch
You can't, because that's how inheritance works in Nim. The C code you have there is not actually a parent child relationship, there is no connection between the Parent and Child structs.

Cant't change the name of main html file in the output of `nim doc`?

2022-03-16 Thread PMunch
It totally depends on the site though. Maybe you want `index.html` to be a "Welcome to this project, check out this video, or maybe the " with that last bit being a link to the actual documentation. In this case it would be super annoying if Nim generated an `index.html` file for you. Naming th

Cant't change the name of main html file in the output of `nim doc`?

2022-03-16 Thread monsoonman
Ah, I see. Thanks for the explanation. Well, IMHO, it is really not about number of keystrokes but default behaviour. One usually expects `index.html` to be present in a website by default, and most web-browsers expects index.html to be the starting point (not sure if this is standard). So, it

How to prevent nim generate C code access parent type through `Sup` field?

2022-03-16 Thread Dabod
{.emit: """ #include typedef struct { int x; } Parent; typedef struct { int y; } Child; Child *child_new() { return malloc(sizeof(Child)); } """.} type Parent {.importc, nodecl, pure, inheritable.} = object x: cint

Cant't change the name of main html file in the output of `nim doc`?

2022-03-16 Thread PMunch
No, I was saying that it would be a poor design by the compiler to output a `index.html` file. Of course if the user specifies that they want to rename a specific module to `index.html` then that could work, but then why not just throw `mv mymodule.html index.html` into your script, surely that'

Cant't change the name of main html file in the output of `nim doc`?

2022-03-16 Thread monsoonman
I misspoke. Even after moving the `data` folder out of the source tree, the main html file remains to be `bmo.html` and not `index.html`. I got confused because `bmo.html` was changed to `index.html` by `nimble` task. I'have updated the previous post.

Cant't change the name of main html file in the output of `nim doc`?

2022-03-16 Thread monsoonman
Thanks @PMuch. You are right. I have the following structure. src/ ├── bmo.nim ├── bmopkg/ │ ├── cli.nim │ ├── command.nim │ ├── common.nim │ ├── install.nim │ └── subcom.nim └── data/ └── install_choco.ps1 Run If I mov

How to debug segmentation fault memory issue??

2022-03-16 Thread PMunch
Doesn't `import sdl except Thread` work for you?

Cant't change the name of main html file in the output of `nim doc`?

2022-03-16 Thread PMunch
I believe this is because if you had two modules in your project it's nice that they're named after the module they come from and not one simply being called `index.html`. Manually moving it (or just moving it from the same script that runs nim), or even just having a symlink from `index.html` t

Suggestion on wrapping C union with anonymous struct?

2022-03-16 Thread PMunch
Isn't the issue here that `parts` isn't exported?

Cant't change the name of main html file in the output of `nim doc`

2022-03-16 Thread monsoonman
I am generating docs of my module `foo` using the following command: nim doc --out:html --project src/foo.nim Run It generates html docs in the directory `out` with `out/foo.html` as the main html file. When I deploy `foo` on github pages, nothing shows up there becaus

Cant't change the name of main html file in the output of `nim doc`?

2022-03-16 Thread monsoonman
I am generating docs of my module `foo` using the following command: nim doc --out:html --project src/foo.nim Run It generates html docs in the directory `out` with `out/foo.html` as the main html file. When I deploy `foo` on github pages, nothing shows up there becaus