RosettaCodeData/Task/Multiple-distinct-objects/Julia/multiple-distinct-objects-1.jl

3 lines
162 B
Julia
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
foo() = rand() # repeated calls change the result with each call
repeat([foo()], outer=5) # but this only calls foo() once, clones that first value