public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: kawa@sourceware.org
Subject: Re: variable definition in include files not usable in class file
Date: Tue, 03 Oct 2017 16:13:00 -0000	[thread overview]
Message-ID: <a6bb12f1-3bd1-a3ab-7395-a01e4e48c4ac@bothner.com> (raw)
In-Reply-To: <201710031541.24999.Damien.Mattei@unice.fr>

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/

  parent reply	other threads:[~2017-10-03 16:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 13:41 Damien MATTEI
2017-10-03 15:21 ` Sudarshan S Chawathe
2017-10-03 15:34   ` Damien Mattei
2017-10-03 15:35     ` Damien Mattei
2017-10-03 16:13 ` Per Bothner [this message]
2017-10-04 13:46   ` Damien MATTEI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6bb12f1-3bd1-a3ab-7395-a01e4e48c4ac@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).