FAQ

From Nemerle Homepage

Interop with .Net: Is it possible to use Nemerle compiled Assemblies in C# code?

Yes, it is possible. From version 0.2, Nemerle is practically a full CLS consumer and extender. Thus one can extend in Nemerle any CLS compliant class created from other language and vice versa. There are of course issues with mapping of purely Nemerle features (like variants), but as long as you do not use them in public interfaces there should be no problems. You can also reference .NET generics between Nemerle and C# 2.0 freely.


Can I create a program using Windows Forms on my Windows XP box?

Yes, you can. You can use System.Windows.Forms for GUI (Windows platform or not yet 100% complete implementation under Mono) or Gtk# (both Windows and Linux platforms). Simplest test application using these libraries is here.

You can compile this program with following command:

ncc form.n -r System.Windows.Forms -o form.exe


Could you please provide an example of a macro definition, which can be compiled with ncc?

An exemplary macro, the code using it and the full compilation process is now described on macros tutorial page.


What does "Nemerle" mean?

It is inspired by a name of mage Nemmerle from book of Ursula K. Le Guin "A Wizard of Earthsea" (spelling with a single 'm' is a design decision ;-) )


Does Nemerle run on Mono?

Yes, it does. As a matter of fact, Mono is currently our primary development platform. We have developers working both on Linux (Mono) and Windows (.Net Framework 2.0). We are planning to widen our support for more .Net runtime environments.


Why types of method parameters and return value cannot be inferred just like for local functions?

This is because of the documentation reason (it is better to explicitly give types in public methods) and interoperability. Type inference for private functions is still being considered.


Why doesn't fun(x){x.foo} compile?

After a long work on better type inference engine we are proud to say, that such code compiles in most cases now. The inference engine will gather information about the type of x from the use place of fun.


What about "break" and "continue" in Nemerle ?

These constructs are forms of "goto" and are generally discouraged by us and against Nemerle style. We encourage structuring your code into local functions. You can also use block feature, which gives more local and expression oriented way of breaking control flow. Finally, you can just import Nemerle.Imperative namespace and use "break" and "return" as you like.


How do you debug a Macro - is there anything like Lisp's macro-expand?

There is a compiler switch -dt, that dumps typed trees (after macro expansion) of expressions.


What are variants internally? Are they treated as structs or classes, that is, are they passed by value?

Variants are classes internaly, so they are passed by reference. Each variant option is a nested class of variant class and inherits from it. This way you can have methods in variant, which work also for every variant option.

Retrieved from "http://nemerle.org/FAQ"
remember
You are very welcome to contribute to the documentation here!