나는에 변수가 fsharpFsharp 대화 형 쿵푸
I (나는 누구의 프로토 타입을 알려줍니다 그것이 OBJ를 반환하는 일반 DOTNET 라이브러리를 호출하여 그 값을 가지고)
val toto : obj = [["NKY INDEX"]]
대화 그 내부의 값에 액세스하고 싶습니다만, 정확하게 타입을 알지 못합니다. 그래서 나는 그것을 반영하려고 : 나는 요소를 검색 할 때
>toto.GetType();;
val it : Type =
System.Object[,]
{Assembly = mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;
AssemblyQualifiedName = "System.Object[,], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
Attributes = AutoLayout, AnsiClass, Class, Public, Sealed, Serializable;
BaseType = System.Array;
ContainsGenericParameters = false;
CustomAttributes = seq [[System.SerializableAttribute()]];
DeclaredConstructors = [|Void .ctor(Int32, Int32);
Void .ctor(Int32, Int32, Int32, Int32)|];
DeclaredEvents = [||];
DeclaredFields = [||];
DeclaredMembers = [|Void Set(Int32, Int32, System.Object);
System.Object& Address(Int32, Int32);
System.Object Get(Int32, Int32);
Void .ctor(Int32, Int32);
Void .ctor(Int32, Int32, Int32, Int32)|];
DeclaredMethods = [|Void Set(Int32, Int32, System.Object);
System.Object& Address(Int32, Int32);
System.Object Get(Int32, Int32)|];
DeclaredNestedTypes = seq [];
DeclaredProperties = [||];
그것은, 그러나, 나는 오류를 get 메소드 얻을 수있다.
>toto.Get(0,0);;
toto.Get(0,0);;
-----^^^
error FS0039: The field, constructor or member 'Get' is not defined
내부 요소를 검색하는 올바른 방법은 무엇입니까?
PS :.이 사전에 동일한
>(toto :?> System.Object[,]).Get(0,0);;
(toto :?> System.Object[,]).Get(0,0);;
----------------------------^^^
error FS0039: The field, constructor or member 'Get' is not defined
같은 산출 캐스팅 [0, 0]
> toto.[0, 0];;
toto.[0, 0];;
^^^^^^^^^^^
error FS0039: The field, constructor or member 'Item' is not defined
'toto : obj = [[ ""]]'라는 표현은 심지어 컴파일해서는 안됩니다. – JaredPar
목록 및 다차원 배열 목록은 FSI – desco
@ JaredPar와 비슷한 방식으로 인쇄됩니다. 표시된 정보가 충분하다고 생각했기 때문에 언급하지 못했습니다.이 값은 dotnet 함수 호출에서 가져옵니다. 누구의 반환 유형, 모든 영광에, 개체입니다 .... – nicolas