Hi,
I think the problem is that FSI doesn't support module and namespace keywods (when entering text using Alt+Enter) if you use them to declare namespace/module name the whole file.

If you just want to compile all declarations in the file (module) and make them available to a FSI, than you can use the #load command:

1
2
3
4
5
> #load "file1.fs";;
> #load "file2.fs";;
> open MyCompany.MyNamespace.MyModule2;;
> b;;
val it = 42

Alternatively, you could structure the code differently, so that the modules can be entered to FSI:

1
2
3
4
5
6
7
#light
module MyModule1 = 
  let a = 1

module MyModule2 = 
  open MyModule1
  let b = a + 1

In this case, you should be able to select the whole module and compile it in FSI using Alt+Enter.

By on 8/17/2007 5:31 AM ()

Is there a way to avoid having to use #I to specify the path to my files prior to using #load?

--
Jeff S.

By on 8/17/2007 11:43 AM ()

Ahh, very helpful, thank you. Wouldn't it be great if there were a #loadAll command that processed each file in the solution?

--
Jeff S.

By on 8/17/2007 5:57 AM ()

Another example: consider these lines in a file all by itself:

#lightmodule MyCompany.RnD.MyProject.MyModule#r "prj_adrToolkit.dll"open System.Collections.Genericopen MyCompany.RnD.Adr // in prj_adrToolkit.dllopen Microsoft.FSharp.Mathopen System.Data.Sqlopen System.Data.SqlClientopen System.Data.Commonopen System.Data
Alt+Entering this code produces,
file1.fs(5,0): error: syntax error.
>
file1.fs(5,1): error: FS0039: The value or constructor 'r' is not defined.stopped due to error

But if I Alt+' each line individually, I only get one error:

;; ^^^
stdin(31,0): error: syntax error.
on line 2, not 31. The reported line number increases by 3 every time I Alt+' line 2.

Seems inconsistent, even if all these FSI shortcuts do is copy+paste+add ";;".

Shouldn't FSI interpret the source text more like the compiler does?

--
Jeff S.

By on 8/16/2007 3:58 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