Logo

Programming-Idioms

History of Idiom 207 > diff from v5 to v6

Edit summary for version 6 by steenslag:
New Ruby implementation by user [steenslag]

Version 5

2019-11-04, 18:59:53

Version 6

2019-11-28, 23:56:01

Idiom #207 allocate a list that is automatically deallocated

Allocate a list / array a containing n elements (n assumed to be too large for a stack) that is automatically deallocated when the program exits the scope it is declared in.

Idiom #207 allocate a list that is automatically deallocated

Allocate a list / array a containing n elements (n assumed to be too large for a stack) that is automatically deallocated when the program exits the scope it is declared in.

Code
a = Array.new(n)