public OperationRetBoolBinder(PythonBinaryOperationBinder operationBinder, ConversionBinder conversionBinder) :
     base(new BinderMappingInfo(
             operationBinder,
             ParameterMappingInfo.Parameter(0),
             ParameterMappingInfo.Parameter(1)
         ),
         new BinderMappingInfo(
             conversionBinder,
             ParameterMappingInfo.Action(0)
         )
     ) {
     _opBinder = operationBinder;
     _convBinder = conversionBinder;
 }
Example #2
0
        internal PythonBinaryOperationBinder/*!*/ BinaryOperation(ExpressionType operation) {
            if (_binaryBinders == null) {
                Interlocked.CompareExchange(
                    ref _binaryBinders,
                    new Dictionary<ExpressionType, PythonBinaryOperationBinder>(),
                    null
                );
            }

            lock (_binaryBinders) {
                PythonBinaryOperationBinder res;
                if (!_binaryBinders.TryGetValue(operation, out res)) {
                    _binaryBinders[operation] = res = new PythonBinaryOperationBinder(this, operation);
                }

                return res;
            }
        }