I'm having trouble using the repl-server.scm that is included in the iOS example. I've embedded it into my iOS program, and I can connect to it and evaluate expressions once it is running in the simulator. However, none of my program definitions are available.
Is there anything special I need to do to get the repl thread to run on the same namespace as the rest of my program?
I think it's possible that my problem is related to how I compile my .scm files. I just (include ...) each of them into a main init.scm file, and then "gsc -link init.scm". Perhaps this might strip out the definitions from the scheme interpreter thread.
In Marc's iOS example, each file is split up into, for example, repl-server.scm and repl-server#.scm, but I'm not sure what gsc command to use to compile them all without ending up with duplicate symbols (especially since many of them (include ...) the same files, like (##include "~~lib/gambit#.scm") ).
Any help is appreciated. Thanks!
Afficher les réponses par date
On 2013-04-18, at 12:41 PM, Axis Sivitz aosivitz@gmail.com wrote:
I'm having trouble using the repl-server.scm that is included in the iOS example. I've embedded it into my iOS program, and I can connect to it and evaluate expressions once it is running in the simulator. However, none of my program definitions are available.
Is there anything special I need to do to get the repl thread to run on the same namespace as the rest of my program?
I think it's possible that my problem is related to how I compile my .scm files. I just (include ...) each of them into a main init.scm file, and then "gsc -link init.scm". Perhaps this might strip out the definitions from the scheme interpreter thread.
In Marc's iOS example, each file is split up into, for example, repl-server.scm and repl-server#.scm, but I'm not sure what gsc command to use to compile them all without ending up with duplicate symbols (especially since many of them (include ...) the same files, like (##include "~~lib/gambit#.scm") ).
Any help is appreciated. Thanks!
It is likely that you have a stray namespace declaration in init.scm which is causing all of your definitions to be put in that namespace. Your definitions are available, but you need to prefix them with the namespace to access them (for example, use foo#bar instead of bar if the namespace is foo). To use the empty namespace, your need to have the following namespace declaration:
(namespace (""))
That will put all of the identifiers that are used after the declarations in the empty namespace.
For a more complete example of namespace usage, please check the mailing list or the "Gambit Scheme: Inside Out" talk slides (http://www.iro.umontreal.ca/~gambit/Gambit-inside-out.pdf).
Marc
Thanks Marc, you were right, and that link was very helpful. I also found the proper compilation steps in the makefile.
On Apr 18, 2013, at 2:08 PM, Marc Feeley wrote:
On 2013-04-18, at 12:41 PM, Axis Sivitz aosivitz@gmail.com wrote:
I'm having trouble using the repl-server.scm that is included in the iOS example. I've embedded it into my iOS program, and I can connect to it and evaluate expressions once it is running in the simulator. However, none of my program definitions are available.
Is there anything special I need to do to get the repl thread to run on the same namespace as the rest of my program?
I think it's possible that my problem is related to how I compile my .scm files. I just (include ...) each of them into a main init.scm file, and then "gsc -link init.scm". Perhaps this might strip out the definitions from the scheme interpreter thread.
In Marc's iOS example, each file is split up into, for example, repl-server.scm and repl-server#.scm, but I'm not sure what gsc command to use to compile them all without ending up with duplicate symbols (especially since many of them (include ...) the same files, like (##include "~~lib/gambit#.scm") ).
Any help is appreciated. Thanks!
It is likely that you have a stray namespace declaration in init.scm which is causing all of your definitions to be put in that namespace. Your definitions are available, but you need to prefix them with the namespace to access them (for example, use foo#bar instead of bar if the namespace is foo). To use the empty namespace, your need to have the following namespace declaration:
(namespace (""))
That will put all of the identifiers that are used after the declarations in the empty namespace.
For a more complete example of namespace usage, please check the mailing list or the "Gambit Scheme: Inside Out" talk slides (http://www.iro.umontreal.ca/~gambit/Gambit-inside-out.pdf).
Marc