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: Wed, 31 Jul 2013 10:27:40 +0800 Organization: HFG Message-ID: <1375237660.8252.42.camel@Renee-desktop.suse> 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: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1375237692 2767 80.91.229.3 (31 Jul 2013 02:28:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Jul 2013 02:28:12 +0000 (UTC) Cc: guile-user@gnu.org To: =?UTF-8?Q?=E7=99=BD=E3=81=84=E7=86=8A?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Jul 31 04:28:13 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 1V4M95-0002NE-5D for guile-user@m.gmane.org; Wed, 31 Jul 2013 04:28:11 +0200 Original-Received: from localhost ([::1]:48504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4M94-00070T-Np for guile-user@m.gmane.org; Tue, 30 Jul 2013 22:28:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4M8o-000707-2U for guile-user@gnu.org; Tue, 30 Jul 2013 22:28:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4M8f-00076E-Ip for guile-user@gnu.org; Tue, 30 Jul 2013 22:27:53 -0400 Original-Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]:46664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4M8f-000768-CX for guile-user@gnu.org; Tue, 30 Jul 2013 22:27:45 -0400 Original-Received: by mail-pd0-f171.google.com with SMTP id y14so168455pdi.30 for ; Tue, 30 Jul 2013 19:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :organization:content-type:x-mailer:mime-version :content-transfer-encoding; bh=1s+1jGBviBAIsP4r7booQBQTEbNKkAHDKlIm/2e5CEA=; b=OHy01b0EDy0Lz0lWJ1OQUGsDcdnGg61dgJGeVJ4BeIMWQqV+kcNvmRg6CSD0rQjj4t qq2VQinwkOtMkdI3+t+1g5Di25p/Dovr7bnBvjdYPsgIYBTE2YJ69z7V7DOovzYKGgo6 fFJZ7QthdT2yOnu7odI/m7sUfjz70GpzBs7TKEL0zCs/7DYjDfKXRxOkIIYm+XiGLhOs drcYxYxxUMdkt8pTERJEy5p97soxx4jpJuKHdenrDsEMaAWotBb9I/J4+OTnZaddwVte CvQAZJve3YPtZG+CBfigKLxwnKy5G2be65fEp8ZP9RlfL6Ofmr8wTU//HKE/HQ65rlFU lBhw== X-Received: by 10.66.163.7 with SMTP id ye7mr79104247pab.24.1375237664372; Tue, 30 Jul 2013 19:27:44 -0700 (PDT) Original-Received: from [147.2.147.115] ([203.192.156.9]) by mx.google.com with ESMTPSA id bb1sm76239925pbc.10.2013.07.30.19.27.42 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Tue, 30 Jul 2013 19:27:43 -0700 (PDT) In-Reply-To: <66a9b4c8-96e9-421e-b74d-2eb48d26e603@email.android.com> X-Mailer: Evolution 3.4.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::22b 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:10585 Archived-At: On Mon, 2013-07-29 at 15:21 +0400, 白い熊 wrote: > 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 to 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. > I have no better idea but I think it can be handled by 'catch exception', but I don't think guile/clisp/emacs have same procedure named 'catch' or else. > 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 lisp 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-awareness question: am I in guile, or am I in emacs... > Here's a dilemma, unless guile/clisp/emacs have the same checker-procedure with same name and definition, you have no promise to check it under different language environment. The best way is prepossess which is portable. Maybe there's better idea I didn't know? Thanks!