From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: A prototype for a binding based approach to proper namespaces Date: Sat, 09 May 2020 08:27:46 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="46868"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 09 10:29:40 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jXKrb-000C50-9L for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 10:29:39 +0200 Original-Received: from localhost ([::1]:59282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXKrZ-0002X2-Sc for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 04:29:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXKps-0008SS-Hm for emacs-devel@gnu.org; Sat, 09 May 2020 04:27:52 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:53273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXKpq-00020u-C1 for emacs-devel@gnu.org; Sat, 09 May 2020 04:27:52 -0400 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 0498RkfQ011615 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Sat, 9 May 2020 08:27:46 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 0498Rkf4008607; Sat, 9 May 2020 08:27:46 GMT In-Reply-To: (Helmut Eller's message of "Sat, 09 May 2020 09:38:31 +0200") Received-SPF: pass client-ip=205.166.94.20; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/09 04:05:27 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:249375 Archived-At: Helmut Eller writes: > On Fri, May 08 2020, Andrea Corallo wrote: > >> Hi all, >> >> given the ongoing discussion on namespaces I thought was interesting to >> try out a prototype to reason on. >> >> I wrote a short page explaining what I did and how it is implemented: >> >> https://akrl.sdf.org/lexspaces/lexspaces.html >> >> It's a quick hack, certainly many pieces are missing, is potentially a >> very bad idea, but I'd be interested in opinions. > > On the page you asked "I don't know if other similar implementations > exists (I'd guess so) and I'd like or hear about those if someone are > aware". MIT Scheme (and hence the Edwin editor) has "environments"[1] > which seem to similar to your lexicons. But it's not well documented. > > I believe, like Stefan, that a big problem is the use of symbols as > "designators" (to borrow Common Lisp terminology). E.g. funcall works > on functions but also on symbols. The symbol designates a (global) > function. The same thing for faces: symbols are used to designate > faces, which only exist in C code. XEmacs has actual face objects, but > almost everywhere where a face object is required a symbol can be used > too. > > Maybe that problem could be (partially) solved by having an operator, > like: > > (resolve-designator NAME) > > that returns the full symbol for NAME based on the currend lexical > environments. This would be a pure compile-time operation, a bit like > macroexpand. E.g. instead of Yes it's an interesting problem. Isn't sufficient to select the wanted behavior to do as follow? ;; foo define in another Lexspace will use its definition of bar. (foo #'bar) ;; This will use the definition in the current lexical enviroment instead. (foo (symbol-function bar)) Thanks Andrea -- akrl@sdf.org