< Back to IRCAM Forum

First element in a list

Hi all
I search a solution to get the first elements of sub-list. For example if I have : ((6200 6600 7800) (5900 6600 7400) (5500 6200 7100) (5400 6200 6900) (5200 5900 6700) (4700 6200 6600) (6200 6600 7800) (5900 6600 7400) (5500 6200 7100) (5400 6200 6900) (4700 6200 6600) (5200 5900 6700)) I want get : (6200 5900 5500 5400 5200 4700 6200, etc…)
Thanks for help
A

Hi Able,

The basic function to have the first element in a list is car.
So you need to mapcar the list with car like so:
Screenshot_2021-09-25_17-10-15

Easy no?

Best
K

1 Like