[Jprogramming] Make a list recursively
Adrian May
adrian.alexander.may at gmail.com
Mon Mar 28 19:00:26 HKT 2011
> inc2 =: 2&+
> app2 =: 1 : '(] , x@{:@])'
> inc2 app2^:5[2 4 6
Yup. That's what I was after. But can't it be done tacitly?
(I'm thinking in terms of recursion cos that's what I'd do in Haskell: I'd
define an infinite list starting from i, which is i followed by the infinite
list starting from inc(i), then I'd lazily take the first few elements.)
Adrian.
More information about the Programming
mailing list