Received: from list by lists.gnu.org with archive (Exim 4.71) id 1TqBsf-0003sj-QL for mharc-grub-devel@gnu.org; Tue, 01 Jan 2013 19:08:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqBsa-0003q4-8f for grub-devel@gnu.org; Tue, 01 Jan 2013 19:08:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TqBsZ-00079b-4c for grub-devel@gnu.org; Tue, 01 Jan 2013 19:08:20 -0500 Received: from v6.chiark.greenend.org.uk ([2001:ba8:1e3::]:43211 helo=chiark.greenend.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqBsY-00079W-Uv for grub-devel@gnu.org; Tue, 01 Jan 2013 19:08:19 -0500 Received: from [172.20.153.9] (helo=riva.pelham.vpn.ucam.org) by chiark.greenend.org.uk (Debian Exim 4.72 #1) with esmtps (return-path cjwatson@ubuntu.com) id 1TqBsY-0006UZ-Gl for grub-devel@gnu.org; Wed, 02 Jan 2013 00:08:18 +0000 Received: from localhost ([127.0.0.1] helo=sarantium.pelham.vpn.ucam.org) by riva.pelham.vpn.ucam.org with esmtp (Exim 4.72) (envelope-from ) id 1TqBsW-0001OV-Qw for grub-devel@gnu.org; Wed, 02 Jan 2013 00:08:16 +0000 Received: from riva.dynamic.greenend.org.uk (localhost [127.0.0.1]) by sarantium.pelham.vpn.ucam.org (Postfix) with ESMTPS id 06CBE3E5015 for ; Wed, 2 Jan 2013 00:07:40 +0000 (GMT) Date: Wed, 2 Jan 2013 00:07:38 +0000 From: Colin Watson To: grub-devel@gnu.org Subject: Re: [PATCH] Removing nested functions, part one of lots Message-ID: <20130102000738.GB5547@riva.dynamic.greenend.org.uk> References: <20130101144204.GZ21216@riva.dynamic.greenend.org.uk> <20130102013738.0f1034cb@opensuse.site> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:ba8:1e3:: X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2013 00:08:24 -0000 On Tue, Jan 01, 2013 at 05:24:00PM -0500, richardvoigt@gmail.com wrote: > On Tue, Jan 1, 2013 at 4:37 PM, Andrey Borzenkov w= rote: > > =D0=92 Tue, 1 Jan 2013 14:42:04 +0000 > > Colin Watson =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > > * If a hook requires more than one local variable from its parent > > > function, declare "struct _ctx" with the necessa= ry > > > variables, and convert both the hook and the parent to access th= e > > > variables in question via that structure. > > > > Personally I find "ctx" part a bit confusing. It is not really execut= ion > > context in usual sense, it is just collection of random variables. I > > would rather go with "struct _data" here. >=20 > 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. --=20 Colin Watson [cjwatson@ubuntu.com]