<div><br></div>Uh this is funny:<div><br></div><div>(open-output-file '(|path:| "test.flog" |create:| maybe |append:| #t)) <br><br>look there, there's 
|:s around the keywords. This means they're *not* actually keywords but *symbols* that kind of look like keywords.</div><div><br></div><div>I suppose this is the cause of the error you encountered.</div><div><br></div>

<div>Tried to reproduce your error on 4.6.2:</div><div><br></div><div><div>$ cat a.scm</div><div>(write (cons abcde: 123))</div><div><div>$ gsi a.scm</div><div>(abcde: . 123)$ gsc -exe a.scm</div></div></div><div><div>$ ./a</div>

<div>(abcde: . 123)</div></div><div><br></div><div>I.e. does not reproduce your results. Not one character of the involved Gambit code ought to have been changed in the current version since 4.6.2.</div><div><br></div><div>

Do you compile this code just with gsc filename.scm  or (compile-file "filename.scm") or do you have some preprocessor on it?</div><div><br></div><div>Do you see any other reasons for why this occured?<br><br><br>

<br><div class="gmail_quote">2012/6/10 David Rush <span dir="ltr"><<a href="mailto:kumoyuki@gmail.com" target="_blank">kumoyuki@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">With Gambit 4.6.6, I am seeing decidedly different behavior for<br>
open-output-file between code compiled with gsc/gcc to run as a<br>
standalone executable and that same code compiled with gsc to run<br>
under gsi. The source code follows the body of the message, but the<br>
error from the standalone run tells the whole story, really.<br>
Specifically:<br>
<br>
----------------------------------------------------------------------<br>
drr@dibbuk$ make target=gambit test/bug.gambit<br>
gsc -:s -link test/bug.Gambit<br>
gcc -I/home/drr/include test/bug.c test/bug_.c -o test/bug.gambit \<br>
                -L/home/drr/lib -lgambc -lm -lutil -ldl<br>
drr@dibbuk$ test/bug.gambit<br>
*** ERROR IN flog-file -- (Argument 1) STRING or port settings expected<br>
(open-output-file '(|path:| "test.flog" |create:| maybe |append:| #t))<br>
<br>
drr@dibbuk$ gsc test/bug.Gambit<br>
drr@dibbuk$ gsi<br>
Gambit v4.6.6<br>
<br>
> (load "test/bug")<br>
"/home/drr/git/heureka/framework/test/bug.o2"<br>
> (main (vector "this is a test"))<br>
> (exit)<br>
drr@dibbuk$ cat test.flog<br>
this is a test<br>
this is a test<br>
------------------------------------------------------------------------<br>
<br>
Now the repeated lines in test.flog are expected from the gsi case<br>
because the code is effectively run twice, once upon load and once<br>
manually (as will be seen from the source below). So what is going on<br>
with the standalone execution? I am very puzzled.<br>
<br>
the source code for bug.Gambit. This is the output of a preprocessor,<br>
so it looks a little strange, but it is really very straightforward.<br>
<br>
------------------------------------------------------------------<br>
(define _cons_23 cons)<br>
(define *flog-use-current-output-port* #f)<br>
(define *flog-use-current-error-port* #f)<br>
<br>
(define<br>
  flog-file<br>
  (lambda<br>
    (_file-name_38 _s_39)<br>
    ((lambda<br>
       (_f_40)<br>
       (begin (display _s_39 _f_40)<br>
              (newline _f_40)<br>
              (if *flog-use-current-output-port*<br>
                  (display _s_39 (current-output-port)))<br>
              (if *flog-use-current-error-port*<br>
                  (display _s_39 (current-error-port)))<br>
              (close-output-port _f_40)))<br>
     (open-output-file<br>
       (_cons_23<br>
         (quote path:)<br>
         (_cons_23<br>
           _file-name_38<br>
           (quote (create: maybe append: #t))))))))<br>
<br>
<br>
(define<br>
  main<br>
  (lambda<br>
    (_argv_38)<br>
    (begin<br>
      (flog-file "test.flog" "this is a test")<br>
      )))<br>
<br>
(main (command-line))<br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca" target="_blank">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</blockquote></div><br></div>