From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexei Matveev Newsgroups: gmane.lisp.guile.user Subject: Re: Determining programatically whether the interpreter is Guile or Clisp or Emcs Date: Wed, 31 Jul 2013 12:24:15 +0200 Message-ID: References: <23837d79-03e3-4792-a4b7-e3a6c96ed390@email.android.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2e5f49dc16004e2cc205c X-Trace: ger.gmane.org 1375266272 12857 80.91.229.3 (31 Jul 2013 10:24:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Jul 2013 10:24:32 +0000 (UTC) Cc: guile-user@gnu.org To: =?UTF-8?B?55m944GE54aK?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Jul 31 12:24:35 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 1V4Ta5-0001RY-1M for guile-user@m.gmane.org; Wed, 31 Jul 2013 12:24:33 +0200 Original-Received: from localhost ([::1]:60609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4Ta4-0007xm-A3 for guile-user@m.gmane.org; Wed, 31 Jul 2013 06:24:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4TZt-0007xR-Tz for guile-user@gnu.org; Wed, 31 Jul 2013 06:24:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4TZo-0006IV-G3 for guile-user@gnu.org; Wed, 31 Jul 2013 06:24:21 -0400 Original-Received: from mail-oa0-x22d.google.com ([2607:f8b0:4003:c02::22d]:46239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4TZo-0006I9-8r for guile-user@gnu.org; Wed, 31 Jul 2013 06:24:16 -0400 Original-Received: by mail-oa0-f45.google.com with SMTP id m1so1087645oag.4 for ; Wed, 31 Jul 2013 03:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=dPaiDlOm2xkCTJfe6740/I3GNVcq8/YEUWNs6EgJKA0=; b=FadssBQKdS+XBhQrSmRspgBnvtf9c5DpCA5/VwtqLY3/aXKMf1KDWA5kzmlpraE7ml muVXxEHsReZTJ9seHP9lVAcx8MHIupppiHfi1NvSWZjNA+zumbVpDEjq0SDTUaeD0FzN ZiKLguPvZ0Iecj3XzkR7a1MWdO1wISME6JpKBszg+tYROX/p+3o2uBRML7Oqv5ZyQp5e WsJBI+dtoAgwXqb9C5XfgE8UukRCrp+KaSP+zKW+wA4SGKaYjPsPxtwaFddfImH0NREM McsBvJB2AeUut4Gg3CcRKdP+vs61opzFgzQibeJq+y5N6L2tjBzoepofH0F6zDhlpF3z x8hA== X-Received: by 10.60.43.73 with SMTP id u9mr13400417oel.105.1375266255255; Wed, 31 Jul 2013 03:24:15 -0700 (PDT) Original-Received: by 10.182.109.229 with HTTP; Wed, 31 Jul 2013 03:24:15 -0700 (PDT) In-Reply-To: <23837d79-03e3-4792-a4b7-e3a6c96ed390@email.android.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::22d 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:10591 Archived-At: --001a11c2e5f49dc16004e2cc205c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 29 July 2013 10:21, =E7=99=BD=E3=81=84=E7=86=8A wrote: > Hello: > > I'm developping a program which I'd like to be able to use without > modification with Guile as the interpreter as well as Emacs lisp and clis= p. > > Cond-expand macro was supposed to assist "conditional compilation", see an example below. I am not sure if all implementations you are interested in supply it though. Alexei ;;; ;;; Module/package systems differ between implementaitons: ;;; (cond-expand (guile ;; ;; Primary implementation: ;; (define-module (guile scheduling) #:use-module (ice-9 pretty-print) #:use-module (srfi srfi-1) ; list manipulations #:export (qm-mpts->npts)) ;; To get rid of deprecation warning make import of syncase ;; conditional: (cond-expand ((not guile-2) (use-modules (ice-9 syncase))) ; define-syntax (else))) ; else nothing (else ;; ;; MzScheme, aka PLT Scheme, aka Racket (needs cond-expand macro in ;; ~/.mzschmerc): ;; (require (lib "1.ss" "srfi")) (define (1+ x) (+ 1 x)) (define (sorted? lst pred?) #t))) ; FIXME: lies! --001a11c2e5f49dc16004e2cc205c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 29 July 2013 10:21, =E7=99=BD=E3=81= =84=E7=86=8A <guile-user_gnu.org@sumou.com> wrote= :
Hello:

I'm developping a program which I'd like to be able to use without = modification with Guile as the interpreter as well as Emacs lisp and clisp.=


Cond-expand macro was supposed to assist "co= nditional compilation",
see an example below. I am not sure if all = implementations you are
interested in supply it though.

Alexei
;;;
;;; Module/package systems differ between implementaitons:
;;= ;
(cond-expand
=C2=A0(guile
=C2=A0 ;;
=C2=A0 ;; Primary impleme= ntation:
=C2=A0 ;;
=C2=A0 (define-module (guile scheduling)
=C2=A0= =C2=A0=C2=A0 #:use-module (ice-9 pretty-print)
=C2=A0=C2=A0=C2=A0 #:use-module (srfi srfi-1)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 ; list manipulations
=C2=A0=C2=A0=C2=A0 #:expor= t (qm-mpts->npts))
=C2=A0 ;; To get rid of deprecation warning make i= mport of syncase
=C2=A0 ;; conditional:
=C2=A0 (cond-expand
=C2=A0= =C2=A0 ((not guile-2) (use-modules (ice-9 syncase))) ; define-syntax
=C2=A0=C2=A0 (else)))=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ; else nothing
=C2=A0(else
=C2=A0 ;;
=C2=A0 ;; = MzScheme, aka PLT Scheme,=C2=A0 aka Racket (needs cond-expand macro in
= =C2=A0 ;; ~/.mzschmerc):
=C2=A0 ;;
=C2=A0 (require (lib "1.ss&qu= ot; "srfi"))
=C2=A0 (define (1+ x) (+ 1 x))
=C2=A0 (define (sorted? lst pred?) #t)))= =C2=A0=C2=A0=C2=A0=C2=A0 ; FIXME: lies!
--001a11c2e5f49dc16004e2cc205c--