From 1cf7ec6cbc8c26da7e287cf03457908026b4aba7 Mon Sep 17 00:00:00 2001 From: voidlizard Date: Fri, 21 Feb 2025 14:01:34 +0300 Subject: [PATCH] wip --- examples/dns-example-1/dns.ss | 6 +++++- .../lib/Data/Config/Suckless/Script/Internal.hs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/dns-example-1/dns.ss b/examples/dns-example-1/dns.ss index d90e356f..82ca19e9 100644 --- a/examples/dns-example-1/dns.ss +++ b/examples/dns-example-1/dns.ss @@ -76,11 +76,15 @@ (local txs (grep :propose (hbs2:refchan:tx:raw:list REFCHAN))) (local (hostname e) (car (cdr (car (top:string (bytes:decode [nth 4 _1]))))) ) (local peers (map (lambda [x] [car [cdr x]]) (car (call:proc hbs2-peer do peer-info)))) + (local peers2 (map [fn 1 [list (lookup:uw :key _1) (strip (lookup:uw :addr _1))]] peers)) + (local peers3 (filter [fn 1 [not (eq? [nth 1 _1] :192.168.1.1)]] peers2)) + (local state (map [fn 1 [list [nth 2 _1] [hostname _1] ]] txs)) - (local (entry e) [list [lookup:uw [nth 0 e] (cons self peers2)] [nth 1 e] ]) + (local (entry e) [list [lookup:uw [nth 0 e] (cons self peers3)] [nth 1 e] ]) (local res [map [fn 1 [entry _1]] state]) + res ) ) diff --git a/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs b/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs index 0470b3a4..6ac90930 100644 --- a/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs +++ b/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs @@ -1656,7 +1656,7 @@ internalEntries = do _ -> pure $ mkBool False entry $ bindMatch "not" $ \case - [w] -> pure (mkBool (isTrue w)) + [w] -> pure (mkBool (isFalse w)) _ -> throwIO (BadFormException @c nil) entry $ bindMatch "setenv" $ nil_ \case