From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.user Subject: Re: Determining programatically whether the interpreter is Guile or Clisp or Emcs Date: Mon, 29 Jul 2013 19:32:25 +0800 Message-ID: References: <23837d79-03e3-4792-a4b7-e3a6c96ed390@email.android.com> <1375086985.8252.2.camel@Renee-desktop.suse> <66a9b4c8-96e9-421e-b74d-2eb48d26e603@email.android.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0149d17abca7b304e2a4d8c2 X-Trace: ger.gmane.org 1375097559 397 80.91.229.3 (29 Jul 2013 11:32:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Jul 2013 11:32:39 +0000 (UTC) Cc: Guile User To: =?UTF-8?B?55m944GE54aK?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jul 29 13:32:44 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 1V3lgx-0002WW-PZ for guile-user@m.gmane.org; Mon, 29 Jul 2013 13:32:44 +0200 Original-Received: from localhost ([::1]:55971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3lgx-00053u-BN for guile-user@m.gmane.org; Mon, 29 Jul 2013 07:32:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3lgh-0004x9-Jx for guile-user@gnu.org; Mon, 29 Jul 2013 07:32:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3lgg-0004N4-CU for guile-user@gnu.org; Mon, 29 Jul 2013 07:32:27 -0400 Original-Received: from mail-ob0-x22d.google.com ([2607:f8b0:4003:c01::22d]:62703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3lgg-0004Mw-7G for guile-user@gnu.org; Mon, 29 Jul 2013 07:32:26 -0400 Original-Received: by mail-ob0-f173.google.com with SMTP id er7so9121581obc.32 for ; Mon, 29 Jul 2013 04:32:25 -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=+cfBYll1eFipGaZSo6coa/Hp74NgEhFTcQbkk4k9x+4=; b=joXUUHEqI3Y69jwa5X1KZDralVCkyjQQ7nUwCApMVO/3H2kRxxGn3bxsfLy/xLbHDG j0pH9kElMZJbZO/+OPxXMtPPqjBuFX/dQjMks2VzsZj7NcowN9f/KK84gGMLwD7Zyyq2 Mzia530fS47poO5uc4S8JWgM8xQrbVg/JS7EoqcRXZ19qs1pyGLqV2wlUA8meyxCO4Qv YJ9kOmD0ooAZkfwBCgxpbFGzgO5gtBJ7/tAF1c6VErs7KGaARq9Kp6PpT8Q2ONe4Os8f 2JIh3qKsOyKKmsCpCknnv7XBE01WlUOdREfLiNVysQafDeFAMG21yLjAIJsFs+V12NhS GS+A== X-Received: by 10.60.56.166 with SMTP id b6mr20009659oeq.38.1375097545596; Mon, 29 Jul 2013 04:32:25 -0700 (PDT) Original-Received: by 10.182.221.168 with HTTP; Mon, 29 Jul 2013 04:32:25 -0700 (PDT) Original-Received: by 10.182.221.168 with HTTP; Mon, 29 Jul 2013 04:32:25 -0700 (PDT) In-Reply-To: <66a9b4c8-96e9-421e-b74d-2eb48d26e603@email.android.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::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:10583 Archived-At: --089e0149d17abca7b304e2a4d8c2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I think the most efficient way is to use 'cpp' of gcc to do the pre-processer, or you have to try eval-when, please read the manual for it. =E5=9C=A8 2013-7-29 PM7:23=EF=BC=8C"=E7=99=BD=E3=81=84=E7=86=8A" =E5=86=99=E9=81=93=EF=BC=9A > Nala Ginrut wrote: > > >> I would like to program for Guile as the lowest denominator. > >> > >> What is the proper check I should define that would tell me whether > >I'm currently interpreting the code in Guile, or Emacs, or Crisp. > >> > > > >If you just want to check whether a symbol was defined, try: > >(module-defined? (current-module) 'function-lambda-expression) > > Hi: > > Thanks for the tip. > > What I'm trying to do: I have a host of kx-... functions which I want t= o > call from any interpreter with the same syntax, i.e. let's say for > instance (kx-file-open "funny-file.txt") > > Now, within the kx-file-open I need to find out whether I'm in guile or > clisp or emacs, via a function call, let's say kx-interpreter. > > This function should return let's say 0 for guile, 1 for clisp and 2 for > emacs. Based on this, the file open function will use the appropriate lis= p > syntax for opening the file. > > Now I'm wondering what the most effective / fastest way is to find out no= t > whether a symbol is defined, but basically the answer to the self-awarene= ss > question: am I in guile, or am I in emacs... > > -- > =E7=99=BD=E3=81=84=E7=86=8A > > --089e0149d17abca7b304e2a4d8c2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I think the most efficient way is to use 'cpp' of gc= c to do the pre-processer, or you have to try eval-when, please read the ma= nual for it.

=E5=9C=A8 2013-7-29 PM7:23=EF=BC=8C"=E7=99= =BD=E3=81=84=E7=86=8A" <guile-user_gnu.org@sumou.com>=E5=86=99=E9=81=93=EF=BC=9A
Nala Ginrut <nalaginrut@gmail.co= m> wrote:

>> I would like to program for Guile as the lowest denominator.
>>
>> What is the proper check I should define that would tell me whethe= r
>I'm currently interpreting the code in Guile, =C2=A0or Emacs, =C2= =A0or Crisp.
>>
>
>If you just want to check whether a symbol was defined, try:
>(module-defined? (current-module) 'function-lambda-expression)

Hi:

Thanks for the tip.

What I'm trying to do: =C2=A0I have a host of kx-... =C2=A0functions wh= ich I want to call from any interpreter with the same syntax, =C2=A0i.e. = =C2=A0let's say for instance (kx-file-open "funny-file.txt")<= br>
Now, =C2=A0within the kx-file-open I need to find out whether I'm in gu= ile or clisp or emacs, via a function call, let's say kx-interpreter.
This function should return let's say 0 for guile, 1 for clisp and 2 fo= r emacs. Based on this, the file open function will use the appropriate lis= p syntax for opening the file.

Now I'm wondering what the most effective / fastest way is to find out = not whether a symbol is defined, but basically the answer to the self-aware= ness question: am I in guile, or am I in emacs...

--
=E7=99=BD=E3=81=84=E7=86=8A

--089e0149d17abca7b304e2a4d8c2--