Esempio n. 1
0
 public static DynamicExpression AnalyzeDefunExpr(SymplDefunExpr expr,
                                                   AnalysisScope scope) {
     if (!scope.IsModule) {
         throw new InvalidOperationException(
             "Use Defmethod or Lambda when not defining top-level function.");
     }
     return Expression.Dynamic(
                scope.GetRuntime().GetSetMemberBinder(expr.Name),
                typeof(object),
                scope.ModuleExpr,
                AnalyzeLambdaDef(expr.Params, expr.Body, scope,
                                 "defun " + expr.Name));
 }
Esempio n. 2
0
 public static DynamicExpression AnalyzeDefunExpr(SymplDefunExpr expr,
                                                  AnalysisScope scope)
 {
     if (!scope.IsModule)
     {
         throw new InvalidOperationException(
                   "Use Defmethod or Lambda when not defining top-level function.");
     }
     return(Expression.Dynamic(
                scope.GetRuntime().GetSetMemberBinder(expr.Name),
                typeof(object),
                scope.ModuleExpr,
                AnalyzeLambdaDef(expr.Params, expr.Body, scope,
                                 "defun " + expr.Name)));
 }