[Aldor-l] Bool$Machine vs Bool$Builtin

Ralf Hemmecke ralf at hemmecke.de
Sat Nov 17 11:26:38 EST 2007


Can somebody explain the differences of what happens
for "aldor $opts aaa.as"
when opts is "BUILTIN", "MACHINE", and ""?

For what reason does LibAldor provide the "MACHINE" variant in favour of 
the other two?

Ralf

---BEGIN aaa.as
per x ==> x pretend %;
Type: with == add;
Tuple(T: Type): with == add;
(A: Tuple Type) -> (B: Tuple Type): Type == add;
Exit: with == add;

-------------------------------------------------------------------
#if BUILTIN
import {Bool: Type; BoolNot: Bool->Bool} from Builtin;
extend Bool: with {
	MyBooleanNot: % -> %;
} == add {
	MyBooleanNot(x: %): % == BoolNot x;
}
-------------------------------------------------------------------
#elseif MACHINE
MyMachine: with {
	Bool: Type;
	MyBooleanNot: Bool -> Bool;
} == add {
	Bool: Type == add;
	import {BoolNot: Bool -> Bool} from Builtin;
	MyBooleanNot(x: Bool): Bool == BoolNot x;
}
import from MyMachine;
#else
-------------------------------------------------------------------
import {Bool: Type; BoolNot: Bool->Bool} from Builtin;
MyBool: with {
	MyBooleanNot: Bool -> Bool;
} == add {
	MyBooleanNot(x: Bool): Bool == BoolNot x;
}
import from MyBool;
#endif
-------------------------------------------------------------------

define PrimitiveType: Category == with {
	=: (%, %) -> Bool;
	~=: (%, %) -> Bool;
     default {
#if BUILTIN
         import from Bool;
#endif
	(x: %) ~= (y: %): % == per MyBooleanNot(x=y);
     }
}
---END aaa.as




More information about the Aldor-l mailing list