From 4840f480c8f255a6cf3b4eed291a00cea76b0cac Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Mon, 10 Nov 2025 17:31:41 +0100 Subject: feat(calc): supports function definition and evaluation --- lib/math/rational.ex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/math/rational.ex') diff --git a/lib/math/rational.ex b/lib/math/rational.ex index c3d94c9..e788883 100644 --- a/lib/math/rational.ex +++ b/lib/math/rational.ex @@ -83,9 +83,8 @@ defmodule ElixirMathParser.Math.Rational do iex> Rational.is_rational("My quick brown fox") false """ - defguard is_rational(val) - when is_map(val) and is_map_key(val, :__struct__) and is_struct(val) and - :erlang.map_get(:__struct__, val) == __MODULE__ + def is_rational(val) when is_map(val) and is_map_key(val, :__struct__) and is_struct(val), + do: :erlang.map_get(:__struct__, val) == __MODULE__ @doc """ Creates a new Rational number. -- cgit v1.2.3