> ven, 19 Feb 2010, Teemu Likonen skribis:
> > > [...]
> >
> > Good. Then perhaps (reduce <function> <sequence>) is
> > also in the category of easy-to-read. I thought I had
> > found an area in Lisp code which is difficult to
> > understand quickly but it seems I was at least
> > partially wrong.
Well it's going to depend on an individual's background of
course, but I think this style of programming is quite
prevalent now. It's available in many mainstream languages
and, don't forget, VimL has map() and filter().
> It is fairly easy to understand when the function apply
> to an argument, try another example to define a higher
> order function in terms of purely other functions without
> explicit appearance of argument.
Not 100% sure what you mean here, but writing HOFs shouldn't
be complex. I hope you don't mind me switching to what is
a more familiar language for me.
zipWith = function(fn,list1,list2)
map(function(val) fn(val[0],val[1]), zip(list1,list2));
I'm assuming that map and zip have been defined and that you
know how they work, of course :-). --Antony
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment