Skip to content

Commit

Permalink
Add support for io:put_chars/2
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Guyot <[email protected]>
  • Loading branch information
pguyot committed Sep 29, 2024
1 parent 389ec97 commit e83188d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ also non string parameters (e.g. `Enum.join([1, 2], ",")`
- Add support to Elixir for `Keyword.split/2`
- Support for `binary:split/3` and `string:find/2,3`
- Support for large tuples (more than 255 elements) in external terms.
- Support for `io:put_chars/2`

### Changed

Expand Down
14 changes: 13 additions & 1 deletion libs/estdlib/src/io.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
%%-----------------------------------------------------------------------------
-module(io).

-export([format/1, format/2, get_line/1, put_chars/1]).
-export([format/1, format/2, get_line/1, put_chars/1, put_chars/2]).

%%-----------------------------------------------------------------------------
%% @doc Equivalent to format(Format, []).
Expand Down Expand Up @@ -96,3 +96,15 @@ put_chars(Chars) ->
{io_reply, Ref, Line} -> Line
end
end.

%%-----------------------------------------------------------------------------
%% @param Chars character(s) to write to console
%% @returns ok
%% @doc Writes the given character(s) to the console.
%% @end
%%-----------------------------------------------------------------------------
-spec put_chars(Device :: any(), Chars :: list() | binary()) -> ok.
put_chars(standard_error, Chars) ->
put_chars(Chars);
put_chars(standard_output, Chars) ->
put_chars(Chars).

0 comments on commit e83188d

Please sign in to comment.