私は、変数を持って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で同様の方法で表示されるという残念な結果です。表示された情報は十分だと思ったので、私は言及しませんでした。戻り値の型は、すべての栄光で、オブジェクトです.... – nicolas