Difference between generics and templates

2023-03-12 Thread Zoom
That is a great and I'd say manual-worthy explanation.

Difference between generics and templates

2023-03-12 Thread shirleyquirk
var a = (proc(s: string))(doThing) Run Always wanted to know how to do this, thanks @eb

Difference between generics and templates

2023-03-11 Thread ElegantBeef
They're both a variation of metaprogramming, but their semantics are slightly different. A template is code substitution that substitutes at every invocation whereas a generic only generates a procedure once on it's first invocation. proc doThing(a: auto) = mixin otherThing

Difference between generics and templates

2023-03-11 Thread WizardUli
May I ask what are the differences in generics vs templates except for slightly different syntax? I've tried to understand it from the Manual but to me it seems that they have the same use-case. I've tried searching for some discussion about this but couldn't find anything, perhaps it's clear to