erl_features(3erl)
π erl_features(3erl) π
okay bestie, this is erl_features from the Erlang Module Definition manual, and she's all about feature support. Buckle up, because we're about to make feature flags make sense. π«Άβ¨
β¨ NAME β¨
erl_features β feature support. periodt. π
π¦ DESCRIPTION π¦
This module contains functions for supporting features that can be enabled/disabled in Erlang. It should be considered as mostly for internal use, although there are some functions that might be useful when writing tools.
Bestie, the docs literally say mostly for internal use β so she's giving internal-tool main character energy, not "random public API" vibes. Noted. π
π DATA TYPES π
feature() = atom()β a feature is an atom, iconic.release() = integer() >= 0β a release is an integer that is zero or bigger.status() = experimental | approved | permanent | rejectedβ exactly these four statuses. no extras.type() = extension | backwards_incompatible_changeβ exactly these two types. no cap.
π EXPORTS π
β all() -> [feature()] β
Return a list of all known features. This list will include features that have been removed (status rejected) and features that are no longer configurable (status permanent). So yes, the removed girlies and the permanent girlies are still in the list β she's thorough. π
π configurable() -> [feature()] π
Return a list of all configurable features, that is, features with status experimental or approved. These are the features that can be enabled or disabled. That's the toggle-able squad, bestie. π₯
π₯ info(Feature :: feature()) -> FeatureInfoMap | no_return() π₯
Return a map containing information about the given feature. It's giving "tell me everything about this one specific feature" energy. π
Types:
Description = string()
FeatureInfoMap =
#{description := Description,
short := Description,
type := type(),
keywords := [atom()],
status := status(),
experimental => release(),
approved => release(),
permanent => release(),
rejected => release()}
π§ enabled() -> [feature()] π§
Return a list of the features that are currently enabled. Note that the set of enabled is set during startup and can then not be changed. So startup locks it in β after that, no take-backs, periodt. π«π
πΈ used(Module :: module() | file:filename()) -> [feature()] πΈ
Return the list of features enabled when compiling the module. The module need not be loaded, but is found if it exists in the loadpath. If not all features used by the module are enabled in the runtime, loading the module is not allowed.
So if the runtime doesn't have every feature the module used, the module cannot load. That's a hard no, bestie. ππ«
cute sign-off: this page is brought to you by Ericsson AB, version stdlib 4.3.1.3, and the footer has no date β mysterious era, honestly. πβ¨
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms