Many changes! Snapshots now working properly. Programmatic environment interface...
[RExecServer.git] / RFunction.m
blob3f262e1ca7aca42a9fbd9cf9a9f9a0a668f16484
1 //
2 //  RFunction.m
3 //  RExecServer
4 //
5 //  Created by Byron Ellis on 7/6/07.
6 //  Copyright 2007 __MyCompanyName__. All rights reserved.
7 //
9 #import "RFunction.h"
10 #include <Rinternals.h>
12 @implementation RFunction
14 + (RFunction*)functionWithName:(NSString*)aFun {
15         
18 - (SEXP)_formals {
19         SEXP e,ret;
20         int  err;
21         PROTECT(e = lang2(install("formals"),(SEXP)obj_ptr));
22         ret = R_tryEval(e,R_GlobalEnv,&err);
23         if(err == 0) {
24                 UNPROTECT(1);
25                 return ret;
26         } else {
27                 UNPROTECT(1);
28                 return R_NilValue;
29         }
32 - (NSArray*)arguments {
35 - (NSDictionary*)defaults {
39 @end