Hi Piotr,

F#'s lists are immutable so they cannot be changed. Points is a state

variable in your program and if you do not want mutable state you have

to explicitly pass each new state around (your points list) or use a

state monad / state computation expression. In your case i think it

easier to just use a mutable ResizeArray (F#'s equivalent of a C# List)

because you're working with an imperative GUI library. You could then isolate

the imperative code from the rest of the program.

By on 12/2/2008 3:04 AM ()

Thanks for your answer. Unfortunately you confirmed what I was afraid of. Using ResizeArray was something that I wanted to avoid in order to keep the code as "pure" as possible but I guess there's no point to insisting on staying functional when using imperative libraries.
Anyway, the code is updated and works fine now.

Cheers,
Piotr

By on 12/2/2008 2:13 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper