From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109327: Generalize INTERNAL_FIELD between buffers, keyboards and frames. Date: Wed, 08 Aug 2012 08:41:54 -0400 Message-ID: References: <50191B54.2070705@yandex.ru> <5019FE2D.2060005@yandex.ru> <87r4rigihu.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1344429746 8807 80.91.229.3 (8 Aug 2012 12:42:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Aug 2012 12:42:26 +0000 (UTC) Cc: Dmitry Antipov , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 08 14:42:25 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sz5ab-0004jL-LL for ged-emacs-devel@m.gmane.org; Wed, 08 Aug 2012 14:42:17 +0200 Original-Received: from localhost ([::1]:53102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sz5aa-00062B-H1 for ged-emacs-devel@m.gmane.org; Wed, 08 Aug 2012 08:42:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sz5aV-000625-F9 for emacs-devel@gnu.org; Wed, 08 Aug 2012 08:42:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sz5aP-0007V6-Nj for emacs-devel@gnu.org; Wed, 08 Aug 2012 08:42:11 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:54976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sz5aF-0007U6-OU; Wed, 08 Aug 2012 08:41:55 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09Ld/LR/2dsb2JhbABEtBGBCIIVAQEEAScvIwULCw4mBwsUGA0kiBwFugmQRAOLG5A7gmOEeoFYgwU X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="195262401" Original-Received: from 75-119-242-209.dsl.teksavvy.com (HELO pastel.home) ([75.119.242.209]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 08 Aug 2012 08:41:54 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 5732A599B1; Wed, 8 Aug 2012 08:41:54 -0400 (EDT) In-Reply-To: <87r4rigihu.fsf@gnu.org> (Chong Yidong's message of "Wed, 08 Aug 2012 11:39:09 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152334 Archived-At: > Another problem, which I haven't seen mentioned in this thread, is that > when you see C code which does FVAR (x, y) the natural assumption is > that x and y are C variables. So these macros hurt code readability. > The introduction of BVAR also violated this principle, and I'm not eager > to see the problem compounded. Yes, we should see about fixing this problem. > I think FSET/WSET/PSET/PGET/etc should be removed from the trunk, at > least for now. I recommend moving the generational GC work to a branch. I'm OK with keeping macros for the assignments. But I'd like to hear suggestions to reduce/eliminate the problem you mention (of field names looking like variables). Depending on the write-barrier, "FSET (foo->bar, val)" can be used, but most write-barriers want to access other parts of "foo" rather than only "foo->bar". Maybe SET_FIELD (foo, bar, val) would be slightly better: "bar" still looks like a variable, but at least the macro name hints at the fact that there's a field somewhere in there. > Isn't the point of Coccinelle to make it possible to transform the code > with minimal manual intervention? IIUC Coccinelle helps the work, but there is still a fair bit of manual intervention needed afterwards, so it's not quite that simple. Setfan