Re: New entry on Nim blog...

2020-06-09 Thread Araq
Perhaps but omg I wasn't aware the documentation for this tool is already on our website... :-)

Re: New entry on Nim blog...

2020-06-09 Thread spip
Perhaps will we see a presentation from **araq** about [DrNim](https://nim-lang.org/docs/drnim.html) at NimConf too?

Re: bizarre name clash with template

2020-06-09 Thread solo989
Injecting both x symbols works. template t(body: untyped) = proc bod(a: int) = let x {.inject.} = a body for x {.inject.} in [1]: bod(x) t: echo x Run

Re: Setting up a FreeBSD VM for Nim development

2020-06-09 Thread timothee
there are use cases where you don't care about performance too much, or getting the latest OS, for eg if you're simply trying to fix a bug that only affects an OS, like the very flaky openbsd tioselectors bug [https://github.com/nim-lang/Nim/issues/13166](https://github.com/nim-lang/Nim/issues/1

Re: bizarre name clash with template

2020-06-09 Thread jibal
> "template-local symbol mishandled when shadowing a sub-proc-scope inject" or > something similar. That's a lot more concise than my title for the bug ... but the thing is, the local symbol _doesn 't_ shadow the one in the proc (or v.v. -- symbols in inner scopes shadow symbols in outer scopes

Re: Standalone Libclang Nim Apps

2020-06-09 Thread deech
Yes a 'nimterop' like thing for C++ would be pretty feasible. Wrapping large C++ libs will still be a lot of work but maybe my project could make it a little less work. :)

Re: Standalone Libclang Nim Apps

2020-06-09 Thread mantielero
Hi deech. I am posting here to avoid hijacking the [hackaton thread](https://forum.nim-lang.org/t/6394). I am not sure if I get it. If I understand this correctly, this provides is a way to introspect headers by means of libclang. So this could be used to create a nimterop like tool using libc

Re: bizarre name clash with template

2020-06-09 Thread jyapayne
> Sigh. I know what I've done and what is needed to overcome it (I already said > that it works if I change the name, so you don't need to tell me that I can > change the name to make it work) My bad, I accidentally skipped over that part of your question.

Re: Idea: Nim Online Conference

2020-06-09 Thread akavel
Yep, but IIUC, I can't see what it will obscure at any point in time while recording the screencast (or can I? I didn't find a way), until after it's fully recorded. Then I may need to re-record if something important got hidden (as I can't move the facecam around in the video after it's recorde

Re: bizarre name clash with template

2020-06-09 Thread jibal
Here's another example that works, showing yet again that the error is due to mishandling of the symbol table. I'm going to go ahead and file a bug. template z(body: untyped) = proc bod(a: int) = let x {.inject.} = a body template t(body: untyped) =

Re: bizarre name clash with template

2020-06-09 Thread cblake
Sorry - I read more your 2nd whole comment than your 2nd sentence and replied too quickly. Oops. It does indeed seem weird that `for y in [1]: bod(y)` works while `for x in [1]: bod(x)` fails. I'd file a bug called something like "template-local symbol mishandled when shadowing a sub-proc-scop

Re: bizarre name clash with template

2020-06-09 Thread jibal
> The error you're receiving is because you've named the loop variable the same > as the injected variable, which overrides the injected variable. Sigh. I know what I've done and what is needed to overcome it, but the message makes no sense and the error makes no sense in terms of scope. The x i

Re: bizarre name clash with template

2020-06-09 Thread jibal
> You need another {.inject.} at the site of the 2nd let for the call site, > i.e., inside the template Why would I need that? I don't care what the variable name is. I'm not asking how to get the code to work ... I already have a trivial fix for that, vastly superior to adding another {.inject

Re: Nim for Beginners Video Series

2020-06-09 Thread Kiloneie
#23 is live at: [https://youtu.be/avTodIhY5lc](https://youtu.be/avTodIhY5lc) Iterators.

Re: Terminal keyboard and mouse

2020-06-09 Thread JPLRouge
Hello I finally solved (99.9%) the problem of scratching the mouse in the management of the terminal (in linux) It was while developing my designer for the terminal that I realized that the events of the mouse went up at breakneck speed and the buffer was too small, it piled up in short !

Re: Looking for contributions to my optimistic image library

2020-06-09 Thread digitalcraftsman
Currently I'm learning Nim and have some little projects in mind that involve image manipulation. For my needs it doesn't have to be anything advanced. There are already packages on Nimble for reading and writing JPEG and PNG files, conversion between different color spaces etc. But it would be

Re: bizarre name clash with template

2020-06-09 Thread jyapayne
@jibal The error you're receiving is because you've named the loop variable the same as the injected variable, which overrides the injected variable. This works: template t(body: untyped) = proc bod(a: int) = let x {.inject.} = a body for i in [1,

Re: New entry on Nim blog...

2020-06-09 Thread mratsim
To develop Weave I took a poor man's Ada/Spark approach: `preCondition`, `postCondition`, `ascertain` [templates](https://github.com/mratsim/weave/blob/9f0c384f/weave/instrumentation/contracts.nim#L93-L103) (names cleverly chosen to not conflict with `requires` and `ensure`). Those also report

Re: Can the nim compiler run in the browser? Experimenting Nim to template web pages

2020-06-09 Thread mitai
really interesting! Is there a TODO list on which i can help?

Re: Looking for contributions to my optimistic image library

2020-06-09 Thread mratsim
Note that I have started some image manipulation low-level primitives and also benchmarks in Impulse [https://github.com/SciNim/impulse](https://github.com/SciNim/impulse) For example to apply an image filter I have benchmarked 5 low-level primitives here: [https://github.com/SciNim/impulse/bl

Re: Using a Table as an object's member.

2020-06-09 Thread mratsim
Choosing ref vs object is about the semantics of your type and also it's copying. If your type represents an unique resource or instance for example a file handle, a database or socket connection or GPU memory, a tree node, a person, a game level. This is particularly true if the resource resou

Re: bizarre name clash with template

2020-06-09 Thread cblake
You need another `{.inject.}` at the site of the 2nd let for the call site, i.e., inside the `template`: let x {.inject.} = 1 bod(x) Run Or you could mark the whole template `{.dirty.}`.

Re: Idea: Nim Online Conference

2020-06-09 Thread Yardanico
I'm not exactly sure why would you need that though - you can easily add a "facecam" with OBS without any extra plugins or programs.

Re: nim code coverage

2020-06-09 Thread Clonk
Bumping this as it appears coco and lcov are not working on the lastest Nim version. See [https://github.com/nim-lang/Nim/issues/8598](https://github.com/nim-lang/Nim/issues/8598) . Is there any solution to generate code coverage report (ideally with lcov) from unit tests ? I know of [https:/

Re: bizarre name clash with template

2020-06-09 Thread jibal
Here's another variant that also fails with the same message (note that there's no error for the let statement, just the bod call): template t(body: untyped) = proc bod(a: int) = let x {.inject.} = a body let x = 1 bod(x) t:

bizarre name clash with template

2020-06-09 Thread jibal
This code produces the very surprising message x.nim(9, 1) template/generic instantiation of `t` from here x.nim(7, 9) Error: undeclared identifier: 'x' The error is for bod(x) If I change the for loop variable to anything other than x, it works. If this is i