Logo

Programming-Idioms

History of Idiom 26 > diff from v20 to v21

Edit summary for version 21 by :
[Erlang] Comment emphasize

Version 20

2016-01-26, 02:11:57

Version 21

2016-01-27, 11:02:58

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Code
X = [{R * 1.0, C * 1.0} || R <- lists:seq(1, M), C <- lists:seq(1, N)].
Code
X = [{R * 1.0, C * 1.0} || R <- lists:seq(1, M), C <- lists:seq(1, N)].
Comments bubble
You don't declare_ and initialize_ in Erlang. This is the closest thing.
Comments bubble
You don't declare and initialize in Erlang. This is the closest thing.
Doc URL
http://learnyousomeerlang.com/starting-out-for-real#list-comprehensions
Doc URL
http://learnyousomeerlang.com/starting-out-for-real#list-comprehensions
Demo URL
http://tryerl.seriyps.ru/#id=02f3
Demo URL
http://tryerl.seriyps.ru/#id=02f3