| How do you destructively remove the nth element of a list? Currently I do: (def rmnth (n lst)
(join (firstn n lst) (nthcdr inc.n lst)))
(mac popnth (n lst)
`(= ,lst (rmnth ,n ,lst)))
I tried simply: (mac popnth (n lst)
`(pop (nthcdr ,n ,lst)))
And shader taught me why this doesn't work [1], but is there a better solution than my above popnth via rmnth?[1] http://arclanguage.org/item?id=11475 |