понадобилось тут заиплементить один хитрый макрос, и вспомнил я, что в главе classic macros onlisp'a было что-то похожее. в теле искомого макроса использовалась ф-я mappend, которая, как оказалось, была введена автором в начале книги.
ф-я выглядит так:
(defun mappend (fn &rest lsts)
(apply #’append (apply #’mapcar fn lsts)))
описание:
mappend offers a nondestructive alternative to mapcan.
т.е. это не деструктивная альтернатива mapcan'y.
а это явный wtf, ибо from lisp hypespec:
----
mapcan and mapcon are like mapcar and maplist respectively, except that the results of applying function are combined into a list by the use of nconc rather than list. That is,
(mapcon f x1 ... xn)
(apply #'nconc (maplist f x1 ... xn))
and similarly for the relationship between mapcan and mapcar.
-----
т.е. mappend == macpcar.
вопрос: может где-то я не прав, и здесь имеет место быть некий хитрый подвох? =)


Ответ на:
комментарий
от mo3r

Ответ на:
комментарий
от asgard

Ответ на:
комментарий
от ratatosk

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.