feat(library/private): add is_private predicate

This commit is contained in:
Leonardo de Moura 2015-09-30 18:50:09 -07:00
parent a17a6fd660
commit 44baaac53e
2 changed files with 6 additions and 0 deletions

View file

@ -76,6 +76,10 @@ optional<name> hidden_to_user_name(environment const & env, name const & n) {
return it ? optional<name>(*it) : optional<name>();
}
bool is_private(environment const & env, name const & n) {
return static_cast<bool>(hidden_to_user_name(env, n));
}
static int add_private_name(lua_State * L) {
int nargs = lua_gettop(L);
optional<unsigned> h;

View file

@ -31,6 +31,8 @@ pair<environment, name> add_private_name(environment const & env, name const & n
*/
optional<name> hidden_to_user_name(environment const & env, name const & n);
bool is_private(environment const & env, name const & n);
void open_private(lua_State * L);
void initialize_private();
void finalize_private();