guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with map match


From: swedebugia
Subject: Help with map match
Date: Fri, 30 Nov 2018 00:13:26 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]