Help show all advantageous differences among inline procedure, template, macros

2022-03-09 Thread Stefan_Salewski
> Anyone kind enough point out precisely the definitive advantage differences > among template, inline function/procedure, and macros ? My feeling is that you have asked a lot of beginner questions in the last weeks? Or did I confuse your user name? Unfortunately I have not your valid email add

How to get process owner by pid?

2022-03-09 Thread Aquilao
Hello, I'm trying to use process id to query process owner on Windows. First I tried to use psutil-nim, but it seems to have stopped maintenance and related methods have failed. Then I tried to use [GetOwner method of the Win32_Process class](https://docs.microsoft.com/en-us/windows/win32/cimwi

Help show all advantageous differences among inline procedure, template, macros

2022-03-09 Thread Araq
They are different things, useful for different use cases. The way you phrased the question indicates that you should use `.inline` procs.

How to fetch value pointed by a C++ std::list iterator?

2022-03-09 Thread kaushalmodi
> It's an unary operator. Duh, :facepalm: Thanks again!

How to fetch value pointed by a C++ std::list iterator?

2022-03-09 Thread kaushalmodi
Answering this to myself.. >From >, > A hash # symbol is replaced by the first or next argument. So with `(*#)`, when the `` `*` `` proc is called with an iter var, say `it`, that translates to `(*it)` (or that's

How to fetch value pointed by a C++ std::list iterator?

2022-03-09 Thread kaushalmodi
@sls1005 > `{.importcpp: "(*#)".}` I cannot find this in the manual. What should I search for to look for specifically this syntax? I looked at .

How to fetch value pointed by a C++ std::list iterator?

2022-03-09 Thread sls1005
``*`` is an unary operator. Use it as if you're writing C++. var it = l.begin() echo *it Run

How to fetch value pointed by a C++ std::list iterator?

2022-03-09 Thread kaushalmodi
@sls1005 That worked! Thank you! btw do you canonically name that proc as `*`? I was able to call it using this style only: echo &"l[0] = {begin[cint](l).`*`}" echo &"l[0] = {`*`begin[cint](l)}" Run This feels more intuitive to me: proc getItem*[T](i

How to fetch value pointed by a C++ std::list iterator?

2022-03-09 Thread sls1005
C++ iterator is unnecessary to be a pointer. I think it's just an object that supports dereferencing. proc `*`[T](it: ListIter[T]):T {.importcpp: "(*#)", nodecl.} Run

How to fetch value pointed by a C++ std::list iterator?

2022-03-09 Thread kaushalmodi
Hello, I am trying to write some Nim code that interfaces with some legacy C++ code using `std::list`. The API has a way to return a `std::list` object, and I am attempting to fetch elements from that returned object. I am facing a roadblock when attempting to get the value pointed by an std::

Want Nim online code playground to be mobile and desktop friendly.

2022-03-09 Thread GordonBGood
@Xigol, that Attempt This Online is a good find, currently running Nim version 1.6.4; as compared to Wandbox above, it lacks to ability to add multiple files/modules and multi-threading as it only runs on one thread per run Wandbox now offers six cores/twelve threads). Adding options/arguments n

Help show all advantageous differences among inline procedure, template, macros

2022-03-09 Thread mardiyah
Anyone kind enough point out precisely the definitive advantageous differences among template, inline function/procedure, and macros ?

SDL in a M1 Mac - can't find dylib

2022-03-09 Thread Clonk
Well if the link target is the library name without version it won't be found by modifying LD_LIBRARY_PATH. Often what is done is to use symlink to solve this ergo having `libmystuff.so` being a symlink to `libmystuff.so.1.7`

SDL in a M1 Mac - can't find dylib

2022-03-09 Thread Ethernaut
I can get it to run by copying to the build folder and renaming (to remove version numbers) each and every .dylib file in use, but there's gotta be a better way...

SDL in a M1 Mac - can't find dylib

2022-03-09 Thread Ethernaut
Thanks, but still doesn't work. The compiler still ignores any path I add. I'm currently setting these environment variables: export PATH=/opt/homebrew/Cellar:/opt/homebrew/lib:$PATH export CPATH=/opt/homebrew/include:$CPATH export LIBRARY_PATH=/opt/homebrew/Cellar:/opt/homeb

Nim project using C++ Backend with single module using library wrapping a C library

2022-03-09 Thread tmsa04
You can use straight unmodified C code in C++ so it might have been possible to call it all C++ quite easily, but I don't know if this would work with Nim as I have not tried it.

Just open sourced "easyess", an Entity Component System in Nim

2022-03-09 Thread planetis
It's best described in [C++Now 2017: Allan Deutsch “The Slot Map Data Structure"](https://www.youtube.com/watch?v=SHaAR7XPtNU) My implementation is based on [slotmap.rs](https://docs.rs/slotmap/latest/slotmap/) but adapted in Nim

SDL in a M1 Mac - can't find dylib

2022-03-09 Thread jyapayne
You should be using `LD_LIBRARY_PATH`. Also, you should not overwrite it but append to it like so: export LD_LIBRARY_PATH=/opt/homebrew/lib:$LD_LIBRARY_PATH Run

Want Nim online code playground to be mobile and desktop friendly.

2022-03-09 Thread xigoi
[Attempt This Online!](https://ato.pxeger.com/) seems to support the newest version of Nim.

On Warning: Deprecated since v1.4; there should not be high

2022-03-09 Thread adokitkat
I mean if you want e.g. the highest value of integer then you should write `high(int)` where `int` is a type and not something like `high(42)` where 42 is a int value. You can use `type(value)` to solve the warning: var x = 42 echo high(x.type) Run

On Warning: Deprecated since v1.4; there should not be high

2022-03-09 Thread enthus1ast
you should use "int.high", see: echo 10.high # Deprecated 9223372036854775807 echo int.high # use this 9223372036854775807 Run

On Warning: Deprecated since v1.4; there should not be high

2022-03-09 Thread mardiyah
How do we do solving: `Warning: Deprecated since v1.4; there should not be `high(value)`. Use `high(type)`.; high` ... ? Please get it solved and other list of warnings and its solutions

Just open sourced "easyess", an Entity Component System in Nim

2022-03-09 Thread ErikWDev
Scenes/Worlds can be created using `newECS()` which creates an instance of the ECS type that (in the case of the example above) looks like this: type ECS* = ref object nextID*: Entity highestID*: Entity when not defined(release): usedLabels:

nimja; compiled and statically typed template engine (like twig or jinja2)

2022-03-09 Thread enthus1ast
I've just released a new update for Nimja: Hot Code Reloading. I hope this streamlines the process of designing a website. I've opted out for real dynamic execution, since it's way more limited and complicated, than just compiling. The way it works is that you group all your render functions in

Just open sourced "easyess", an Entity Component System in Nim

2022-03-09 Thread ErikWDev
Just added an example game here: [Snake-like Game using Aglet and Easyess](https://github.com/EriKWDev/easyess/blob/main/examples/snakelike_rapid_game/src/rapid_game.nim)

Just open sourced "easyess", an Entity Component System in Nim

2022-03-09 Thread ErikWDev
Hey that looks really cool! I have noticed that easyess shugs for a second when instantiating 100+ new entities at once, so I will have to do some profiling and this looks like a cool datastructure :) Is this a common datastructure or have you come up with it yourself? Where can I read about how

Want Nim online code playground to be mobile and desktop friendly.

2022-03-09 Thread mohan24
The links u gave me were great, but actually the other problem is that im using html iframe tag and sololearn as a platform for show and share my nim code, that only works well with official nim playground and it wirks great for me but doesn't work with website given by u, no offense though. I w

Want Nim online code playground to be mobile and desktop friendly.

2022-03-09 Thread haxscramper
Wandbox () also supports nim compiler, although it does not have the latest version of it. Aside from that, it has several advantages compared to the nim playground * Ability to pass compilation flags, and arguments to the compiled program * Support for multiple files