On 13-Feb-09, at 11:45 PM, lowly coder wrote:
~/error$ cat int.scm (load "comp") (pp (add 2)) (pp (get-foo2 2)) (pp (get-foo 2)) (pp (get-str-foo2 "hello")) (pp (get-str-foo "world"))
Question: what's the difference between get-str-foo2 and get-foo2 that causes one to work and one throw an error?
When I run your code I get:
4 #<void* #2 0x3a1378> #<foo* #3 0x3a1378> #<void* #4 0x3a1378> #<foo* #5 0x3a1378>
So the results are the same (except for the fact that the type tag is either void* or foo*). What is the result your get?
I suspect that you did not compile Gambit using --enable-cplusplus . If you want to load code compiled by a C++ compiler, then Gambit itself must have been compiled with a C++ compiler (so that the ABI is the same).
Marc