ResizeArray is an alias for System.Collections.Generic.List<T>. I believe this type is available in mono in version 1.2, have you tried accessing System.Collections.Generic.List directly?

Don't know if mono will be supported by the productized version, but I suppect a good way to ensure it is, is to keep using it and keep asking questions about it here ;)

Cheers,
Rob

By on 11/4/2007 11:27 PM ()

Well, ResizeArray is built upon System.Collections.Generic.List. But when I tested it yesterday, I still got no luck with it. For example, the following code works fine on Windows but fails on Mono:

# open System.Collections.Generic;;
# let create (n:int) x = new List<_> {for i in 1..n -> x};;

The error message is:

let create (n:int) x = new List<_> {for i in 1 .. n -> x};;
-----------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

stdin(12,23): error: FS0041: No overloads match for method List`1. Some sample overloads and possible errors follow.
Possible overload: 'List() : unit'.
Possible overload: 'List(IEnumerable<'?11381> collection) : unit'.
Possible overload: 'List(int capacity) : unit'.
stopped due to error

I'm totally alien to C#, can any one explain what it means? Is this the reason why ResizeArray is not supported on Mono?

[Update]: Everything works fine with the fsc compiler, all these problems happen when using fsi toplevel.

By on 11/5/2007 1:21 AM ()

For a while Mono 2.0 support was a bit unreliable, but it now seems very good. As a relic of this F# still uses the 1.0 profile for Mono by default. In particular the install-mono.sh script contains

echo "Replacing fsi.exe and fsc.exe with programs that run under .NET 1.0..."
cp -p bin/fsi.exe bin/fsi-old.exe
cp -p bin/fsc.exe bin/fsc-old.exe
cp -p bin/fscp10.exe bin/fsc.exe
cp -p bin/fsi10.exe bin/fsi.exe

Try skipping these steps or running the bin/fsi-old.exe instead of bin/fsi.exe. If all goes well this will use the 2.0 profile of Mono. Startup times will be a little slower because of the lack of AOT on Mono 2.0. You can also try the "--cli-version 2.0" command line option to both fsc.exe and fsi.exe.

Kind regards

Don

By on 11/5/2007 7:20 AM ()

Hi Don,

Thanks for the suggestion.

Actually, I've already been using F#/CLR 2.x on Mono for some time, but I forgot the toplevel is still 1.x. The 2.x toplevel does support ResizeArray, Thanks! The disadvantage is the 2.x toplevel seems to have more problems on readline then the 1.x version: even the backspace fails to work and error messages are mostly shown in strange codeset.

Btw, the shipped bin/fsc.exe is not a .net assembly but a native win32 program. I actually built a F#/CLR 2.x fsc.exe by bootstrapping the source.

Unfortunately, the makefile script for fsi.exe is missing, I won't be able to rebuild the fsi.exe on Linux to see whether it can support readline better.

By on 11/5/2007 1:57 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