[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Removing nested functions, part one of lots
From: |
Colin Watson |
Subject: |
Re: [PATCH] Removing nested functions, part one of lots |
Date: |
Wed, 2 Jan 2013 00:07:38 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Jan 01, 2013 at 05:24:00PM -0500, address@hidden wrote:
> On Tue, Jan 1, 2013 at 4:37 PM, Andrey Borzenkov <address@hidden>wrote:
> > В Tue, 1 Jan 2013 14:42:04 +0000
> > Colin Watson <address@hidden> пишет:
> > > * If a hook requires more than one local variable from its parent
> > > function, declare "struct <name-of-parent>_ctx" with the necessary
> > > variables, and convert both the hook and the parent to access the
> > > variables in question via that structure.
> >
> > Personally I find "ctx" part a bit confusing. It is not really execution
> > context in usual sense, it is just collection of random variables. I
> > would rather go with "struct <name-of-parent>_data" here.
>
> It's acting as a closure. That might be a more exact name.
"Closure" has all sorts of baggage for different people that I would
rather not invoke. In particular the context/data/whatever structure
does not contain any reference to the hook function, so in my book
calling it a closure would be confusing; it's really only part of a
closure, namely the set of associated free variables.
--
Colin Watson address@hidden