From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id QAILOkXi3GQ0DgAASxT56A (envelope-from ) for ; Wed, 16 Aug 2023 16:50:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IJLmOUXi3GRgYQAAauVa8A (envelope-from ) for ; Wed, 16 Aug 2023 16:50:45 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AFE253595F for ; Wed, 16 Aug 2023 16:50:45 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=ekcRcqiD; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692197445; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=qTmRGY1z1PpaY/u5COfLZmRUUsKm3YGg6IzXT7XdmmE=; b=bMGh3uncC7zUvHqOo4Y95ZQLV1/PLRsVgJVfPwcup8cXqHztNS6N6l14bv+kuENsjPxXsm xpyBHXt9i/dt0VbBDOfY2zQj3U18zMZT1Oqz7E1oL+h1KkEkxd7uNuu0EhuEeZB2qN49ZZ D3mJ0FKnfHI8J9lC5wy6izyXWGaHgM9RiWyHtUfOHvhTuD5H203mdaLTENbYOH8lURQLfY ZhqL3bLcCkLtaWjYx0sj6yNR4Pcthip6wBjhFY4zU8E8rsbsi33hvrnVG+mA8gn4ChbUmf SGo2Ku9VOyQy+5dkKPdu57ehJu76S9CqIxsNjDpZ0C7jXTSZb+40yUlGy8GRpA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=ekcRcqiD; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692197445; a=rsa-sha256; cv=none; b=Xx5O1pfMJTO8z1+yXInyTfXkFvvBH6gj/e4zmPfWAMudc4wMM0tztioteEHLbOQB/3wEH9 xFN3tBB/Zgw6Trjo0+dmMGQHolZL9ileupdLOyBuuf2JArbZLGkD7JeD3zCbUzlz+GgyRy jowfx/UEkKzM7tC6jzVXllr+EW5/63M/mprNbaIygLH/UAtvloyED79nJBY/KLQQ1e0P8k kFNgllFSQmsSacYBhlrpHBSBF8pMEGMb33By3VErFHNhVAtgv0l4xwG2njjouPlboCc58K TJdv3J7mUG8QHDI3E39xSVKhKHrrkMr3+BehnGf8yO3l6Heu8zB0NKx0iTBThA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWHqp-0005F7-Bz; Wed, 16 Aug 2023 10:50:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWHqi-0005E0-Nv for guix-devel@gnu.org; Wed, 16 Aug 2023 10:50:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWHqg-0000fq-Ek; Wed, 16 Aug 2023 10:50:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=qTmRGY1z1PpaY/u5COfLZmRUUsKm3YGg6IzXT7XdmmE=; b=ekcRcqiD0T1RwACHEIM9 lKQN2/LhYyYkgyyVRKZdt49yhmLonRvQVbGnd314vESGlS+ML9ysp9dbgU0MAprmK5il/CuLUSOut uJvX0rP65vGoCTJ3BJsWXcBfkNETcvJ02XrBStBPZnXC/eOsnXFoVtwuRUC8NVb4mu1IccHourbfH QN1fjGHR0QB+8c0ysD3nDc1BNp+N9r5RqhnZfkU/gKegtnZyKrIbU2Mmr3kgsVJo9wIk/j+7XViJG 0jxwfG25L20bMxGx01F4uC4dnLgFrwkZ23vN/STLI/lIlTySawomSqhOwnPyotyVlshthtk4JRPkg WXknhMCk3a2otA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Liliana Marie Prikler Cc: "(" , guix-devel@gnu.org Subject: Re: Proposal for search-input-file References: <875y5n3rgk.fsf@disroot.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Nonidi 29 Thermidor an 231 de la =?utf-8?Q?R=C3=A9vo?= =?utf-8?Q?lution=2C?= jour du Coton X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 16 Aug 2023 16:49:52 +0200 In-Reply-To: (Liliana Marie Prikler's message of "Tue, 15 Aug 2023 11:49:44 +0200") Message-ID: <87h6oz59f3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -10.92 X-Spam-Score: -10.92 X-Migadu-Queue-Id: AFE253595F X-Migadu-Scanner: mx2.migadu.com X-TUID: HHe3vJFAybOr Hi! Liliana Marie Prikler skribis: > (define* (search-input-file* inputs predicate > #:key (hint "")) > "Find the first file in INPUTS matching PREDICATE. The return value > of PREDICATE is returned as-is, so patterns like=C2=A0 > (search-input-file* inputs > (lambda (parent) > (and (file-exists?=C2=A0(string-append parent \"/lib/foobar.so\")) > (string-append parent \"/lib\")))) > work as expected. > > When PREDICATE returns no match, raise a search error using HINT for a > file name." This would be equivalent to: (dirname (search-input-file inputs "/lib/libfoo.so")) right? Another option would be a procedure that does precisely that: return the parent. Thoughts? Ludo=E2=80=99.