variable definition in include files not usable in class file
Per Bothner
per@bothner.com
Tue Oct 3 16:13:00 GMT 2017
On 10/03/2017 06:41 AM, Damien MATTEI wrote:
> hello,
> i try to use a variable defined in an include files and i got an error,
I assume you've tried replacing the 'include-relative' by directly pasting
(with your text editor) the contents of debug.scm? That is useful for confirming
whether the issue specifically has to do with include.
Is more than one thread involved? I.e. could debug-mode or debug-mode-save
be accessed from more than one thread?
Because of the way debug-mode-reload is implemented, it is not possible
to "nest" calls to your debug procedures. I.e. you can't debug an expression
that calls a procedure that in turns uses debug.
It would be better to make debug-mode a parameter object:
https://www.gnu.org/software/kawa/Parameter-objects.html
That handles nesting and multiple threads.
Alternatively, you debug-mode a "fluid" variable. (Paramaters and
fluid variable are similar except you have to ad an extra layer of parentheses to
"call" a parameter object.)
https://www.gnu.org/software/kawa/Eval-and-Environments.html#idm139913596422880
(define-variable debug-mode #t)
(define-syntax debug
(syntax-rules ()
((_ instruction)
(fluid-let ((debug-mode #t))
instruction))
...))
--
--Per Bothner
per@bothner.com http://per.bothner.com/
More information about the Kawa
mailing list