Loading R sourc file in real

I’m using: SWI-Prolog version 8.1.10

I want the code to: load a R source file containing my R functions

But what I’m getting is:

?- r(source(‘R_proj1.R’)).
ERROR: R was unable to digest your statement, either syntax or existance error.
?- r(source(’…/R_jab/R_proj1.R’)).
ERROR: R was unable to digest your statement, either syntax or existance error.
?- r(source(’~/R_jab/R_proj1.R’)).
Error: 3, in parsing R expression.
ERROR: R was unable to digest your statement, either syntax or existance error.

Thank you in advance for your help

Jab

Unsure if it is related, but I also experience some trouble with “real” (Windows, 32-Bit, swipl 8.1.16). See this little program:

:- use_module(library(real)).
:- <- frac = (function(x, y) :- return(x/y)).

example :-
    X <- frac(1, 2),
    writeln(X).

If I start swipl-win.exe, then open the program and just compile it from the editor (Ctrl-C Ctrl-B), “example.” fails, and if I type “halt.”, swipl crashes.

If I start swipl-win.exe, manually say “use_module(library(real))”, then compile the program and run example, everything is fine.

I guess the :- use_module and :- <- directives are invoked in parallel threads, so I must somehow make sure they are called one after the other.

Nevertheless, there seems to be some little bug somewhere which causes “example.” to fail silently and swipl to crash in the end.

Best wishes,

Matthias

Just checked under linux (also 32-Bit). There, the problem does not appear.