From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Multiple major modes Date: Sun, 01 Jul 2007 16:40:13 -0400 Message-ID: References: <466E7A93.3050705@gmail.com> <466E81AA.3030202@gnu.org> <466E9822.2050508@gmail.com> <466EAB9D.9020408@gnu.org> <466EEA71.2070700@gmail.com> <200706122014.l5CKEKV1021902@projectile.siege-engine.com> <200706190209.l5J29Csr010302@projectile.siege-engine.com> <200706251404.l5PE4dgc011720@projectile.siege-engine.com> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1183322527 6836 80.91.229.12 (1 Jul 2007 20:42:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Jul 2007 20:42:07 +0000 (UTC) Cc: jasonr@gnu.org, lennart.borgman@gmail.com, sdl.web@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: "Eric M. Ludlam" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 01 22:42:05 2007 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I56F5-0002Kg-4f for ged-emacs-devel@m.gmane.org; Sun, 01 Jul 2007 22:41:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I56F4-0002Fh-LL for ged-emacs-devel@m.gmane.org; Sun, 01 Jul 2007 16:41:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I56DQ-0006uZ-Cv for emacs-devel@gnu.org; Sun, 01 Jul 2007 16:40:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I56DO-0006rB-Ma for emacs-devel@gnu.org; Sun, 01 Jul 2007 16:40:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I56DO-0006qs-4W for emacs-devel@gnu.org; Sun, 01 Jul 2007 16:40:14 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I56DN-0005JD-QX for emacs-devel@gnu.org; Sun, 01 Jul 2007 16:40:13 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1I56DN-0006bY-H2; Sun, 01 Jul 2007 16:40:13 -0400 In-reply-to: <200706251404.l5PE4dgc011720@projectile.siege-engine.com> (eric@siege-engine.com) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74145 Archived-At: The function overload mechanism is also a feature I use in semantic. Most features that work in multiple major modes today provide a variable where you can put a symbol that is a function that would then provide some mode-specific functionality. My semantic tool has hundreds of these functions, so I abstracted the concept up so that the implementations could be declarative, instead of programmatic. I really don't like the idea of function overloads. This mechanism shares the drawbacks of advice: that a function doesn't do what its definition says. It also makes it easy to make most functions overridable, which helps avoid forcing users to use advice when customizing my tool. It is easy to replace advising with another similar mechanism, but it doesn't solve the problem. It seems to me that there is no need for this. Calling a variable with funcall should do the same job. That way, the call _shows_ that the function isn't fixed.