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 ) ); }
public ValueSubr( string name, Subr subrValue, int paramCount, bool allowRest, bool allowKeys ) { mName = name; mParamCount = paramCount; mAllowRest = allowRest; mAllowKeys = allowKeys; mSubrValue = subrValue; }
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 ) ); }