From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.user Subject: Re: execlp Date: Wed, 23 Nov 2011 20:18:23 +0100 Message-ID: <87y5v6ejgg.fsf@ambire.localdomain> 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: text/plain X-Trace: dough.gmane.org 1322076165 19055 80.91.229.12 (23 Nov 2011 19:22:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2011 19:22:45 +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 20:22:41 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 1RTIP2-00085R-Sa for guile-user@m.gmane.org; Wed, 23 Nov 2011 20:22:40 +0100 Original-Received: from localhost ([::1]:33192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTIP2-0000E8-Dm for guile-user@m.gmane.org; Wed, 23 Nov 2011 14:22:40 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:53394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTIOy-0000E2-WF for guile-user@gnu.org; Wed, 23 Nov 2011 14:22:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTIOx-0007rC-W6 for guile-user@gnu.org; Wed, 23 Nov 2011 14:22:36 -0500 Original-Received: from smtp205.alice.it ([82.57.200.101]:52958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTIOx-0007pd-JM for guile-user@gnu.org; Wed, 23 Nov 2011 14:22:35 -0500 Original-Received: from ambire.localdomain (95.233.75.189) by smtp205.alice.it (8.6.023.02) id 4ECA5FDA006B9661; Wed, 23 Nov 2011 20:21:02 +0100 Original-Received: from ttn by ambire.localdomain with local (Exim 4.69) (envelope-from ) id 1RTIKu-0002LV-68; Wed, 23 Nov 2011 20:18:24 +0100 In-Reply-To: <4ECCE42F.8030404@bioch.ox.ac.uk> (Paul Emsley's message of "Wed, 23 Nov 2011 12:16:47 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.101 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:8990 Archived-At: () Paul Emsley () Wed, 23 Nov 2011 12:16:47 +0000 What is some-function, where some-function works like this: (some-function "ls") -> "/bin/ls" (I'd settle for #t") (some-function "asdfasdf") -> #f You can try something like: (use-modules (srfi srfi-13) (srfi srfi-14)) (define (some-function program) (and=> (search-path (string-tokenize (getenv "PATH") (char-set-complement (char-set #\:))) program) (lambda (filename) (and (access? filename X_OK) filename))))