From 5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Wed, 29 May 2019 21:02:55 +0100 Subject: Enable namespaced modules --- gen/src/std@int.erl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 gen/src/std@int.erl (limited to 'gen/src/std@int.erl') diff --git a/gen/src/std@int.erl b/gen/src/std@int.erl new file mode 100644 index 0000000..9942040 --- /dev/null +++ b/gen/src/std@int.erl @@ -0,0 +1,28 @@ +-module(std@int). +-compile(no_auto_import). + +-export([parse/1, to_string/1, to_base_string/2, compare/2]). + +parse(A) -> + gleam__stdlib:parse_int(A). + +to_string(A) -> + erlang:integer_to_binary(A). + +to_base_string(A, B) -> + erlang:integer_to_binary(A, B). + +compare(A, B) -> + case A =:= B of + true -> + eq; + + false -> + case A < B of + true -> + lt; + + false -> + gt + end + end. -- cgit v1.2.3