Initializing Lists using fill


#1

I just stumbled on List!fill while wondering if there were any shortcuts for List initialization. It seems like such a trivial thing but it really made me smile when I found it.

List!fill 3 [@@random.uniform_int(100)]
{13, 67, 57}

List{Boolean}!fill 10 [idx.mod(2) = 0]
{true, false, true, false, true, false, true, false, true, false}