From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Fwd: Guile interpeter crash Date: Tue, 01 Oct 2013 16:34:22 -0400 Message-ID: <8761tghgs1.fsf@netris.org> References: <87vc1hrpia.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1380659723 18758 80.91.229.3 (1 Oct 2013 20:35:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Oct 2013 20:35:23 +0000 (UTC) Cc: guile-devel To: Panicz Maciej Godek Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Oct 01 22:35:27 2013 Return-path: Envelope-to: guile-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 1VR6fG-0001Wv-KX for guile-devel@m.gmane.org; Tue, 01 Oct 2013 22:35:26 +0200 Original-Received: from localhost ([::1]:60925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR6fG-00084v-8z for guile-devel@m.gmane.org; Tue, 01 Oct 2013 16:35:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR6f7-0007x2-An for guile-devel@gnu.org; Tue, 01 Oct 2013 16:35:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VR6f2-0005RM-2z for guile-devel@gnu.org; Tue, 01 Oct 2013 16:35:17 -0400 Original-Received: from world.peace.net ([96.39.62.75]:56321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR6f2-00056O-01 for guile-devel@gnu.org; Tue, 01 Oct 2013 16:35:12 -0400 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1VR6ef-0002lc-5H; Tue, 01 Oct 2013 16:34:49 -0400 In-Reply-To: (Panicz Maciej Godek's message of "Tue, 1 Oct 2013 18:42:57 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16661 Archived-At: Panicz Maciej Godek writes: > ---------- Forwarded message ---------- > From: Panicz Maciej Godek > Date: 2013/10/1 > Subject: Re: Guile interpeter crash > To: Dmitry Bogatov > > 2013/10/1 Dmitry Bogatov > > Here is code that results crash (return 134). Hope it is > interesting. > > The code you gave is not a proper Scheme program. > C.f. > http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-8.html#%_ > sec_5.3, excerpt: > > Although macros may expand into definitions and syntax definitions in > any context that permits them, it is an error for a definition or > syntax definition to shadow a syntactic keyword whose meaning is > needed to determine whether some form in the group of forms that > contains the shadowing definition is in fact a definition, or, for > internal definitions, is needed to determine the boundary between the > group and the expressions that follow the group > > In other words, you cannot redefine define. It can be done safely using the module system, by calling it something other than 'define' in the module, and then renaming it on export. For example, see: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=module/ice-9/curried-definitions.scm;h=fa369906ccd222b6aa2f3692f17638ca02eb2a41;hb=HEAD In practice, there are ways to redefine 'define' within the same module in Guile 2.0, but it depends on implementation details and might not be future proof. > That being said, I don't think it's fortunate to use the # character > within a symbol. Yes, it's probably best to avoid that character in symbols. The fact that it happens to work is a quirk of our reader, and is undocumented. For the documented characters that are allowed in symbols, see: http://www.gnu.org/software/guile/manual/html_node/Symbol-Read-Syntax.html Regards, Mark