3 ms·
The function 'trues' seems like clutter when you can just write: (keep [_] seq)
by foonamefoo 19y ago
The function 'trues' seems like clutter when you can just write:
(keep [_] seq)
- pg 19y agoThat would call the elements of seq.
- foonamefoo 19y agoOh, right.. two much python in my head, not enough lisp. Now I'm interested, what is the shortest lambda in arc that just returns the first argument? If I'm getting this right the best I can come up with is [progn _], turning my example into: (keep [progn _] seq) And thus I see the need for trues =P.
- foonamefoo 19y ago>two much python and two little english
- foonamefoo 19y agoHmm I bested it... ['(_) 0] beats [progn _] by one character, but it sure is ugly.
- bayareaguy 19y agoDoes [1 _] work?
- pg 19y agoThe shortest literal fn would be [if _]. But really you'd use idfn, not a literal fn.