Static function variables in Swift

I don’t think Swift supports static variable without having it attached to a class/struct. Try declaring a private struct with static variable. func foo() -> Int { struct Holder { static var timesCalled = 0 } Holder.timesCalled += 1 return Holder.timesCalled } 7> foo() $R0: Int = 1 8> foo() $R1: Int = 2 9> … Read more

Bodiless function in Golang

It’s the way how functions are implemented in assembly. You find the assembly implementation in the floor_ARCH.s (e.g.: AMD64) files. To quote the spec: A function declaration may omit the body. Such a declaration provides the signature for a function implemented outside Go, such as an assembly routine.