RCL uses CFFI to communicate with the R environment, RCLmath links with libRmath and makes some functions accessible in a much simpler way. The code is available under the MIT license. Note that there is another project working on communication between Common Lisp and R: RCLG.

rcl

This package give access to the full R environment.

AllegroCL 8.0 CLISP 2.41 CMUCL 19d LispWorks 5.0 OpenMCL 1.1 SBCL 1.0
Windows/i386 OK OK NA OK NA OK
Linux/i386 OK OK fails OK NA fails
MacOSX/i386 OK NO FFI NA fails NA OK
MacOSX/PPC OK OK OK fails fails OK

The results above correspond to FedoraCore6 running on a PIV, Tiger running on a G4 and a CoreDuo, and WindowsXP running in VMWare Fusion (using R 2.5.0/2.5.1RC). Note that a success means only that some basic operations work, no extensive testing is performed in any platform.

The failures seem to have the same origin. Somehow we can't find anything in the R environment: (r-header *r-globalenv*) returns in all this failing combinations (4 0 0 32768 0 0 0 0 0 0) (in working systems we get (4 0 2 32768 1 0 0 0 0 0), where the numbers correspond to the fields in the header: (TYPE OBJ NAMED GP MARK DEBUG TRACE FIN GCGEN GCCLS)).

Download: rcl.tgz (older snapshots rcl-070316.tgz, rcl-060716.tgz,rcl-060703.tgz,rcl-060623.tgz).

When decoding an object with attributes, the list of attributes is returned as a secondary value (it's also possible to print attributes to standard-output whenever encountered decoding an object, to be aware of their existence).

CL-USER> (in-package :rcl)
#<PACKAGE "RCL">
R> (r-init)
T
R> (r "R.Version")
("i386-apple-darwin8.10.1" "i386" "darwin8.10.1" "i386, darwin8.10.1" "Patched"
 "2" "6.0" "2007" "10" "03" "43075" "R"
 "R version 2.6.0 Patched (2007-10-03 r43075)")
((:NAMES "platform" "arch" "os" "system" "status" "major" "minor" "year"
  "month" "day" "svn rev" "language" "version.string"))

In its current state it might be possible to use RCL successfully for simple tasks, but there are a number of issues: