Re: Variable-length list?
- To: mathgroup at smc.vnet.net
- Subject: [mg83484] Re: Variable-length list?
- From: Ray Koopman <koopman at sfu.ca>
- Date: Wed, 21 Nov 2007 02:58:47 -0500 (EST)
- References: <fhu73f$71m$1@smc.vnet.net>
f[m_/;VectorQ[m, IntegerQ@# && Positive@# &], func_] := Outer[func, Sequence@@(Range/@m)] f[{3,4}, List ] {{{1,1},{1,2},{1,3},{1,4}}, {{2,1},{2,2},{2,3},{2,4}}, {{3,1},{3,2},{3,3},{3,4}}} f[{3,4}, Print@Times@##& ]; 1 2 3 4 2 4 6 8 3 6 9 12