list = Partition[Range[20], 5, 5, 1, {}]
{{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20}}
pos = Transpose[{Through[First, Last] /@ list, Through[Last, First] /@ list}]
{{1, 5}, {6, 10}, {11, 15}, {16, 20}}
As you see, I've used Through twice. I think once should be enough, but I haven't been able to see how to do it with one Through. Any ideas?
{First[#], Last[#]} & /@ list? – b.gates.you.know.what Jun 12 '13 at 06:09Through[]:Through[{First, Last}[#]] & /@ list. Slot-free version:Composition[Through, {First, Last}] /@ list. – J. M.'s missing motivation Jun 12 '13 at 06:19Through[{First,Last}]/@list, you can answer my question too. – HyperGroups Jun 12 '13 at 06:22Through[{First, Last}] /@ listwon't work, as you've seen. That's because the syntax is supposed to beThrough[{f1, f2, f3, ...}[arg1, arg2, arg3, ...]]. You put in the functions, but forgot the arguments. – J. M.'s missing motivation Jun 12 '13 at 06:24Part?list[[All,{1,-1}]]– Simon Woods Jun 12 '13 at 07:45through, I tried your method here by{First[#], Last[#]} &/@. Maybe you can also give me come comments about that question. http://mathematica.stackexchange.com/q/27114/6648 – HyperGroups Jun 17 '13 at 04:06