2014-01-15 45 views

回答

4

随着解构:

((fn [[a b] c] (list a c b)) '(bread bread) '(ham chicken)) 
=> (bread (ham chicken) bread) 
+0

即使我得到了答案 - 我将这个标记为接受 - 因为它整洁!几乎在同一时间干杯 – monojohnny

+0

! :) – tangrammer

+2

国际海事组织,它更容易做到这样的特设解构在一个让,而不是一个匿名函数。例如,'(让[[ab]'(bread bread),c'(ham chicken)](list acb))' – Chuck

0

OK - 得到的东西那就行得通....

(def wrapper '(bread bread)) 
(def filling '(ham chicken)) 
(list (first wrapper) filling (last wrapper)) 
相关问题