Here is my guess:

- a week ago you did have some crazy operator overloading in TestLibrary, and that was the last time you compiled the library in 'Release' mode

- you've change the code now to something simple, but you're in 'Debug'

- the FSI command references the stale 'Release' version and so you see this weird behavior

Just a guess.

Also, aside on terminology: "arr.[ i]" is not 'array slicing', it's just indexing. Slicing is e.g. arr.[3..6].

By on 6/23/2010 12:02 PM ()

Brian,
Thanks for the response. I meant to also include sample code to show that array slicing was also failing besides the indexing.

To answer your points, I'm not overloading any operators in any of the libraries. Haven't had to do that yet. The TestLibrary is just something I quickly wrote this morning to give a simple example that showed the failure, so I'm definitely using the latest version. I also made sure to compile it for Release.

Your comments about compiling did get me thinking, however, and one thing I do is use the --standalone flag when building to bundle all the F#-specific libraries into the DLL. So I tried rebuilding everything without that flag, and that actually fixed the array indexing/slicing problem. I then added the flag back in, and it started failing again.

So why would that cause the failure? It doesn't seem like it should...

By on 6/23/2010 2:56 PM ()

If you compile with --standalone, then you cannot reference the resulting assembly from F# code. All kinds of weird stuff happens, since there are now two copies of FSharp.Core floating around (one embedded in the referenced app, and the real one referenced by the referencing app).

It would be better if we gave a compiler diagnostic about this; I'll file a bug.

By on 6/23/2010 3:34 PM ()

Thanks. In the meantime, what would be the best way to deploy the F# libraries along with the .dll (since I'll be compiling without the --standalone switch)? I was hoping not to have to do a setup project just for one .dll, but if I have to I will.

Also, I have a WCF service that references this .dll, so is there anything special I need to do to deploy it to IIS?

By on 6/23/2010 6:12 PM ()

Well, in the absence of another solution, I've deployed FSharp.Core.dll to the IIS server along with my WCF service .dll's (compiled without the --standalone option), and this seems to have solved the problem for the moment.

By on 6/25/2010 11:18 AM ()
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