Charles Roddie, this would work with "islands" of C# files compiled together and knowing about previous compiled islands, 1.cs can't know about 4.cs in your case.
I think kotlin has such support with java too.
I'd see this idea coming to fruition first in scripting:
where it is easy to figure out the topoligical graph of script files to include, compile in separate assemblies and link.
If this is made, then work on same feature in project system would be great.
I think that would also give few kicks to Jetbrains to finally start implementing F# support and more importantly, this would restore some trust in having the whole of MS people working on .NET focused on making best platform with highest level of interop among all the languages, having them invest major engineering efforts which benefits all the languages (current and future) to have easy embedding of all IL compilers in a meta compiler.
F# file ordering is also a major aspect making this seem viable.
issue on github https://github.com/Microsoft/visualfsharp/issues/56
I agree with Reed and use same convention, and I do benefit from the warning.
To workaround the fact you can't use the constructor as first class function only takes a single line function while having the warning and convention of using new only for IDisposable could form a nice convention in F# codebases.
It is unfortunate that this suggestion mixes 2 concerns:
* declarations to be mutually referential (which most people don't want as seen in comments)
* have the compiler figure out the order rather than have to specify it manually
I think the later point would be a great thing for end-users, and that doesn't circumvent at all file ordering being there and necessary, only it would be figured out by the compiler.
I concur that we need fuller support of .net type system.
Dave, can you show how mixed of positional and indexed arguments would play together?
Should we reuse string.format notation with braces?
Dave, do you think that would still be useful with making your variable name short in the scope where you want to print it:
(**)let n = mySecretNumber
(**)printfn "%i %x %A" n n n
I think it is interesting idea (but with a 0 based index and robust compiler checks) but maybe not as useful as string interpolation?
Don, have you considered that fsc now takes a response file?
I think the tooling issue is becoming manageable, for the widespread msbuild project files there is fsprojects/forge tool, and I think support for project.json will be added when it matures.
A precompiler directive solution (#require) seems also like a good way to have that made explicit in the source, I think this approach could be studied (with an extra tool as Kevin mentions), but would require some tooling or compiler support (we want error message if a file doesn't exist).
agree with Alexei to have fsharp-y syntax (although I'm not familiar with OCaml, I'm sure there are advantages in the way they open modules), I should have put more details in the suggestion but can't edit it.
I'm also considering if having "partial" open (to bring only select symbols in scope) is something which would be valuable.
F# is functional first but has to support quite a bit of imperative style constructs which makes it very practical.
Without let, it would be difficult to understand the scope of definitions, difficult to catch if I mistyped a symbol name.
I think the list of ambiguity this would create is huge and I'm not in favor of this proposition.
It seems there are other areas where this could also take place?
It is a bit annoying to have to explicitly cast but at least it is consistent wherever expected type is not an exact match.
Introducing this for yield only would create a special case.
Alexey, your example would cause "This is not a valid constant expression." error.
Lenne, do you mean the value to be substituted at compile time? (I guess yes as it is a compiler directive).
I'm not sure I see value in this, is there prior art (any other compiler does that?)
I generally move those type of strings in a separate module, and can consider generating this module file as a preliminary build step.
Also, I think this can be addressed by a type provider altogether, maybe you should consider this instead?
Interesting, what about a notation that would bring closer to mathematical notation?
I believe a library solution is good enough:
let undefined () = raise (System.NotImplementedException())
I'm concerned that "do blocks" will be difficult to discern from "do while" blocks.
I'd appreciate this feature be brought to F# but it needs to not clash with do blocks IMHO.
What is expected error message if any of the DU member has data defined for it?
Actually found out it works with enclosing parens:
match pat with
| SynPat.LongIdent(_) -> ()
but it doesn't work with identifier (case whose utility is close to 0)
match pat with
| SynPat.LongIdent(a) -> ()
For discrimated union, the root type expose get_Is* methods, it should be exposed as Is* methods instead.