#import <Foundation/Foundation.h>
#import "REngine.h"
#import "RSEXP.h"

int main(int ac, char **av)
{
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

  REngine *eng = [REngine mainEngine];
  if (!eng || ![eng activate]) {
    NSLog(@"Cannot start R!");
    return 1;
  }
  
  
  RSEXP * x = [eng evaluateString:@"R.version$version.string"];
  if (x) {
    NSLog(@"R version: %@", [x string]);
    [x release];
  }
  
  [eng release];

  [pool release];

  return 0;
}
