Jeeves v0.1.0 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

def(call, body) (macro)

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

def_implementation(caller, call, body)
set_state(new_state, list) (macro)

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