hallo,
i have a problem with type inference on global methods. nemerle 0.9.3.
is this supported
in the snapshots or the svn trunk???
sorry i can not test this at the
moment. On SuSE 10.3 i have Mono 1.2.6 and i can not compile nemerle
snapshot. i think i need the new mono 1.9.
Where can i find the history of nemerle ???
Operations.n:14:46:14:49: error: type inference on global methods is
not yet supported
Operations.n:14:17:14:49: error: type inference not allowed here
class Operations {
public static Swap (n1 : out int, n2 : out int) {
def tmp = n1;
n1 = n2;
n2 = tmp;
}
}
AFAIK the bug in mono is still alive.
> > Where can i find the history of nemerle ???
>
> What exactly do you mean by history? :)
>
> > Operations.n:14:46:14:49: error: type inference on global methods is
> > not yet supported
> > Operations.n:14:17:14:49: error: type inference not allowed here
> >
> > class Operations {
> > public static Swap (n1 : out int, n2 : out int) {
> > def tmp = n1;
> > n1 = n2;
> > n2 = tmp;
> > }
> > }
>
> Just specify void return type ;)
> >
> >
>
>
>
> >
>
--
Kamil Skalski
http://nazgul.omega.pl
1. Nemerle can be used as automation language, but it is not scripting
language.
We can implement feature like "evaluate expression within the current
context -- a = berstr("b
+c*(func(a)/3.4)")", but it will be work slowly.
2. Nemerle is not Pascal. And convert syntax will be very difficulty (I think).
I think all other item you get or can be implement if you choice Nemerle.
PS
What is "usw"?
A scripting language is interpreter, but automation language can be
compiled before execution (as also interpreted).
> what is slow -- milliseconds, seconds, minutes or ???
In first run about second (one or two) in second milliseconds. Point
is that you should compile code before execute it. In first time you
need initialize compiler, in second time you should compile code into
MSIL and JIT it. If you cache dynamic assembly (which introduce in
compilation process) second time execution can be match faster in
comparison with interpreter.
You can also combine Nemerle compiler with expression evaluator like
contains in Nemerlish.
> 2. Yes, Nemerle is Pascal and we have much to rewrite of our code. but
> have we any
> alternative or know you ???? c# is nearest to "our" pascal i think.
> or you think we
> have to code our own nemerle (with other syntax,...).
What you mean under Pascal (or under Nemerle is Pasca)?
Yes, second[s], if it will be compiled on demand and don't use cache
of assemblies.
But I not understand why need 'string expression' evaluation.
> 2. it is better to write our own cli compiler/interpreter or should we
> use nemerle and
> rewrite our code??? what is better ???
The best way (in my opinion) use Nemerle itself (it syntax).
Of course, create compiler is very difficult. Nemerle developed more
than 5 years.
Interpreter you already have...
You can write simple class (wrappers) for array and string. All what
you need - modify indexer in it classes. Also you can define extension
methods which shift index, but it not right way.
You not need use blocks for return value. Last value of
function/method is it return value. Wellcom into functional world!
static Main (argv : array [string]) : int
{
def app = QApplication(argv);
def button1 = QPushButton("Hello World!");
button1.Resize(100,30);
button1.Show();
QApplication.Exec(); // It's work
}
Also you can open Nemerle.Imperative namespase and use imperative
operators like return/break/continue:
...
usung Nemerle.Imperative;
module Program
{
static Main (argv : array [string]) : int
{
when (someCondition())
return 0; // it's work
def app = QApplication(argv);
def button1 = QPushButton("Hello World!");
button1.Resize(100,30);
button1.Show();
QApplication.Exec(); // It's work
}
And what a problem?
Why you need eval string expression in script?