assyrianic / SourceGo

SourceGo is a transpiler that transforms a subset of Golang-like code to equivalent SourcePawn.
https://forums.alliedmods.net/showthread.php?t=328269
MIT License
25 stars 3 forks source link

Add new Built-in: `size` #17

Open assyrianic opened 2 years ago

assyrianic commented 2 years ago

to replace sizeof usage in SourcePawn, I will add a new builtin called size which will have the following signature:

// __builtin__
func size(x any) int

It'll return int to keep it consistent with len and cap as they both return a typed int as well.