示例#1
0
 @Override
 protected A_Type privateBlockTypeRestriction() {
   return FunctionTypeDescriptor.create(
       TupleDescriptor.from(
           ATOM.o(),
           MapTypeDescriptor.mapTypeForSizesKeyTypeValueType(
               IntegerRangeTypeDescriptor.inclusive(
                   IntegerDescriptor.zero(), IntegerDescriptor.fromInt(socketOptions.length - 1)),
               IntegerRangeTypeDescriptor.inclusive(
                   IntegerDescriptor.one(), IntegerDescriptor.fromInt(socketOptions.length - 1)),
               ANY.o())),
       TOP.o());
 }
  @Override
  public Result attempt(
      final List<AvailObject> args, final Interpreter interpreter, final boolean skipReturnCheck) {
    assert args.size() == 1;
    final A_Bundle bundle = args.get(0);

    final MessageSplitter splitter = bundle.messageSplitter();
    return interpreter.primitiveSuccess(IntegerDescriptor.fromInt(splitter.numberOfArguments()));
  }