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: execlp Date: Wed, 23 Nov 2011 20:28:56 +0800 Message-ID: References: <4ECBC87E.7090000@bioch.ox.ac.uk> <4ECCE42F.8030404@bioch.ox.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf3078118046472204b26610a8 X-Trace: dough.gmane.org 1322051355 17817 80.91.229.12 (23 Nov 2011 12:29:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2011 12:29:15 +0000 (UTC) Cc: guile-user@gnu.org To: Paul Emsley Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Nov 23 13:29:11 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RTBws-0005SF-92 for guile-user@m.gmane.org; Wed, 23 Nov 2011 13:29:10 +0100 Original-Received: from localhost ([::1]:49433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTBwr-0006oz-OV for guile-user@m.gmane.org; Wed, 23 Nov 2011 07:29:09 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:48215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTBwj-0006oB-AT for guile-user@gnu.org; Wed, 23 Nov 2011 07:29:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTBwf-0002sh-0U for guile-user@gnu.org; Wed, 23 Nov 2011 07:29:01 -0500 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:56526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTBwe-0002sd-TI for guile-user@gnu.org; Wed, 23 Nov 2011 07:28:56 -0500 Original-Received: by vbbfn1 with SMTP id fn1so1435155vbb.0 for ; Wed, 23 Nov 2011 04:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mxx0YxO9KE313K5nKF7zvbNadHz0iv3w9ADKvwcoK0E=; b=D5VoQ13fVs8m3w83FRa9kMNyn8qCdbWiwKI5vhSc59dY/Rx9kfs0adcbzsi501QY4E +MhD71VVE+erz822vC+RquL7SFU8GGSQYN/1CVRmqAwf6X4Fo9kRGVSKZBTc94QC7KV4 LyugvkFY7uDZjO915Ic9SNWZ38322QImr4lao= Original-Received: by 10.52.25.75 with SMTP id a11mr25349907vdg.1.1322051336291; Wed, 23 Nov 2011 04:28:56 -0800 (PST) Original-Received: by 10.52.31.165 with HTTP; Wed, 23 Nov 2011 04:28:56 -0800 (PST) In-Reply-To: <4ECCE42F.8030404@bioch.ox.ac.uk> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.41 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:8980 Archived-At: --20cf3078118046472204b26610a8 Content-Type: text/plain; charset=UTF-8 On Wed, Nov 23, 2011 at 8:16 PM, Paul Emsley wrote: > Hi Nala Ginrut, > > Thanks for your reply. > > I suspect I expressed myself poorly. (execlp "ls" "") replaces guile with > "ls", which lists my files and returns me to the shell. > > What is some-function, where some-function works like this: > > (some-function "ls") > -> "/bin/ls" (I'd settle for #t") > (some-function "asdfasdf") > -> #f > > I thought that execl or its friends would be the way to answer that > question... > > I think there's no such a given function in Guile to do this. But you can make it in a easy way in Guile: (catch 'system-error (lambda () (execlp "asdfasdf")) (lambda (k . e) (format #t "oh no~%~"))) PS: Maybe you need #f instead of "format" according to your letter. ;-) --20cf3078118046472204b26610a8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Wed, Nov 23, 2011 at 8:16 PM, Paul Em= sley <pa= ul.emsley@bioch.ox.ac.uk> wrote:
Hi Nala Ginrut,

Thanks for your reply.

I suspect I expressed myself poorly. (execlp "ls" "") r= eplaces guile with "ls", which lists my files and returns me to t= he shell.

What is some-function, where some-function works like this:

(some-function "ls")
-> "/bin/ls" =C2=A0(I'd settle for #t")
(some-function "asdfasdf")
-> #f

I thought that execl or its friends would be the way to answer that questio= n...


I think there's no such a given fu= nction in Guile to do this.
But you can make it in a easy way in = Guile:
(catch 'system-error =C2=A0
=C2=A0 =C2= =A0 (lambda () (execlp "asdfasdf"))=C2=A0
=C2=A0 =C2=A0 =C2=A0 (lambda (k . e)=C2=A0
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(format #t "oh no~%~")))

PS: Maybe you need #f instead of "format" according to yo= ur letter. ;-)

--20cf3078118046472204b26610a8--