From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.sources Subject: Re: xdgdirs 1.0 Date: Sat, 07 Sep 2013 10:36:38 +0200 Message-ID: <87y579xc2x.fsf@pobox.com> References: <87hadzczww.fsf@zigzag.favinet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1378543032 12277 80.91.229.3 (7 Sep 2013 08:37:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Sep 2013 08:37:12 +0000 (UTC) Cc: guile-user@gnu.org, guile-sources@gnu.org To: Thien-Thi Nguyen Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Sep 07 10:37:16 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 1VIE16-0001om-4l for guile-user@m.gmane.org; Sat, 07 Sep 2013 10:37:16 +0200 Original-Received: from localhost ([::1]:41157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIE15-0006iu-Pe for guile-user@m.gmane.org; Sat, 07 Sep 2013 04:37:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIE0t-0006im-RD for guile-user@gnu.org; Sat, 07 Sep 2013 04:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VIE0p-0008Uh-6G for guile-user@gnu.org; Sat, 07 Sep 2013 04:37:03 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:52719 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIE0Z-0008QA-E7; Sat, 07 Sep 2013 04:36:43 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 0AF72EE17; Sat, 7 Sep 2013 04:36:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=UblIZ0sCYs1+RFUkrj+jlDNwFkQ=; b=qZ4Q9v BS97Ym2nuruH1H6qjmLHvPyegi/obzPW456NJKIJsSX8ldkbSvyO+jUbau0dmhbH Ep4a69107WQuVd64UITmFj/hcBnmoB8Wlbxf9Ma7E1xDJuSBcSRLe6hmBezzeAHD sutvWisq0pjpboGDweyF93gyywPsKEqY1UMNQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=StKar75DYM+7WD6fQmWRivf0I8h98aLq k/AK83gPGC8cZ9P/1bXdZ6AZ1V3ALERn4i1dW7rQofMiyxx7fmwE1LEB6Ytb1wuS +Bjn7aLLtk4hawl5I8iSKZI/uYwSsIvksiNIvMvCGB9jctQ4U1G05Ghy4MwDyGxn fKoYG1sx4s8= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 01899EE16; Sat, 7 Sep 2013 04:36:42 -0400 (EDT) Original-Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 569CAEE15; Sat, 7 Sep 2013 04:36:41 -0400 (EDT) In-Reply-To: <87hadzczww.fsf@zigzag.favinet> (Thien-Thi Nguyen's message of "Thu, 05 Sep 2013 12:42:55 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Pobox-Relay-ID: 9E9CF3D2-1798-11E3-9708-CE710E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 208.72.237.25 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:10758 gmane.lisp.guile.sources:425 Archived-At: Just a bunch of random things. No opinion about module names, etc :) On Thu 05 Sep 2013 12:42, Thien-Thi Nguyen writes: > (define mentioned? > (let ((cl (command-line))) > (lambda (opt) > (member opt cl)))) You could do this as (cute member <> (command-line)), having imported srfi-26. > (cond ((mentioned? "--help") > (use-modules (ice-9 documentation)) > (fso "~A~%" (file-commentary (car (command-line)))) > (exit #t))) Here I think "when" is much more readable. Also, you can use "(current-file-name)" for a more reliable way to get the current file name. > (cond ((mentioned? "--version") > (fso "xdgdirs ~A~%~A~%" VERSION COPYRIGHT) > (fso "~A ~A~%~A~%~A~%" > "License GPLv3+: GNU GPL version 3 or later" > "" > "This is free software: you are free to change and redistribute it." > "There is NO WARRANTY, to the extent permitted by law.") > (exit #t))) You can use (ice-9 command-line)'s version-etc. Regards, Andy -- http://wingolog.org/