DEV Community

Discussion on: Wrap const char* in the Nim language

Collapse
 
kaushalmodi profile image
Kaushal Modi

Hello, thanks for sharing this! I was led to this post from this recent question post on const char by me on Nim Forums.

As a follow up, I am some basic questions ..

  1. How can we make this constChar type main stream so that every C wrapper library does not need to define this. Those libraries would also need to export this type and then we will end up with type clashes if a user imports multiple of such libraries.
  2. As the type is a distinct type, we cannot use this type until we define $, [] and may be more low level ops.
  • Do you have a full-fledged library for these const types?
  • Is there a plan to bake this into a nim stdlib?