Hi all,
Current guile inlines even variables exposed in the module interface, and I understand that we must live with that and code around it. So here is a few tips how to mitigate it.
The simplest way is to put this definition in a module:
------------------------
(define-module (syntax not-inline)
#:export (not-inline))
(cond-expand
(guile-3.0
(define (not-inline x) x))
((or (guile-2.0 guile-2.2)
(define-syntax-rule (not-inline x) x)))
-------------------------------------
And then in another module do,
(use-modules (syntax not-inline))
(define variable (not-inline 12))
(define function (not-inline (lambda () ...)))
etc
This is also an option (not perfect but you get the gist)
-----------------------------------------------------------------
(define-module (syntax define-not-inlinable)
#:use-module (syntax not-inline)
#:export (inline define lambda define* lambda* define-values)
(define inline (lambda (x) x))
(define-syntax define
(syntax-rules (inline)
((define (f . x) . code)
(define f (not-inline (lambda x . code)))
((define f (inline x))
(define f x))
((define f x)
(define f (not-inlinable x))))
----------------------------------------------------------------------------------
using this module will make all usual define not inlineable and to enable inlining you would
explicitly ask for it like
(define f (inline (lambda (x) (+ x 10))))
If there is a need for this I can write the modules and expose it on the intertubes.
WDYT
/Stefan