This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Actions with the list

1 reply
Alexander Litvinov
Joined: 2010-10-17,
User offline. Last seen 15 weeks 1 day ago.

Hi. Explain me anybody please one the point. For example, i create and
initialize immutable of List[T] and something doing.

var l1: List[T] = (1 to 5).toList
Further doing reassign l1 of variable the value:

var l1: Int=>Int = x=>x

What is it should happen with allocated memory for l1? GC must free the
memory allocated for l1. In sum what become with list (1 to 5).toList?

Thans.
--

Alexandr Litvinov
skype: free.dvig
twitter: @dvig

Viktor Klang
Joined: 2008-12-17,
User offline. Last seen 1 year 27 weeks ago.
Re: Actions with the list

I'm sorry but that doesn't make any sense to me.

Viktor Klang
Code Connoisseur
@viktorklang

On Oct 24, 2010, at 14:36, Litvinov Alexandr wrote:

> Hi. Explain me anybody please one the point. For example, i create and initialize immutable of List[T] and something doing.
>
> var l1: List[T] = (1 to 5).toList
> Further doing reassign l1 of variable the value:
>
> var l1: Int=>Int = x=>x
>
> What is it should happen with allocated memory for l1? GC must free the memory allocated for l1. In sum what become with list (1 to 5).toList?
>
> Thans.
> --
>
> Alexandr Litvinov
> skype: free.dvig
> twitter: @dvig
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland