Re: s48_extract_string?

Richard Kelsey <[email protected]>
Newsgroups gmane.lisp.scheme.scheme48
Message-ID <[email protected]>
   Date: Tue, 3 Mar 2009 16:08:37 -0500
   From: Donald Allen <[email protected]>

   A few comments:

   1. I'm failing to understand why what works in the REPL doesn't work when
   loading from a file.  In other words, why is

   ,open external-calls
   ,open load-dynamic-externals

   acceptable when typing to the REPL and not acceptable when loading a file?

It is acceptable when typing to the command interpreter and
not when loading a file.  Scheme48 provides no way to read
commands from a file using the , syntax of the command
interpreter.

   2. As for whether it's a new language, that depends on how you define
   "language" (sounds Clintonesque :-). Sure, it's Scheme syntax, but in order
   to say what I want to say in normal Scheme acceptable at the REPL, e.g.,

   (load-dynamic-externals "/home/dca/Scheme48/postgresql.so" #f #f #f)
   (import-lambda-definition pg_open_connection (dbname))

   I now need to wrap in a call to 'run' when loading a file. To me that's new
   language -- things need to be said differently.

No, you need to wrap them in a call to 'run' when loading
them into the exec package.  Why would you expect to get the
same behavior if you type

 (load-dynamic-externals "/home/dca/Scheme48/postgresql.so" #f #f #f)

into the REPL, which evaluates it in the user environment,
and if you put it in a file and load it into the exec
environment?  If you want the same behavior you need to load
it into the same environment that the REPL uses.  Your command
file has code that needs to be run in two different packages,
the exec package and the user package.  There has to be some
way to distinguish them.  The command interpreter does this
by seeing the initial comma.

It would probably be clearer if the command interpreter didn't
treat forms without initial commas as having a ,run in front
of them.  If you had been required to put in all of the ,runs,
the correspondence between the command interpreter and the
exec package would have been clearer:
 ,open external-calls
 ,open load-dynamic-externals
 ,run (load-dynamic-externals
       "/home/dca/Finances/Invest/Options/Scheme48/postgresql.so" #f #f #f)
 ,run (import-lambda-definition pg_open_connection (dbname))


                                            -Richard Kelsey
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.