diff --git a/src/library/private.cpp b/src/library/private.cpp index f6db2f0eb..df8efd7df 100644 --- a/src/library/private.cpp +++ b/src/library/private.cpp @@ -76,6 +76,10 @@ optional hidden_to_user_name(environment const & env, name const & n) { return it ? optional(*it) : optional(); } +bool is_private(environment const & env, name const & n) { + return static_cast(hidden_to_user_name(env, n)); +} + static int add_private_name(lua_State * L) { int nargs = lua_gettop(L); optional h; diff --git a/src/library/private.h b/src/library/private.h index bcdf6da5b..a2f17de0a 100644 --- a/src/library/private.h +++ b/src/library/private.h @@ -31,6 +31,8 @@ pair add_private_name(environment const & env, name const & n */ optional 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();