Hi Cornelius, On Fri, Mar 14, 2003 at 04:07:56PM +0100, Cornelius Hagen wrote: > Hi Warwick, > > Thank you! One more question. > Your points are very clear: > 1: create_module(d), > 2: compile(file)@d, % compiles file as if done from module d > 3: export(foo/2)@d, % export foo/2 from d so other modules can > access it > 4: d:foo(X, Y), % call module d's foo/2 > 5: erase_module(d). > To implement this in java, I'd try 1,3,4,5 the rpc(String)-method. > But how about 2:? Usually one compiles a file in java with > compile(File)-method that does not provide the possibility to use @/. I > tried a work-around via rpc( "compile(arrow0.txt) @ d" ). > But get an Exception (Throw) with the comment: > string stream 9: syntax error: postfix/infix operator expected > | compile(arrow0.txt) @ d > | ^ here string contains unexpected characters in > term_string(_942, "compile(arrow0.txt) @ d") This error is because, in ECLiPSe, you can't just type compile(arrow0.txt) since `.' is a special character. You need to make the file name a string "arrow0.txt" or atom 'arrow0.txt'. >From what I understand of Josh's reply, you want to construct the term @(compile("arrow0.txt"), d) and send that. I guess constructing the term would look something like this (big disclaimer: I don't really know Java, and I've never used the Java-ECLiPSe interface or this RPC stuff...): new CompoundTermImpl("@", new CompoundTermImpl("compile", "arrow0.txt"), new Atom("d")) Cheers, WarwickReceived on Fri Mar 14 18:08:48 2003
This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:22 PM GMT GMT