[fpc-pascal] How can I implement "thrice" in Free Pascal?
andrew.pennebaker at gmail.com
Mon Oct 17 22:51:30 CEST 2011
Haskell lets you define functions like thrice, which accepts an element of
type a and returns a list of the element repeated three times, for any data
thrice :: a -> [a]
thrice x = [x, x, x]
I know the answer involves generics, but the docs don't offer examples using
Free Pascal's built-in generic types.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal