Examples

Both Mathematica and Scheme support lambda-calculus:

> (MathEval '((Function x (+ x 1)) 0))
1

MrMathematica can handle arbitrary long number:

> (MathEval '(Factorial 100))
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000

You can define your scheme function that use MathEval, thus using the power of Mathematica with nearly no efforts:

> (define (factorinteger n)
    (eval (MathEval `(FactorInteger ,n))))
> (factorinteger 111111111111111111)
((3 2) (7 1) (11 1) (13 1) (19 1) (37 1) (52579 1) (333667 1))

A more efficient version:

> (define-syntax factorinteger
    (syntax-rules ()
      ((_ n) (map cdr (cdr (MathEval `(FactorInteger ,n)))))))

This version of MrMathematica doesn't render plots in the DrScheme environment (I'm working on it). If you really want to view Mathematica graphics, use the Mathematica command Display:

> (MathEval '(Display "graph.gif" (Plot (cos x) (list x 0 (* 2 Pi))) "GIF"))

and then load the "graph.gif" file.

If you want to use other forms of Mathematica (InputForm, StandardForm), use the parse and unparse function of Mathematica:

> (MathEval '(ToExpression "x^2+y^2"))
(+ (expt x 2) (expt y 2))
> (MathEval '(ToString (ToExpression "x+y+x+y")))
"2 x + 2 y"

You can use multiple Mathematica Kernel at the same time:

> (define ml1 (MathKernel))
> (define ml2 (MathKernel))
> (MathEval '(Set mm 1) ml1)
1
> (MathEval '(Set mm 2) ml2)
2
> (MathEval 'mm ml1)
1
> (MathEval 'mm ml2)
2