【发布时间】:2010-12-29 17:48:12
【问题描述】:
我想在 F# 中实现以下 C# 接口:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mono.Addins;
[TypeExtensionPoint]
public interface ISparqlCommand
{
string Name { get; }
object Run(Dictionary<string, string> NamespacesDictionary, org.openrdf.repository.Repository repository, params object[] argsRest);
}
这是我尝试过的,但它给了我:“在表达式中或之前的不完整结构化构造”
#light
module Module1
open System
open System.Collections.Generic;
type MyClass() =
interface ISparqlCommand with
member this.Name =
"Finding the path between two tops in the Graph"
member this.Run(NamespacesDictionary, repository, argsRest) =
new System.Object
我做错了什么?也许缩进是错误的?
【问题讨论】:
-
也许只是缺少
new System.Object()上的括号? -
什么是 C# 接口?你已经在 C# 中定义了一个 CLR 接口。
标签: c# .net inheritance f#