[erlang-questions] Spurious '100' in array:new
Fred Youhanaie
fly@REDACTED
Sat Jan 26 18:29:45 CET 2019
That's part of the internal structure of the array module, the data structure is opaque and should not be relied upon.
If you need to access/print the data contents of the array use array:to_list(Array).
If you're curious about the internal structure of the array, you're best option is to read the source code itself. You can also experiment with creating arrays of various sizes and assigning values to
some elements. Try sizes of 9, 19, 119, etc.
Cheers,
Fred
On 26/01/2019 16:10, Donald Steven wrote:
> When I declare a new fixed-size array (of 19 values) within a map, with the statement:
>
> Sound = #{
>
> contourTag => SndContour = array:new(19, {default,{0, unspecified, 0}}),
> ...
>
> },
>
> and print it out using io:format and ~p, I get:
>
> Sound: #{contourTag => {array,19,0,{0,unspecified,0},100},
>
> ---
>
> Where is the '100' coming from?
>
> Thanks.
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
More information about the erlang-questions
mailing list