Nesting templates is fine. The problem is `myFunc.inner` instead of
`inner(myFunc)`. For templates it best to use the call `foo(a, b, c)`, or
command `foo a, b, c` syntax.
See:
It is helpful! Thank you so very much!
I'm a beginer.And I'm writing some code to measure the execution times of proc.
However, when I nest template, I get some error **Error: expression
'mySleep([1, 2, 3])' has no type (or is ambiguous).** code in ->
[https://play.nim-lang.org/#ix=1Y5M](https://play.nim-lang.org/#ix=1Y5M) .
Namely
@dotheda:
> Also, I would do WebAssembly but the process seems a lot more complicated, so
> I'll wait until it gets proper support, official or not. Any news on that?
I don't know about official support, but it has been done often enough, even by
@Araq, although many users are on Linux and
Nimble is crashing when trying to update itself, or when installing packages.
It used to work fine, but seems to have broken after I updated to Nim 1.0 using
brew on Mac.
I’ve put more detail in a comment to an existing similar nimble issue
I suppose the reason why I might want to override the compiler's analysis would
probably _not_ be that I want to "risk it" despite GC-unsafe code. I'd use the
pragma because there are - hopefully - clear rules what is GC-safe and what
isn't and I'd want to override the compiler in case the code
@Araq my intent is to output more readable and debbugable code. Im currently
looking at **jsgen.nim**
Lets say I want to make a new backend target - Typescript
The resulting code shoud look like this:
const msg:string = "TS Backend";
for(i = 0; i<=10 ; i++) {
hello
compile
[https://github.com/nim-lang/ui/blob/master/examples/table.nim](https://github.com/nim-lang/ui/blob/master/examples/table.nim)
/home/soleil/snap/code/common/.cache/nim/table_r/table.nim.c:294:1:
warning: type of ‘uiTableValueInt’ does not match original declaration
I've got
could not load: libpq.dll
Run
however libpg.dll is in the app directory.
I I like it just they way it is. But as a recording enthuisiast, the easiest
way to get rid of the typing and backround noise is to buy a cheap lavalier mic
and put it close to your mouth and maybe use a compressor and maybe a noise
gate. But as I said, I think your videos are excellent they
The chess game looks awesome. Impressive stuff for such a small amount of code.
Is it just me or do Nim create really compact code? I would imagine C++ with
the libraries might require more.
When that is said, the chess game is a little too advanced for me at this
moment. But I might try it a
Funny, I did a chess game too some years ago.
[https://github.com/StefanSalewski/nim-chess4](https://github.com/StefanSalewski/nim-chess4)
Maybe my [chess game](https://github.com/dawkot/netchess) will be helpful. The
rules are in src/game.nim and should on all targets.
I know my voice is a bit low, i talk quietly and i had to lower the volume to
drop background noise, might tweak it some to improve it.
About the keyboard part... some people like it D: ... idk. I could try to
normalize the volumes in the editing, maybe that will fix the high volume of my
I tried that game but it gives me error. It says newGame is not declared. I
don't see any myself. I did "import ui" on top of project.
proc gui*() =
var mainwin = newWindow("tictactoe", 400, 500, true)
# game object to contain the state, the players, the difficulty,... var g =
For Tic Tac Toe (and maybe some other interesting small projects): take a look
at "Nim Days"
[https://xmonader.github.io/nimdays](https://xmonader.github.io/nimdays)/
Hi I need some help with tips to write some beginner level programs in Nim. I
wonder if you have examples of some simple projects I can do to improve my
coding skills? I am very interested in things like Tic Tac Toe game, Snake game
or any kind of cool, interesting or rewarding projects that is
These videos are amazing. The number one thing for me when choosing what
languages to learn is the amount and quality of teaching material, and how
helpful the community of the language has. These videos are so well paced and
well explained that almost anyone can learn it. In my experience with
Well, the entire point of the pragma is, according to the manual: `To override
the compiler's gcsafety analysis a {.gcsafe.} pragma block can be used`
You're supposed to either have Server be a ref object for it to have reference
semantics or use it as a [var
parameter](https://nim-lang.org/docs/manual.html#procedures-var-parameters)
Hello @Kiloneie !
First really nice job, keep going there is not much of these Nim tutorials out
there !
My only advice would be to make your voice more clear. Right now, your voice is
a bit low and the sound of you hitting your keys is a bit loud. Maybe you could
first record the video and
For OCR you will need OpenCV compiled with Tesseract support.
See tutorial here, especially using the C++ API:
import net
import strutils
import tables
import asynchttpserver, asyncdispatch
type Server* = object
port: int
routes: Table[string, Table[string, proc(request: Request) {.cdecl.}]]
allowedMethods: seq[string]
proc newServer*: Server =
Hi! httpMethod is string here
Re 1.: How would I be able to tell whether the code is safe in the future? Will
there be a new definition of "GC-safe" at some point or was my understanding of
GC safety wrong to begin with?
This compiles:
import tables, asynchttpserver
type Server* = object
port: int
routes: Table[string, Table[string, proc(request: Request) {.cdecl.}]]
allowedMethods: seq[string]
proc newServer*: Server =
result.port = 8080
Thanks for your answers and the code suggestion. I see what you're doing here,
but I need the same temporary directory for all threads. :-)
Would the approach with `deepcopy` [as in the
manual](https://nim-lang.org/docs/manual.html#threads-gc-safety) be safe?
import os
import
Hello everybody,
Online games address common entertainment needs with convenience.With
GamesBX, you can play games anytime, anywhere and on any internet-connected
device, even when you're on the go. From listless people to people in the
waiting room. Players can choose from a variety of
Hi @vbxx3 !
What is the type of httpMethod in the addRoute* method ? You haven't defined it
in the method definition.
Wow, great job!
It is not so attractive for someone who makes a lot of stuff for beginners,
comparing to advanced topics, but please continue -- going step by step with
video is very important for beginners to dive into the topic (Nim programming).
Your video series can make the Nim as the
Specialize `system.echo` for a single string/cstring argument. But it seems
foolish, `echo` or `console.log` shouldn't be on your critical path.
31 matches
Mail list logo