Re: My sloppy ABS function ;-)
- Posted by Hawke <mdeland at NWINFO.NET> Sep 06, 1998
- 625 views
Ralf Nieuwenhuijsen wrote: > Anyways, if we're discussing algorithms, here are a few more suggestions: >* reproduce (object x, integer count) >-- works like repeat, however all >elements are concato.. ? (the word behind the '&' operator) if you meant: --x={1,2, {3,4, {5,6} } } --y=reproduce(x,3) --print(y) output:{{1,2,{3,4,{5,6}}},{1,2,{3,4,{5,6}}},{1,2,{3,4,{5,6}}}} then there is no need for a seperate function 'reproduce'. as function reproduce is simply: function reproduce(object z, integer num) return repeat(z,num) end function which means you could have simply said: --y=repeat(x,3) instead of y=reproduce(x,3) as above. if, however, you mean something else, then i'm not sure what that would be. --Hawke'