How to reduce a list?
Posted: Sat Jul 03, 2010 2:52 pm
I have a list like this:
I want to reduce it and get list like this:
I can make it via "ref" or "find" or "filter" operators, but list is pretty big (3'000 records), so speed is important for me.
It takes about 3-4 seconds to reduce list on my PC, but I want 0.5 seconds or even less. May be, there is a special operator for list reducing in newLISP?
Code: Select all
'((1 Oil 2)
(1 Oil 5)
(1 Oil 7)
(2 Gas 4)
(2 Gas 12))
Code: Select all
'((1 Oil 2 5 7)
(2 Gas 4 12))
It takes about 3-4 seconds to reduce list on my PC, but I want 0.5 seconds or even less. May be, there is a special operator for list reducing in newLISP?