2 ms·
The Go documentation refers to panic as a "built-in function" but this is a white lie in the documentation. It is not a function; this will not compile: va
by morelisp 7y ago
The Go documentation refers to panic as a "built-in function" but this is a white lie in the documentation. It is not a function; this will not compile:
var _ func(interface{}) = panic
It is a special form that happens to be spelled like a function.
The distinction the Go documentation is drawing between "keyword" and "built-in" is largely about Go's internal parsing mechanism (i.e. can you have a variable named try, or panic, which you can). When Go says "keyword" they mean what would be more formally a "reserved word". Hence my preference for "special form", but this is not well-known outside the Lisp community.