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

devdoer bird <>
Sat Aug 9 18:02:20 CEST 2008


Thanks.




2008/8/9, Robert Virding <>:
>
> 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 <>
>
>> setelement/3 is the function you're looking for.
>>
>> D.
>>
>> 2008/8/9 devdoer bird <>:
>>  > 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
>> > 
>> > http://www.erlang.org/mailman/listinfo/erlang-questions
>> >
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://www.erlang.org/mailman/listinfo/erlang-questions
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080810/0b5a932d/attachment.html>


More information about the erlang-questions mailing list