Thanks Andreas. Would you consider such a minor change in stdlib as desirable?
Thank you @jlp765, I know about the static, but asking about a different thing:
Is there a way in nim language to use values of S_IFREG and S_IFDIR in the 'of'
clause of the 'case-of' statement? (for example, like in the post above)
Is there a way to make nim compiler to evaluate constants from C-header files
at compile time?
For example, symbols S_IFREG and S_IFDIR (from posix.nim <\- sys/stat.h) used
in following code snippet:
case x:
of S_IFREG: echo "file"
of S_IFDIR: echo "dir"
else:
Goran, thank you very much! Your code perfectly fits with what I needed and
comments immediately answers all the questions running in head. Btw, I was
pleased to read your article "Nim and OO" some time ago and discover another
Smalltalk fan. I myself fell in love with Smalltalk from the first s
The question is not about interfacing with other languages, but exceptionally
about interfacing of Nim modules with each other. The C language allows to hide
internals of a type declaration but still have type checking using just
"half-anonymous" `struct BoxOfStuff *` pointer. I want this functi
Does Nim support C-language feature to declare a reference to an object without
including the external header file where the object is defined?
* * *
For example, what would be Nim analogue for the following C code:
typedef struct BoxOfStuff * pBox;
/* no need to incl
Thank you for the explanation.
Yes, I'm really with you on the idea of enforcing the coding style.
I'm not fully sure yet, but looks like I'm having a case where it would be
better (for the sake of simpler/clearer software design) to distinguish symbols
basing on the filesystem path.
Why there is a restriction "module names need to be unique per Nimble package" ?
Is this restriction of the Nim language or just a temporary inability of the
C-backed ?
I have a question about following Nim compiler/language use case: suppose, I
created a library and want to share it's functionality with others. But, I do
not want to share the source code, but just a binary distribution plus an
interface. This use case can be solved by creating a C-header file
Thank you guys, it helped.
Is it possible at compile time/run time to check if symbol "" is defined?
If it is defined, then is it possible to get know if it is Proc/Variable/etc ?
Thanks Flyx, your solution solves the task, but still unlikely able to generate
(target) tuple of arbitrary size: for example, how would you write code to
convert seq/array which consists out of 100 (or 1000 or 10M elements) ? You
would have to write something like:
var myTuple: t
Is there a native/elegant way to convert seq into tuple?
For example, I'd like to instantiate some variables basing on values stored in
a seq like this:
var s: seq[int] = @[1,2,3]
var (a,b,c) = s
Possible solution would look like this (or even more elegant?):
13 matches
Mail list logo