> On Mar 13, 2019, at 1:32 AM, José Valim
> wrote:
>
> We can probably have the code show exactly that, no need for a new doctest
> entry.
Although my example didn't make much of a case for it, in some cases it may be
useful to have both the original doctest code and the translated code. If t
Hi
As Elixir has reached version 1 there's not going to be a major change of
syntax like this.
You could implement this as a macro in your own project though :)
use MyMacro
def add(x :: number(), y :: number()) :: number() do
x + y
end
Cheers,
Louis
On Wed, 13 Mar 2019, 08:34 , wrote:
>
Instead of doing this:
defmodule LousyCalculator do
@spec add(number, number) :: {number, String.t}
def add(x, y), do: {x + y, "You need a calculator to do that?!"}
@spec multiply(number, number) :: {number, String.t}
def multiply(x, y), do: {x * y, "Jeez, come on!"}
end
How about this
We can probably have the code show exactly that, no need for a new doctest
entry. I like this. Please open up an issue.
--
*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D
--
You received this message because you are subscribed to the Google Groups
"elixir-lang