Nim
Nim copied to clipboard
Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, an...
### Example ```nim when true: var a = {0,1} # works static: echo a.type # set[range 0..65535(int)] proc foo[T](a: T, b: set[T]) = discard foo(3'u16, {0'u16,1}) # works foo(3, {0,1})...
I tested a small program from the forum that implements SSE (server side event) and works well. But when I close the browser, the server continues to send the response...
Following example would fail with compiler error, [playground](https://play.nim-lang.org/#ix=3nHv) ``` Error: internal error: expr: param not init query_13251018 ``` ### Example ```nim import strformat proc somefn[T](query: string, _: type[T], message =...
### Example ```nim template test1(a, b, c: SomeInteger|SomeFloat) = echo (float a, float b, float c) template test2(a, b, c: SomeNumber) = echo (float a, float b, float c) test1(1,...
fixes #4858, fixes #10027, fixes #12552, fixes #15721, fixes #21331, fixes but does not test #18121 (maybe it should fail the match in this case?), refs #1214, follows up #24216,...
If one attempts to pass `int or float` into a macro which takes a `typedesc` it does not compile. ### Example ```nim macro test(a: typedesc) = discard test(int or float)...
Compiler error on a generic object with an array field. Can't use `int` for `L` in the following example, so passed a range to satisfy the compiler: ### Example ```nim...
Attempting to call a method on a "subclass" with a callback throws an internal error. ### Example ```nim type Entity = ref object of RootObj SubEntity = ref object of...
proc types don't match as part of proc param typeclasses ### Example ```nim type A = proc() proc f(j: A) = discard proc g(j: A | int) = discard proc...
fixes #23687, fixes #23688, refs #13450