Skip to content

Commit 9da2dd9

Browse files
committed
v0.62.1
1 parent 1538a30 commit 9da2dd9

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## v0.62.1 - 2025-08-07
4+
5+
- `string.inspect` now shows Erlang atoms as `atom.create("value")`, to match
6+
the latest version of `gleam_erlang`.
7+
38
## v0.62.0 - 2025-07-10
49

510
- The `digits` and `undigits` functions of the `int` module have been deprecated.

gleam.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "gleam_stdlib"
2-
version = "0.62.0"
2+
version = "0.62.1"
33
gleam = ">= 1.11.0"
44
licences = ["Apache-2.0"]
55
description = "A standard library for the Gleam programming language"

src/gleam_stdlib.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ inspect_atom(Atom) ->
332332
Binary = erlang:atom_to_binary(Atom),
333333
case inspect_maybe_gleam_atom(Binary, none, <<>>) of
334334
{ok, Inspected} -> {gleam_atom, Inspected};
335-
{error, _} -> {erlang_atom, ["atom.create_from_string(\"", Binary, "\")"]}
335+
{error, _} -> {erlang_atom, ["atom.create(\"", Binary, "\")"]}
336336
end.
337337

338338
inspect_maybe_gleam_atom(<<>>, none, _) ->

test/gleam/string_test.gleam

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,54 +1187,50 @@ pub fn inspect_erlang_atom_is_valid_in_gleam_test() {
11871187

11881188
@target(erlang)
11891189
pub fn inspect_erlang_atom_with_a_leading_underscore_is_invalid_in_gleam_test() {
1190-
assert string.inspect(string_to_erlang_atom("_ok"))
1191-
== "atom.create_from_string(\"_ok\")"
1190+
assert string.inspect(string_to_erlang_atom("_ok")) == "atom.create(\"_ok\")"
11921191
}
11931192

11941193
@target(erlang)
11951194
pub fn inspect_erlang_atom_with_a_trailing_underscore_is_invalid_in_gleam_test() {
1196-
assert string.inspect(string_to_erlang_atom("ok_"))
1197-
== "atom.create_from_string(\"ok_\")"
1195+
assert string.inspect(string_to_erlang_atom("ok_")) == "atom.create(\"ok_\")"
11981196
}
11991197

12001198
@target(erlang)
12011199
pub fn inspect_erlang_atom_with_a_double_underscore_is_invalid_in_gleam_test() {
12021200
assert string.inspect(string_to_erlang_atom("ok__ok"))
1203-
== "atom.create_from_string(\"ok__ok\")"
1201+
== "atom.create(\"ok__ok\")"
12041202
}
12051203

12061204
@target(erlang)
12071205
pub fn inspect_erlang_atom_with_white_spaces_is_invalid_in_gleam_test() {
12081206
assert string.inspect(string_to_erlang_atom("ok ok"))
1209-
== "atom.create_from_string(\"ok ok\")"
1207+
== "atom.create(\"ok ok\")"
12101208
}
12111209

12121210
@target(erlang)
12131211
pub fn inspect_erlang_atom_that_is_an_empty_string_is_invalid_in_gleam_test() {
12141212
// An empty string based atom is invalid in gleam
1215-
assert string.inspect(string_to_erlang_atom(""))
1216-
== "atom.create_from_string(\"\")"
1213+
assert string.inspect(string_to_erlang_atom("")) == "atom.create(\"\")"
12171214
}
12181215

12191216
@target(erlang)
12201217
pub fn inspect_erlang_atom_with_uppercases_invalid_in_gleam_test() {
12211218
assert string.inspect(string_to_erlang_atom("Upper"))
1222-
== "atom.create_from_string(\"Upper\")"
1219+
== "atom.create(\"Upper\")"
12231220
}
12241221

12251222
@target(erlang)
12261223
pub fn inspect_erlang_atom_tag_tuple_test() {
12271224
assert string.inspect(#(string_to_erlang_atom("DOWN"), 1, 2))
1228-
== "#(atom.create_from_string(\"DOWN\"), 1, 2)"
1225+
== "#(atom.create(\"DOWN\"), 1, 2)"
12291226
}
12301227

12311228
@target(erlang)
12321229
pub fn inspect_erlang_atom_with_leading_digit_invalid_in_gleam_test() {
12331230
assert string.inspect(string_to_erlang_atom("1_ok"))
1234-
== "atom.create_from_string(\"1_ok\")"
1231+
== "atom.create(\"1_ok\")"
12351232

1236-
assert string.inspect(string_to_erlang_atom("1Ok"))
1237-
== "atom.create_from_string(\"1Ok\")"
1233+
assert string.inspect(string_to_erlang_atom("1Ok")) == "atom.create(\"1Ok\")"
12381234
}
12391235

12401236
@target(erlang)

0 commit comments

Comments
 (0)