名前空間を削除しても新しいカスタム関数は削除されませんtest_ns = New Namespace("Test");
add custom functions({
new custom function("Test", "test_function",
function({},
print("hello world!!");
Return(1);
);
);
});
test_ns << Delete Namespace();
custom_functions = get custom functions();
custom_functions = custom_functions[Loc(custom_functions << get namespace, "Test")];
custom_functions << get name;名前空間を削除しても、上記のように関連付けられたカスタム関数は削除されません。
カスタム関数を削除する唯一の方法は、「カスタム関数の削除」関数を使用することです。
名前空間を削除し、それに関連付けられているすべてのカスタム関数を削除する方法はありますか?
Re:名前空間が削除されても新しいカスタム関数は削除されません名前空間とそれに関連するすべてのカスタム関数を削除する組み込みの方法があるとは思わない。ただし、次のユーザー定義関数のようなものを使用できます。
Delete Namespace and Matching Custom Functions = Function({ns}, {i, mask, fs},
fs = Get Custom Functions();
mask = Loc(fs << Get Namespace, ns << Get Name);
If(N Items(mask),
fs = fs[mask];
For(i = 1, i <= N Items(fs), i++,
fs[i] = ((ns << Get Name) || ":" || (fs[i] << Get Name));
);
Remove Custom Functions(fs);
);
ns << Delete Namespace(Force(1));
);
JMPの将来のバージョンでこれを管理するより良い方法を検討します。