I hope you don't mind that I've cc'ed these replies to the Gambit mail list. It would probably be most effective to CC any query about Gambit to the list.
On May 4, 2005, at 1:30 AM, Eric Merritt wrote:
According to the docs meroon generates some macros for each class. Do you have any idea how this interacts with gambits include/load semantics.
I copy the generated _meroon.o1 to the gambit install directory, in this case /pkgs/Gambit-C, link gsi++ to gsi, and gsc++ to gsc, in /pkgs/Gambit-C/bin, and put the following into /pkgs/Gambit-C/gambext.scm:
zuse-36% cat /pkgs/Gambit-C/gambcext.scm (case (string->symbol (car (##command-line))) ((gsi++ gsc++) (load "/pkgs/Gambit-C/_meroon.o1")) (else #f)) (display "loading /pkgs/Gambit-C/gambcext.scm\n")
I can then start gsc with Meroon by gsc++ and gsi with Meroon by gsi++.
After that I don't have problems with include/load, etc.
Brad
Afficher les réponses par date
I copy the generated _meroon.o1 to the gambit install directory, in this case /pkgs/Gambit-C, link gsi++ to gsi, and gsc++ to gsc, in /pkgs/Gambit-C/bin, and put the following into /pkgs/Gambit-C/gambext.scm:
zuse-36% cat /pkgs/Gambit-C/gambcext.scm (case (string->symbol (car (##command-line))) ((gsi++ gsc++) (load "/pkgs/Gambit-C/_meroon.o1")) (else #f)) (display "loading /pkgs/Gambit-C/gambcext.scm\n")
I can then start gsc with Meroon by gsc++ and gsi with Meroon by gsi++.
That works for the Meroon system, but what about Meroon classes defined by the user. Doesn't Meroon generate a few macros when classes are defined? In this case you then have macro code mixed with non-macro code. So if you 'load' it the macros aren't available outside of the file. If you 'include' it the non-macro portion of the code could be a duplicated if other code in your system also includes that object definition.
I guess this comes down to a bit of confusion on my part about include/load semantics. Its my current understanding that macros should always be specified in a file designed to be included. Non-macro code should be in a file designed to be loaded. Most of the time this isn't an issue, but sometimes you may not know when macros are present and when they are not. A perfect example of this is the meroon classes I described above.
I am more then a bit confused by this so any clarification is greatly appreciated.
Thanks, Eric
On May 4, 2005, at 8:36 PM, Eric Merritt wrote:
That works for the Meroon system, but what about Meroon classes defined by the user. Doesn't Meroon generate a few macros when classes are defined? In this case you then have macro code mixed with non-macro code. So if you 'load' it the macros aren't available outside of the file. If you 'include' it the non-macro portion of the code could be a duplicated if other code in your system also includes that object definition.
Ah, now I understand your question, sorry for being dense before.
Through a bit of hackery, Meroon macros are available whether loaded or included. See meroon.gsc for the gory details. (Basically, each meroon-macro definition in a file A.scm [which is available to use in other definitions in A.scm] is also "eval"-ed, which makes it available to use in definitions in other files after A.scm or A.o1 is "load"-ed.)
I would recommend you just "include" or "load" each file with Meroon class/generic/method definitions once.
Brad
On 5/4/05, Bradley Lucier lucier@math.purdue.edu wrote:
On May 4, 2005, at 8:36 PM, Eric Merritt wrote:
Ah, now I understand your question, sorry for being dense before.
Through a bit of hackery, Meroon macros are available whether loaded or included. See meroon.gsc for the gory details. (Basically, each meroon-macro definition in a file A.scm [which is available to use in other definitions in A.scm] is also "eval"-ed, which makes it available to use in definitions in other files after A.scm or A.o1 is "load"-ed.)
That is ever so slightly scary ;) That does solves the problem though.
I would recommend you just "include" or "load" each file with Meroon class/generic/method definitions once.
Please forgive my obtuseness, but what if you need to make use of those definitions in more then one file?
Brad
On May 5, 2005, at 1:31 AM, Eric Merritt wrote:
Please forgive my obtuseness, but what if you need to make use of those definitions in more then one file?
Then load or include the file containing the definitions before you load or include the other files that use them.
Yea, I finally realized what the problem was. In general its because I was thinking of files as modules, which they are not. So you are right, just making sure the definitions are present is sufficient.
Thanks.
On 5/5/05, Bradley Lucier lucier@math.purdue.edu wrote:
On May 5, 2005, at 1:31 AM, Eric Merritt wrote:
Please forgive my obtuseness, but what if you need to make use of those definitions in more then one file?
Then load or include the file containing the definitions before you load or include the other files that use them.
There was a bug in processing with-access forms (among other things) in the meroon I set up a few days ago. Sorry.
A new tar file containing meroon with the fix is at
http://www.math.purdue.edu/~lucier/meroon.tar.gz
Brad