示例#1
0
文件: Env.cs 项目: takuto-h/rhea
 public static void AddMethod(
     this IEnv env,
     ValueSymbol klass,
     string selectorName,
     Subr subrValue,
     int paramCount = 0,
     bool allowRest = false,
     bool allowKeys = false
 )
 {
     string subrName = string.Format(
         "{0}:{1}",
         klass.Name.ToIdentifier(),
         selectorName.ToIdentifier()
     );
     AddMethod(
         env, klass, selectorName,
         new ValueSubr(
             subrName,
             subrValue,
             paramCount,
             allowRest,
             allowKeys
         )
     );
 }
示例#2
0
 public ValueSubr(
     string name,
     Subr subrValue,
     int paramCount,
     bool allowRest,
     bool allowKeys
 )
 {
     mName = name;
     mParamCount = paramCount;
     mAllowRest = allowRest;
     mAllowKeys = allowKeys;
     mSubrValue = subrValue;
 }
示例#3
0
文件: Env.cs 项目: takuto-h/rhea
 public static void AddVariable(
     this IEnv env,
     string symbolName,
     Subr subrValue,
     int paramCount = 0,
     bool allowRest = false,
     bool allowKeys = false
 )
 {
     string subrName = symbolName.ToIdentifier();
     AddVariable(
         env, symbolName,
         new ValueSubr(
             subrName,
             subrValue,
             paramCount,
             allowRest,
             allowKeys
         )
     );
 }