From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19995 invoked by alias); 3 Oct 2017 16:13:43 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 17378 invoked by uid 89); 3 Oct 2017 16:13:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=confirming, editor, Hx-languages-length:1334, damien X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Oct 2017 16:13:35 +0000 Received: from [10.9.9.212] (helo=mailfront12.runbox.com) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1dzPp7-0002pm-4Q for kawa@sourceware.org; Tue, 03 Oct 2017 18:13:33 +0200 Received: from 70-36-239-2.dsl.dynamic.fusionbroadband.com ([70.36.239.2] helo=localhost.localdomain) by mailfront12.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1dzPoZ-0003Iv-Nl for kawa@sourceware.org; Tue, 03 Oct 2017 18:12:59 +0200 Subject: Re: variable definition in include files not usable in class file To: kawa@sourceware.org References: <201710031541.24999.Damien.Mattei@unice.fr> From: Per Bothner Message-ID: Date: Tue, 03 Oct 2017 16:13:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201710031541.24999.Damien.Mattei@unice.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-q4/txt/msg00005.txt.bz2 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/