From mboxrd@z Thu Jan 1 00:00:00 1970 From: swedebugia Subject: Help with map match Date: Fri, 30 Nov 2018 00:13:26 +0100 Message-ID: <6608cd4f-b96a-c8cb-4cc6-d3c0bb080f94@riseup.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSVP9-0008Q2-WE for guix-devel@gnu.org; Thu, 29 Nov 2018 18:07:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSVP5-0007th-QG for guix-devel@gnu.org; Thu, 29 Nov 2018 18:07:31 -0500 Received: from mx1.riseup.net ([198.252.153.129]:36123) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gSVP5-0007tA-IS for guix-devel@gnu.org; Thu, 29 Nov 2018 18:07:27 -0500 Received: from piha.riseup.net (piha-pn.riseup.net [10.0.1.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 00D981A0CA1 for ; Thu, 29 Nov 2018 15:07:23 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by piha.riseup.net with ESMTPSA id 6380A687A1 for ; Thu, 29 Nov 2018 15:07:23 -0800 (PST) Content-Language: en-US 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+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel Hi I'm trying to learn how to check in guile if a node package matches one of the items in my blacklist. First version was with (member pkg-name blacklist) and it worked but forces me to write down all the blacklisted packages which is tedious when I can just regex match if it begins with the same name. Now i'm trying to do the same with match and I could not find any examples or guides on the subject that I understood. :-/ blacklist $1 = ("matcha" "webpack" "rollup-plugin-node-resolve" "browserify" "electron" "statsd" "vega" "grunt-release" "lineman" "lineman-angular") I want the procedure to return #t if a match is found and I want it to match if it begins with the same e.g. "rollup-plugin" should match "rollup-plugin-node-resolve" and return #t Else #f This did not work: (use-modules (ice-9 match)) (define x '("ts" "test")) (map (match x ("test") #t) (else #f) x) Any ideas? -- Cheers Swedebugia