quote dohere and there, but haven't used/understood it yet
IntLit- don't know how to pass that to a proc which creates an instance of
Shape, there is no
quote do, something like what you did there and a lot of hardcoded things (:P), you can do something like this: http://ix.io/1mps/nim
quote dois something i really need to start using :)
dumpAstGen, i now have a new best friend!
NimNode. e.g. refactoring the above to: http://ix.io/1mpu/nim
this is a minimum reproducable example without dependencies to see what I mean with leaks: https://gist.github.com/tim-st/30eb88b2a96fdd77623be945dff5fc2a
yep, I'm playing around with this code and notice that on every request there is at least 3 allocations for response body (each of them ~equal a body size) and the memory only for 2 of 3 allocations is deallocated later
logAlloc = trueand call
GC_full_collectbefore each request
Hello, What is a good example of when to use
reference types vs
Here is a non-ref object:
type Person = object name: string age: int var person: Person person.name = "Daniel"
Here is a ref object:
type PersonObj = object name: string age: int PersonRef = ref PersonObj # reference type proc setName(name: string, person: PersonRef) = person.name = name var person1 = PersonRef() setName("Daniel", person1)
Why should I use one over the other? They both seem to be achieving the same thing.
Since ref object is live on the heap, and non-ref is on the stack, Is that the only difference?