IRC channel logs
2024-12-26.log
back to list of logs
<lechner>that leaves me with my macro. would someone please offer their help to expand this macro to multiple variables? thanks! https://bpa.st/PPTQ <mwette>(define-syntax-rule (wpv (var ...) exp ...) ((lambda (var ...) exp ...) var ...)) <lechner>dsmith / thanks! I tried to read that two weeks ago---although under a different link, i think---and will try again <mwette>lecnher: ^ (wpv == with-preserved-values) should work, I think <mwette>Oh, unless some of those are globals access from body via indirect calls. So, maybe not. <dsmith>I think some recursion will need to be involved.. One level for each variable remember. <dsmith>This is basically an attempt at dynamic scoping? <mwette>let => one lambda; let* => one lambda per var <lechner>okay, I forgot I can use a dotted tail like (variable . more-variables) which will make recursion easier <dsmith>Of course, naming things is hard <lechner>dsmith / thanks! i was thinking about something like the second one. pursuant to your recommendation, i'm reading a bunch about macros. why is "(arg arg* ...)" superior to "(arg .args)" please? <dsmith>I don't know. Just fits my mental model better? If in your pattern you have "(k v) ..." then in your template you can have "k ..." and "v ..." Can you do that with a dotted tail? <dsmith>As in a let being transformed into a lambda, for example. <dsmith>(let ((binding value) ...) body body* ...) -> ((lambda (binding ...) body body* ...) value ...) (I think I got that right) <dsmith>The common wisdom is to avoid a macro if a lambda will do. <dsmith>ISTR something about performance and preferring ". tail" over "..." <ArneBab>sneek: later tell apteryx: I mean the email "23.12.2024 Fp Maxim … LRe: bug#71300: [PATCH v3] doc: Document SRFI 64."