From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: New syntax: (: MODULE-NAME VARIABLE-NAME) Date: Sat, 15 Nov 2003 16:10:31 +0100 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <878ymhsm54.fsf@zagadka.ping.de> References: <87brrgw32m.fsf@zagadka.ping.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1068909196 21104 80.91.224.253 (15 Nov 2003 15:13:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Nov 2003 15:13:16 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Nov 15 16:13:12 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AL26q-0008NH-00 for ; Sat, 15 Nov 2003 16:13:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AL32r-0000VP-5h for guile-devel@m.gmane.org; Sat, 15 Nov 2003 11:13:09 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AL32H-0000To-07 for guile-devel@gnu.org; Sat, 15 Nov 2003 11:12:33 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AL31j-0008IV-MI for guile-devel@gnu.org; Sat, 15 Nov 2003 11:12:30 -0500 Original-Received: from [195.253.8.218] (helo=mail.dokom.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AL31j-0008IR-9m for guile-devel@gnu.org; Sat, 15 Nov 2003 11:11:59 -0500 Original-Received: from dialin.speedway15.dip103.dokom.de ([195.253.15.103] helo=zagadka.ping.de) by mail.dokom.net with smtp (Exim 3.36 #3) id 1AL271-000860-00 for guile-devel@gnu.org; Sat, 15 Nov 2003 16:13:24 +0100 Original-Received: (qmail 8387 invoked by uid 1000); 15 Nov 2003 15:10:31 -0000 Original-To: djurfeldt@nada.kth.se In-Reply-To: (Mikael Djurfeldt's message of "Fri, 14 Nov 2003 17:09:58 -0500") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3028 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3028 Mikael Djurfeldt writes: > Marius Vollmer writes: > >> what about making the changes below? The only unclean thing is that >> we would need to change the interpretation of a single ':'. > > But isn't that pretty darn unclean? It changes the lexical structure > of the language. Hmm, yes and no. With the change, ':' remains a variable identifier and the new syntax is actually a macro: (define-macro (: mod-name var-name) (let ((var (module-variable (resolve-interface mod-name) var-name))) (if (not var) (error "no such public variable" (list ': mod-name var-name))) var)) That part is clean, I think, and doesn't change the lexical structure. It only depends on an implementational detail and does something officially that you can't do in Standard Scheme. However, Standard Scheme doesn't have a module system either, and from that point of view 'use-modules' etc already has changed the lexical structure significantly. > Note that we currently have an option which controls > whether the reader conforms to R5RS ("Extended alphabetic characters > may be used within identifiers as if they were letters.") or whether > colon is marking a keyword, and that this option is defaulted to R5RS. The reader is unchanged in the R5RS mode, only the non-R5RS mode now treats an isolated colon differently: ;; R5RS guile> (symbol? ':) #t guile> (keyword? '#:) #t ;; non-R5RS with the change guile> (read-set! keywords 'prefix) guile> (symbol? ':) #t guile> (keyword? '#:) #t ;; non-R5RS without the change guile> (read-set! keywords 'prefix) guile> (symbol? ':) #f guile> (keyword? ':) #t > I vote for using some syntax which is compatible with R5RS and would > urge you strongly to at least keep the possibility to be compatible > (=> new option controlling the interpretation of colon). Given that the syntax is compatible, do you think we still need an option for making (keyword ':) true again? Here are the ChangeLog entries for the actual changes: 2003-10-24 Marius Vollmer * read.c (scm_lreadr): Treat a single ':' always a symbol, never as an empty keyword. 2003-10-23 Marius Vollmer * eval.c (scm_m_generalized_set_x): Macroexpand the target when it is a list. This allows (: ...) to work with set!. * script.c (scm_compile_shell_switches): Use scm_c_read_string for the "-e" option instead of scm_str2symbol. This allows things like (: ...) to be specified for the entry point. -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel