Jeeves v0.1.2 Jeeves.Common
Summary
Functions
We replace the regular def with something that records the definition in a list. No code is emitted here—that happens in the before_compile hook
Used at the end of a service function to indicate that
the state should be updated, and to provide a return value. The
new state is passed as a parameter, and a do
block is
evaluated to provide the return value
Functions
We replace the regular def with something that records the definition in a list. No code is emitted here—that happens in the before_compile hook
Used at the end of a service function to indicate that
the state should be updated, and to provide a return value. The
new state is passed as a parameter, and a do
block is
evaluated to provide the return value.
If not called in a service function, then the return value of the function will be the value returned to the client, and the state will not be updated.
def put(store, key, value) do
set_state(Map.put(store, key, value)) do
value
end
end
With no do: block, returns the new state as the reply value.