Translate "Add delete/1, mocked/0, and mocked_process/1" #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Translated(1) from 2Latinos/nuntius#28...
Notes on this implementation
defdelegate
for expressiveness/semantics.
after function names&
to pass a function referencefn
for consistency, but I get where the language's coming fromif
used"#{__MODULE__}.mocked_process"
is a ftw@doc false
@hidden
or@private
(since@doc
is already what you use for regular doc.) is cleaner and makes a lot of sense:
proc_lib
andtimer
surely could do with some wrappers (this is just aesthetics for me, really 😄)defp
/def
rebar3 xref
😢on_exit(
init_per_testcase
/end_per_testcase
, so it's a win^
)rebar3 xref
is also used for) I am torn between having better compile-time validation and forcing me to use a compiler option to not have it (choices, choices, ...)(1) an Erlang > Elixir translation, as presented here, is not a copy-paste exercise but rather a re-thinking of the implementation in a different language using that language's constructs as best as possible. The goal is to 1. make the API similar, 2. make it work, 3. make it idiomatic.