IRC channel logs
2021-06-26.log
back to list of logs
<sneek>I've been running for 21 hours <apteryx>I want the macro to expand into multile substitute* usages (one per file). <apteryx>seems I'm forced to strip the last ... and manually repeatedly use the 'disable-tests' macro <leoprikler>apteryx I think you'll need to express that as a syntax-case, but I can't help you write it :P <lampilelo>apteryx: i think just wrapping substitute call and the ellipsis with begin should work <bricewge>How can I get from such data sctrucutre “'(("user" . ("alice" "bob" "eve")) ("admin" . ("alice")))” to “'(("alice" . ("admin" "user")) ("bob" . ("user")) ("eve" . ("user")))”? <leoprikler>bricewge: first (append-map cdr groups+users) and delete-duplicates <leoprikler>then per user (filter-map (lambda (group) (and (member user group) (car group))) groups+users) <leoprikler>gives you a list of groups, which finally you can cons to the users to get the restructured alist <leoprikler>your data is already an alist, so that works out <bricewge>Is that a convention to call alist key+value, like the previous groups+users? <bricewge>Yes, but is it a convention to name an alist variable "key+value" as leoprikler did with "groups+users"? <tekakutli>hello gentlement, finally decided to give guile a go <lampilelo>it depends on a context, #:foo is a keyword, which is just like a symbol but (symbol? #:foo) => #f and (keyword? 'foo) => #f <lampilelo>#f and #t are booleans, don't have anything to do with keywords <tekakutli>thanks, I know, I was refering specifically to the # <lampilelo>by itself it doesn't mean anything, just a part of a syntax <leoprikler>bricewge: key+value is a semantic variable here, you can name your variables however you want <leoprikler>I personally do write this occasionally and there's also a procedure called car+cdr which for alists exactly produces key+value as multiple values <chrislck>even more confusing #(1 2 3) is shorthand for (vector 1 2 3) <chrislck>and wingo has uncovered some unusual bugs involving # recently in the reader <dsmith>#/ice-9/foo used to be reader syntax for modules <rlb>wingo: while I'm still not certain I understand things well, I wondered if this might be feasible as a follow up to 0cc799185576712d69f11fc794454f2f5447bef7: <rlb>--- a/module/ice-9/psyntax.scm <rlb>+++ b/module/ice-9/psyntax.scm <rlb>@@ -2157,6 +2157,8 @@ <rlb> (gen-syntax src #'(e1 e2 ...) r maps ellipsis? mod)) <rlb> (lambda (e maps) (values (gen-vector e) maps)))) <rlb>+ (x (eq? (syntax->datum #'x) #nil) <rlb>+ (values '(quote #nil) maps)) <rlb> (() (values '(quote ()) maps)) <rlb> (_ (values `(quote ,e) maps)))))) <rlb>I'll need to triple-check, but that just includes a case for #nil alongside the patch's original case for (), and it does fix the problems with lokke.