Commit 4a22c31f authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl

define equal_constructor, less_constructor and greater_constructor using...

define equal_constructor, less_constructor and greater_constructor using macros containing a local function with inline code, because the boot compiler does not yet support :== code in definition modules
parent 9c527a22
system module compare_constructor;
equal_constructor a b :== equal_constructor a b;
{
equal_constructor :: !a !a ->Bool;
equal_constructor _ _ = code inline {
pushD_a 1
pushD_a 0
pop_a 2
eqI
};
}
less_constructor a b :== less_constructor a b;
{
less_constructor :: !a !a ->Bool;
less_constructor _ _ = code inline {
pushD_a 1
pushD_a 0
pop_a 2
ltI
};
}
greater_constructor a b :== greater_constructor a b;
{
greater_constructor :: !a !a ->Bool;
greater_constructor _ _ = code inline {
pushD_a 1
pushD_a 0
pop_a 2
gtI
};
}
implementation module compare_constructor;
equal_constructor a b :== equal_constructor a b;
{
equal_constructor :: !a !a ->Bool;
equal_constructor _ _ = code {
.inline equal_constructor
equal_constructor _ _ = code inline {
pushD_a 1
pushD_a 0
pop_a 2
eqI
.end
};
}
less_constructor a b :== less_constructor a b;
{
less_constructor :: !a !a ->Bool;
less_constructor _ _ = code {
.inline less_constructor
less_constructor _ _ = code inline {
pushD_a 1
pushD_a 0
pop_a 2
ltI
.end
};
}
greater_constructor a b :== greater_constructor a b;
{
greater_constructor :: !a !a ->Bool;
greater_constructor _ _ = code {
.inline greater_constructor
greater_constructor _ _ = code inline {
pushD_a 1
pushD_a 0
pop_a 2
gtI
.end
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment