예제 #1
0
 public static SSScope LoadLib(this SSScope scope, string lib)
 {
     scope.Output.WriteLine(">>> Loading Library [{0}] ...".Fmt(lib));
     using (var sr = new StreamReader(lib))
     {
         string code = null;
         if ((code = sr.ReadToEnd()).NotEmpty())
         {
             scope.BulkEval(code);
         }
     }
     return(scope);
 }
예제 #2
0
 public static SSObject Load(SSExpression[] exps, SSScope scope)
 {
     (exps.Length == 1).OrThrows("expect one string");
     scope.BulkEval(exps[0].Evaluate(scope) as SSString);
     return("loaded");
 }