On 2020/02/03 12:11:08, dak wrote: > On 2020/02/03 09:49:32, hanwenn wrote: > > On 2020/02/02 15:28:44, dak wrote: > > > > That's what I am trying right now, but you cannot quote outer functions as a > > > value either (the problem is the value, not the innerness) so you need to do > > it > > > by name and I would like not to have to export it, so I try with (@@ > > guile-user > > > define-session-internal) but haven't found the right incantation yet. Still > > > fiddling. If it cannot be avoided, it will end up as an exported > > > define-session-internal . > > > > I don't get it. define-session is not a public macro either. > > No, _I_ don't get it. Darn, you are right. So the cross-module issue does not > exist and just using 'define-session-internal should be fine.
To wit: the following boil-down of the example code you submitted to the Guile list works fine: (define decl '()) (define (make-var n v) (list "var" n v)) (define (define-session-internal n v) (set! decl (cons (make-var n v) decl))) (defmacro define-session (name value) `(define-session-internal ',name ,value)) (define-session foo 1) (display decl) (newline) Now that approach will take care of define-session. Where we have an _exported_ macro of similar kind, things get uglier. At the current point of time, I see no viable path forward other than just exporting the internal function as well. https://codereview.appspot.com/553480044/