!9IQChSjwSHXPPWTa:lix.systems

Lix

1102 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms294 Servers

Load older messages


SenderMessageTime
15 Nov 2025
@k900:0upti.meK900 Well it would return whatever the fuck builtins.match returns already 18:39:30
@522_:catgirl.cloud522 it/its ⛯ΘΔoh does match allow capture groups18:39:43
@k900:0upti.meK900Yes18:40:06
@aftix:matrix.orgaftixin JS, the regex syntax creates a RegExp object, but in nix regexes are just strings anyways18:40:09
@k900:0upti.meK900In an exceptionally cursed way18:40:09
@k900:0upti.meK900
nix-repl> builtins.match "a" "a"
[ ]

nix-repl> builtins.match "(a)" "a"
[ "a" ]

nix-repl> builtins.match "a" "b"   
null
18:40:37
@522_:catgirl.cloud522 it/its ⛯ΘΔah funny18:40:53
@k900:0upti.meK900Not the word I'd use18:41:01
@347online:matrix.orgKatie I was thinking you could pass /foo/ as the first argument to builtins.match, but I suppose if we continue looking at JavaScript, you could do builtins.match /foo/.source 18:41:39
@antifuchs:asf.computerantifuchs“Truthy”18:41:42
@aloisw:julia0815.dealoisw More that it simply doesn't really have regexes at all and just offers some builtins that parse the regex at runtime. 18:41:42
@347online:matrix.orgKatieit could "compile" to an attrset18:41:50
@k900:0upti.meK900 But like, how would it be different from "foo" then 18:42:09
@antifuchs:asf.computerantifuchsGotta love using a language made when truthiness and falsiness was still considered socially ok18:42:11
@aloisw:julia0815.dealoisw What's so cursed about this? 18:42:15
@k900:0upti.meK900 It returns a conventionally falsy value for both match and no match 18:42:46
@347online:matrix.orgKatie and have /foo/.match be essentially syntax sugar for builtins.match /foo/.source 18:42:37
@k900:0upti.meK900FOr one18:42:48
@k900:0upti.meK900* For one18:42:50
@aloisw:julia0815.dealoisw In what sense is the empty list "conventionally falsy"? 18:43:22
@k900:0upti.meK900 In the any other language but Nix sense 18:43:56
@347online:matrix.orgKatieempty list is truthy in JS18:44:50
@aloisw:julia0815.dealoisw That's straight up not going to work because /foo/.match is a path literal. And yes, you could make it work with a space, but at the cost of introducing another footgun if the user forgets that space. 18:45:01
@347online:matrix.orgKatie which I think why no match returns null 18:45:05
@k900:0upti.meK900I said language18:45:30
@k900:0upti.meK900Not eldritch abomination18:45:30
@347online:matrix.orgKatieMMMM... got it, yes, that is a problem18:45:37
@347online:matrix.orgKatiemaybe (/foo/).match18:45:50
@347online:matrix.orgKatieor maybe a different bookend token18:46:10
@347online:matrix.orgKatie|foo|18:46:18

Show newer messages


Back to Room ListRoom Version: 10