zk19980223
2021-1-21 16:53:50

@zk19980223 has joined the channel


dyllongagnier
2021-1-21 21:26:48

Anyone know of a convenient want to cache some expensive constant for a macro within a function? I am generating said macro from within another macro which generates something like

#`(lambda () (define-for-syntax table (some-lookup-table...)) (define-syntax (helper-macro-using-table stx) ...) rest-of-lambda ...) I can’t just do an outer begin since this is likely not going to be called at the top/module level. Would syntax-local-value work in the general case for something like this? Also, if this is unsafe for some reason, would be interested to know why.


samth
2021-1-21 22:14:18

Lifting is often used for this


samth
2021-1-21 22:14:42

See begin-lifted


dyllongagnier
2021-1-22 00:34:39

Thanks so much, that seems to mostly resolve what I was looking for.