<div dir="ltr">Hi!<div><br></div><div>We have been having a strange annoyance - probably very simple to solve - for quite some while, and I wanted to address it here so that we and anyone running into it might get around it.</div>

<div><br></div><div>What we do is to run a procedure that runs (load) multiple times in a sequence, where the (load):s are such that they output multiple warnings about unresolved symbols during the process. I'm well aware that unresolved symbols are not acceptable in final code, but, during development, there may be good reasons to prioritize other things than fixing symbol usage in code that's not used in the present moment anyhow. As you know, the general pattern for unresolved symbol warnings output by (load) is</div>

<div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">*** WARNING -- Variable "some-module-name#some-function-name" used in module "some-object-file.o1" is undefined<br>
</blockquote><div><br></div><div>The problem is that when we execute the procedure from another thread than the primordial, quite each of its warning output operations block (i.e. is blocked / freezes / waits), and gets output to the console  first after that one makes an evaluation in the REPL. Making a thread-sleep! or evaluating zero is sufficient. After the evaluation, the procedure resumes until it outputs another line, and then another evaluation needs to be made to make it resume again, etc.</div>

<div><br></div><div>How do we make (load) never block, undepending of in what thread it is executed?</div><div><br></div><div>Example code below.</div><div><br></div><div>Thanks</div><div>Mikael</div><div><br></div><div>
 - </div><div><br></div><div>Set up test environment</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">echo "(define (test) (unknown-symbol-a) (unknown-symbol-b) (unknown-symbol-c))" > a.scm<br>
echo "(define (test) (unknown-symbol-d) (unknown-symbol-e) (unknown-symbol-f))" > b.scm<br>echo "(define (test) (unknown-symbol-g) (unknown-symbol-h) (unknown-symbol-i))" > c.scm<br><br>gsc<br>(compile-file "a.scm") (compile-file "b.scm") (compile-file "c.scm")<br>
,q<br></blockquote><div><div><br></div><div>Expected behaviour, load:s don't block:</div><div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">gsc<br>
(load "a") (load "b") (load "c")<br>,q<br></blockquote><div><div><br></div><div><br></div><div>Output is:</div><div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
> (load "a") (load "b") (load "c")<br>"/home/mikael/a"<br>> *** WARNING -- Variable "unknown-symbol-d" used in module "b.o1" is undefined<br>*** WARNING -- Variable "unknown-symbol-e" used in module "b.o1" is undefined<br>
*** WARNING -- Variable "unknown-symbol-f" used in module "b.o1" is undefined<br>"/home/mikael/b.o1"<br>> *** WARNING -- Variable "unknown-symbol-g" used in module "c.o1" is undefined<br>
*** WARNING -- Variable "unknown-symbol-h" used in module "c.o1" is undefined<br>*** WARNING -- Variable "unknown-symbol-i" used in module "c.o1" is undefined<br>"/home/mikael/c.o1"<br>
</blockquote><div><div><div><br></div><div>Unexpected behaviour, load:s block:</div><div><br></div></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">gsc<br>(thread-start! (make-thread (lambda () (load "a") (load "b") (load "c"))))<br>
</blockquote><div><div><div><br></div><div>Output is:</div></div></div><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">#<thread #2><br>><br><br>(thread-sleep! 5)<br>
------------- REPL is now in #<thread #2> -------------<br>*** WARNING -- Variable "unknown-symbol-d" used in module "b.o1" is undefined<br>*** WARNING -- Variable "unknown-symbol-e" used in module "b.o1" is undefined<br>
*** WARNING -- Variable "unknown-symbol-f" used in module "b.o1" is undefined<br>*** WARNING -- Variable "unknown-symbol-g" used in module "c.o1" is undefined<br>*** WARNING -- Variable "unknown-symbol-h" used in module "c.o1" is undefined<br>
*** WARNING -- Variable "unknown-symbol-i" used in module "c.o1" is undefined<br>------------- REPL is now in #<thread #1 primordial> -------------<br>><br></blockquote><br><div>Alternatively:<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<br>#<thread #2><br>> 0<br>0<br>------------- REPL is now in #<thread #2> -------------<br>*** WARNING -- Variable "unknown-symbol-a" used in module "a.o1" is undefined<br>------------- REPL is now in #<thread #1 primordial> -------------<br>
> 0<br>0<br>------------- REPL is now in #<thread #2> -------------<br>*** WARNING -- Variable "unknown-symbol-b" used in module "a.o1" is undefined<br>------------- REPL is now in #<thread #1 primordial> -------------<br>
> 0<br>0<br>------------- REPL is now in #<thread #2> -------------<br>*** WARNING -- Variable "unknown-symbol-c" used in module "a.o1" is undefined<br>------------- REPL is now in #<thread #1 primordial> -------------<br>
> 0<br>0<br>------------- REPL is now in #<thread #2> -------------<br>*** WARNING -- Variable "unknown-symbol-d" used in module "b.o1" is undefined<br>------------- REPL is now in #<thread #1 primordial> -------------<br>
> 0<br>0<br>------------- REPL is now in #<thread #2> -------------<br>*** WARNING -- Variable "unknown-symbol-e" used in module "b.o1" is undefined<br>------------- REPL is now in #<thread #1 primordial> -------------<br>
> 0<br>0<br>------------- REPL is now in #<thread #2> -------------<br>*** WARNING -- Variable "unknown-symbol-f" used in module "b.o1" is undefined<br>------------- REPL is now in #<thread #1 primordial> -------------<br>
> 0<br>0<br>------------- REPL is now in #<thread #2> -------------<br>*** WARNING -- Variable "unknown-symbol-g" used in module "c.o1" is undefined<br>------------- REPL is now in #<thread #1 primordial> -------------<br>
> 0<br>0<br>------------- REPL is now in #<thread #2> -------------<br>*** WARNING -- Variable "unknown-symbol-h" used in module "c.o1" is undefined<br>------------- REPL is now in #<thread #1 primordial> -------------<br>
> 0<br>0<br>------------- REPL is now in #<thread #2> -------------<br>*** WARNING -- Variable "unknown-symbol-i" used in module "c.o1" is undefined<br>------------- REPL is now in #<thread #1 primordial> -------------<br>
> 0<br>0<br>> 0<br>0</blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><br></div></blockquote><div><div><div><div><br></div></div></div><div><br></div>
<div><br></div><div><br></div></div></div></div>