(in Python) let's say i have a list of candidates
like this
a= [ (12, "Data1"), (5, "data"), (4, "..."), ...]
and i want to find the Tuple with the Min (1st) tag value.
in Python that's what min() gives, by default.
min(a)
Is this the same in Scheme(Gauche) ?
HenHanna wrote:
(in Python) let's say i have a list of candidates
like this
a= [ (12, "Data1"), (5, "data"), (4, "..."), ...]
and i want to find the Tuple with the Min (1st) tag value.
in Python that's what min() gives, by default.
min(a)
Is this the same in Scheme(Gauche) ?
(use gauche.collection) ;; find-min
(find-min
'[(12 "Data1") (5 "data") (4 "...")]
:key car)
===> (4 "...")
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 10:23:25 |
Calls: | 10,387 |
Calls today: | 2 |
Files: | 14,060 |
Messages: | 6,416,691 |