On Mon, 10 Mar 2014, SF Markus Elfring wrote:

> > Why do you want to do this?  There is a String.set function that allows 
> > you to modify a character of a string.  For a list, if you need to modify 
> > an element then it should be a list of reference cells.  But I think that 
> > in practice it would be strange for either operation to be necessary.
> 
> I would like to avoid unwanted run time behaviour because of unnecessary data
> copying when I will append text lines to a growing list.
> http://ocaml.org/learn/tutorials/comparison_of_standard_containers.html#Listsimmutablesinglylinkedlists
> 
> I imagine that in-place modification will be a more efficient approach for my
> use case. Is a kind of list buffer available?

You can just add information to the front of the list, and then reverse it 
at the end if that is needed.

julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to