Greatest element of a list: Difference between revisions
→{{header|Vim Script}}: Fix indentation (tabs → spaces)
(→Joy: add) |
(→{{header|Vim Script}}: Fix indentation (tabs → spaces)) |
||
Line 4,534:
for strings (with configurable ignore-case):
<syntaxhighlight lang="vim">function! Max(list, ...)
" {list}
" {a:1}
if empty(a:list)
endif
let gt_op = a:0>=1 ? get({'i': '>?', 'I': '>#'}, a:1, '>') : '>'
Line 4,545:
let idx = 1
while idx < len
endwhile
return maxval
|