Sometimes I’ll see what looks like a template function without a type:
in .sats:
fun{} myfun
…
in .dats:
implement{} myfun
…
I just wonder what is the typical use of doing this sort of construction,
over a regular function.
Sometimes I’ll see what looks like a template function without a type:
in .sats:
fun{} myfun
…
in .dats:
implement{} myfun
…
I just wonder what is the typical use of doing this sort of construction,
over a regular function.
Also, calls to function templates can be easily inlined.On Monday, February 10, 2014 10:38:15 AM UTC-5, gmhwxi wrote:
Templates can be re-implemented.
Say we have
extern fun{} foo (…): …
extern fun{} bar (…): …implement{} foo (…) = …
implement{} bar (…) = … foo () …Later, we can re-implement foo:
implement{} foo (…) = … // another implementation
val _ = bar (…) // the second implementation of [foo] gets used here.
On Monday, February 10, 2014 10:06:53 AM UTC-5, Brandon Barker wrote:
Sometimes I’ll see what looks like a template function without a type:
in .sats:
fun{} myfun
…in .dats:
implement{} myfun
…I just wonder what is the typical use of doing this sort of construction,
over a regular function.
Templates can be re-implemented.
Say we have
extern fun{} foo (…): …
extern fun{} bar (…): …
implement{} foo (…) = …
implement{} bar (…) = … foo () …
Later, we can re-implement foo:
implement{} foo (…) = … // another implementation
val _ = bar (…) // the second implementation of [foo] gets used here.On Monday, February 10, 2014 10:06:53 AM UTC-5, Brandon Barker wrote:
Sometimes I’ll see what looks like a template function without a type:
in .sats:
fun{} myfun
…in .dats:
implement{} myfun
…I just wonder what is the typical use of doing this sort of construction,
over a regular function.