Huh, that's really odd error.
I can't see what could be wrong - I did the same change as you described on my PC (though I'm using more recent version of F# - you can get it from [1]) and it works a expected - my updated version of the sample is here: [link:tomasp.net] so you can try looking at it if there is any difference from the changes you did (if it won't work on your machine then I would try getting more recent F#).

[1] [link:research.microsoft.com]

By on 7/18/2007 12:33 PM ()

Great Tomas, that seems to work. It's worrying that something so basic should be so broken however. How ready is F# for the real world ? I know that MS Research use it internally on some major projects ( terminator springs to mind - hope I'm right about that !), but I still can't believe it didn't work for me. It almost looked like some strange multi-threaded race issue.

I'll see how easy it is to port to Ocaml in the meantime.

Mark

By on 7/20/2007 8:56 AM ()

Hi guys,

Yes, there was a bug with multi-entry hash tables in this release. Changing "Hashtbl.add" to "Hashtbl.replace" should work.

Note using "Hashtbl.add" is actually wrong, and I've nowadjusted the sample. OCaml hash tables (which we're emulating with Hashtbl) can store multiple entries for each key, hence using "add" is creating multiple mappings for the same key. Personally I've come around the belief that this design is flawed, and hence we tend to use the .NET collection type System.Collections.Generic.Dictionary all the time these days.

One reason why the bug hung around was that multi-entry hash tables aren't used very often.

Kind regards

Don

By on 7/20/2007 10:02 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