2011-07-30

go's defer statement

7.1: adda/go.lang/defer:
. go.lang has a defer
that is like a type mgt's finalization routine
only it's used by a function
for things that should happen on return .
. ideas I got from that are:
# on return: ... [7.30:
. "(on *condition*) would generally mean
rule-based vs imperative programming;
so (on return: s) would add (s) to
the list of things to do before returning .]
# self`end`+ ... [7.30:
. this is modeled after i`+ 1
which is shorthand for i= i+1 .
. the self is the current subprogram;
it already has an "(end)
listing things to do before ending;
and a (`+) would add to that list .]

No comments:

Post a Comment