From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.user Subject: Re: More Guile 1.8 code failing in 2.x Date: Wed, 27 Feb 2013 15:28:32 +0100 Message-ID: <87zjypx23z.fsf@gnu.org> References: <1361959643.2097.179.camel@debian-box.lan> <87mwupao7n.fsf@markwitmer.com> <1361974971.2097.194.camel@debian-box.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1361992298 1515 80.91.229.3 (27 Feb 2013 19:11:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Feb 2013 19:11:38 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Feb 27 20:12:02 2013 Return-path: Envelope-to: guile-user@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 1UAmQ3-0006wr-NA for guile-user@m.gmane.org; Wed, 27 Feb 2013 20:11:59 +0100 Original-Received: from localhost ([::1]:38029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAmPf-0007xn-Ea for guile-user@m.gmane.org; Wed, 27 Feb 2013 14:11:35 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAhzx-00039z-Nn for guile-user@gnu.org; Wed, 27 Feb 2013 09:28:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAhzw-0005ht-Mx for guile-user@gnu.org; Wed, 27 Feb 2013 09:28:45 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:52139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAhzw-0005h8-7A for guile-user@gnu.org; Wed, 27 Feb 2013 09:28:44 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UAi0E-0004Ga-DI for guile-user@gnu.org; Wed, 27 Feb 2013 15:29:02 +0100 Original-Received: from pluto.sophia.inria.fr ([138.96.204.192]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Feb 2013 15:29:02 +0100 Original-Received: from ludo by pluto.sophia.inria.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Feb 2013 15:29:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 19 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pluto.sophia.inria.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?utf-8?Q?Vent=C3=B4se?= an 221 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:Msem8i4scLUVqokGohVjzaPOgHc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-Mailman-Approved-At: Wed, 27 Feb 2013 14:09:12 -0500 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10153 Archived-At: Richard Shann skribis: > (if (defined? 'define-once) > (define-once ToggleTripleting::InsideTriplet #t) > (eval-string "(if (not (defined? 'ToggleTripleting::InsideTriplet)) > (define ToggleTripleting::InsideTriplet #t))")) Rather something along these lines: (cond-expand ((not guile-2) (define-macro (define-once var expr) `(if (not (defined? ',var)) (define ,var ,expr)))) (guile-2 #t)) This will do nothing on Guile 2.0, and will define ‘define-once’ on 1.8. HTH, Ludo’.