Re: Passing procedure as argument

2019-10-06 Thread vbxx3
proc addRoute*(self: Server, httpMethod, route: string, handler: proc(request: Request) {.cdecl.}) = discard Run Well, it works, thanks :)

Re: Passing procedure as argument

2019-10-06 Thread doofenstein
proc(param1: typ1, param2: typ2), to be exact it depends on the parameters of the procedure. See also: [https://nim-lang.org/docs/manual.html#types-procedural-type](https://nim-lang.org/docs/manual.html#types-procedural-type)

Re: Passing procedure as argument

2019-10-06 Thread ducdetronquito
Hello vbxx3, I am new to Nim but I think what you are looking for is called **procedural types**. You can find some information about them in the [Nim tutorial](https://nim-lang.org/docs/tut1.html#advanced-types-procedural-type) and in the

Passing procedure as argument

2019-10-06 Thread vbxx3
proc addRoute*(self: Server, httpMethod, route: string, handler: ???) discard Run What type do I need to set to pass the procedure as a handler?