How do I write out to the console from _gsi.scm? I presume that I need to just specify the correct stream? What would that be at that point?
If I do a (write "FOO!") inside _gsi.scm, it seems to get eaten. Similarly, it gets eaten if I specify it in main() inside _gsi.scm.
I can do a write from inside _repl.scm as it seems to set things up before that as well as provides me with an available stream to write to.
Thanks, -a
Afficher les réponses par date
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 24-Oct-06, at 10:19 PM, Andrew Lentvorski wrote:
How do I write out to the console from _gsi.scm? I presume that I need to just specify the correct stream? What would that be at that point?
If I do a (write "FOO!") inside _gsi.scm, it seems to get eaten. Similarly, it gets eaten if I specify it in main() inside _gsi.scm.
I can do a write from inside _repl.scm as it seems to set things up before that as well as provides me with an available stream to write to.
Thanks, -a
If you just do (write "foo!") it will go the the current output-port, which is initially connected to "stdout" (the port in the global variable ##stdout-port). But you have only directed the console to the screen, so you should use the port in the global variable ##console-port, i.e. do
(write "foo!" ##console-port)
or
(current-output-port ##console-port) (write "foo!")
When you start a REPL, the REPL connects the current output-port to the console.
Marc
Marc Feeley wrote:
(write "foo!" ##console-port)
If I add that to the bottom of _gsi.scm, I get: "foo!"*** ERROR IN ##main -- Error code 88 (load "")
and then a crash (normally that's a NULL pointer).
(current-output-port ##console-port) (write "foo!")
This, however, works. So, too does:
(current-output-port ##console-port) (write "foo!" ##console-port)
-a