Thanks
I don't mean to throw tons of code line, so I extract some typical ( at least I
think) function declaration lines, even in C header files they looks the same.
The other lines, which I did not enclose here, can be treated by c2nim or my
newbie's brain.
As for the C header files, actually
You would basically start with
[https://api.github.com/repos/nim-lang/nightlies/releases](https://api.github.com/repos/nim-lang/nightlies/releases).
The following post have detailed explanation of Go interface.
[https://forum.nim-lang.org/t/2422](https://forum.nim-lang.org/t/2422)
Current implementation doesn't support generic, because the vtable must be
build at compile time when impl is called, but with generic, this is not
possible, maybe we need the compiler to do it. :)
We are not in your head nor do we have the C (or Basic?) source code in front
of us. So if you throw some code line at us without any context it'll be hard
for us to help you. Also note that the intersection of Nim and Basic developers
is probably very small (as opposed to Nim and C) so asking q
Nim does not depend on any `*.go`
Theres `nimlang/nim` docker image.
I've tried using the following Dockerfile:
FROM scratch
ADD jesterapp /jesterapp
EXPOSE 5000
CMD ["/jesterapp"]
but I got error message: 'standard_init_linux.go:207: exec user process caused
"no such file or directory"' when running the container
Thanks, very useful.
Might be simpler to just rename your procedures :)
duh. Of course. I forgot about method! I don't use OOP enough with Nim lol. not
my favorite paradigm :-P
Technically you could hack something by having DOP_COLOR generate code as
string and then using parseStmt to convert that string to code.
That's really hacking though. If you have a lot of statements it might be
worthwhile to create your own mini declarative language and have a macro parse
it.
oh right it's either leaf or node, sorry hallucinated the code, there wouldn't
be an extra dereference. I thought it was a node containing either node or
payload.
I am not familiar with Go interfaces. Can you please add a README that briefly
explains what your module is doing, and add few examples too?
I see that you have an example.nim, may be put that inline in your README and
explain that a little bit?
Thanks.
Yes, that is known.
That's the beauty of the nightlies repo; it caught a regression that happened
only for 32-bit Windows.
It was reported here:
[https://github.com/nim-lang/Nim/issues/10340](https://github.com/nim-lang/Nim/issues/10340).
And @GULPF is already working on fixing it in
[https:/
That's a great set of improvements! Kudos.
One thing I wanted to share -- to stimulate further improvements -- is that
when I looked at interfaced earlier, I ended up passing up on it because it's
not possible to provide type parameters for the interface itself, and for
interface methods. This
Thank you @GULPF... this got me much further along.
Fair enough thanks for the time
Here is the source:
[https://github.com/slangmgh/interfaced](https://github.com/slangmgh/interfaced)
Unfortunately for the last two builds only Windows x64 was built
I have created a modified version of Kru02's interfaced. The original post is
here: [https://forum.nim-lang.org/t/2422](https://forum.nim-lang.org/t/2422)
This version include more feature:
1. interface can inherited from other interfaces
2. interface to base interface can be converted impli
`proc` and `func` uses static dispatch. To enable dynamic dispatch, `method`
must be used instead:
[https://nim-lang.org/docs/manual.html#multiminusmethods](https://nim-lang.org/docs/manual.html#multiminusmethods)
This appears to be working:
type
BBTree*[K,V] = BBLeaf[K, V]
the code is not too long for me to replace all DOP_COLOR(sth) with HIWORD(sth),
LOWORD(sth) by hand. But it is some long for concat thus the code will be a
mess.
But to speak generaly, there is no something like #define A B directive in C,
which only replace A with B literally, in nim, isn't? Y
For people not in the web dev space, web bundlers are a useful tool that helps
manage the front end assets. They handle the compiling, dependency resolution,
minification, cache busting, and any other transformation you want to do with
your code. It's already possible to use Nim with a web bundl
you need the template.
do you need an array or a seq?
your template should probably return a seq then
in both cases you need to concat somehow dopColor with the other elemnts
var opcodes = @[FL..].concat(DOP_COLOR(FL_RED)).concat(@[FL..])
Run
you can't generate a a,
@mratsim, that's interesting... why is there an extra dereference? My mental
model is that the initial version has six contiguous fields (header, key, val,
size, left, right), whereas the space saving version has either three (header,
key, val) or six (header, key, val, size, left, right) depend
first, some questions about pointer
**question 1**
void Fl_Widget_TrackerDelete(Fl_Widget_Tracker* & wt);
Run
c2nim says Error: token expected: )
**question 2**
void flFileChooserCallback(void(*cb)(const char* f));
Run
c2nim say
@rayman22201, thanks. Yikes, what a hassle. I would have expected Nim to do
that discrimination in its method dispatch.
Where is this kind of thing documented?
sorry, I can't still grasp the idea
if emit is used, then how to use DOP_COLOR in nim code obviously,
{. emit: """
#define DOP_COLOR(col) HIWORD(col), LOWORD(col)
""" .}
var opcodes = [
FL_DOP_COLOR ,DOP_COLOR(FL_RED),
FL_DOP_LINE,
]
Nim templates are hygienic and not plain text substitutions.
The output of a template must be valid Nim syntax, the most similar would be a
tuple:
template DOP_COLOR(col: untyped):untyped=
(HIWORD(col), LOWORD(col))
Run
We created a dedicated Telegram group at
[https://t.me/NimFOSDEM2019](https://t.me/NimFOSDEM2019) to avoid spamming the
general discussion group.
I have read
[https://forum.nim-lang.org/t/3199](https://forum.nim-lang.org/t/3199) but I am
still puzzled
my situation is, I need the #define part works like that in C/FreeBasic, so if
#define DOP_COLOR(col) HIWORD(col), LOWORD(col)
Run
then the code to create array
{. emit: """
#define DOP_COLOR(col) HIWORD(col), LOWORD(col)
""" .}
Run
?
32 matches
Mail list logo