このValaコードの小さな断片、私はrosettacodeから読みました
public class Singleton : Object {
static Singleton? instance;
Singleton() { } // Private constructor
public static Singleton get_instance() {
if (instance == null) {
instance = new Singleton();
}
return instance;
}
}
ヴァラ:
var a = new Singleton ();
エラーを出力します
エラー: プライベート メンバー `Singleton.new' へのアクセスが拒否されました
Genieでそれを行う方法は?プライベートコンストラクター?
この行を Genie に翻訳するにはどうすればよいですか?
Singleton() { } // Private constructor