[erlang-questions] beginner:how to change a tuple's element

Robert Virding rvirding@REDACTED
Sat Aug 9 17:49:56 CEST 2008


But remember you are not changing the element in the tuple, you are creating
a new tuple which is a copy of the old one except for one new element. The
old tuple is still available. N.B. you only make a copy of the top tuple not
of its elements.

Robert

2008/8/9 Dave Smith <dizzyd@REDACTED>

> setelement/3 is the function you're looking for.
>
> D.
>
> 2008/8/9 devdoer bird <devdoer2@REDACTED>:
> > HI:
> >
> > I want to change a element  in one tuple,Eg. change the 3th element in
> tuple
> > {a,b,c,e} to 'g',the result will be {a,b,g,e}.
> > How can I do it?
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> >
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080809/28f3ea31/attachment.htm>


More information about the erlang-questions mailing list