logoalt Hacker News

tux1968last Sunday at 4:36 PM2 repliesview on HN

Same as C, define a named function, and pass a pointer to the sorting function.


Replies

flohofwoelast Sunday at 4:41 PM

Unlike C you can stamp out a specialized and typesafe sort function via generics though:

https://ziglang.org/documentation/master/std/#std.sort.binar...

tsimionesculast Sunday at 4:40 PM

And what if you need to close over some local variable?

show 1 reply