Skip to content

Commit

Permalink
docs: Orb.Import.defw example
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalIcing committed Jun 18, 2024
1 parent df60597 commit c5e7ca1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/orb/import.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ defmodule Orb.Import do

@doc """
Declare the name and signature of function that will be imported.
```elixir
defmodule Log do
use Orb.Import
defw(int32(a: I32))
defw(int64(a: I64))
defw(two_int32(a: I32, b: I32))
end
```
"""
defmacro defw(call, result_type \\ nil) do
alias Elixir.Orb.{Func, Import}
Expand Down

0 comments on commit c5e7ca1

Please sign in to comment.