[erlang-questions] re moving nth element from a list

Anupam Kapoor <>
Wed Jun 25 07:46:24 CEST 2008


Richard A. O'Keefe <> wrote:
On 25 Jun 2008, at 2:40 am, anupamk wrote:
,----
| > That's actually a serious reply.  More generally, why do you want to
| > do this?  Removing the nth element from a list is going to be O(n)
| > no matter what you do; perhaps some kind of tree structure would
| > suit your needs better.
`----
here is the (slightly long, and perhaps boring story):

i wanted to get a good taste of erlang core language itself. everyone
tries to get into distributed+fault-tolerant nature of erlang. before
going that far, i wanted to write a simple application in it. 

i have written the simplex (linear programming) in couple of languages
before, and i just wanted to contrast that experience in erlang. now,
for doing this, i can :

    - either learn erlang's ffi for interfacing with external math libs
    - or develop my own elementary matrix/vector manipulation routines.

for better or for worse, i chose the latter. now, vector-dot-products
are easy, however while computing vector-cross-products, i need the
'remove-nth' thingie.

sorry for boring you with this. 

and thank you very much for your insightful replies.

kind regards
anupam
      



More information about the erlang-questions mailing list