[svn] r5804: nemerle/trunk: boot/Nemerle.Compiler.dll
boot/Nemerle.Macros.dll boot/Nemerle.dll boot/ncc.ex...
nazgul
svnadmin at nemerle.org
Wed Oct 5 21:24:23 CEST 2005
Log:
Change TypleX to Tuple, FuncNewX to Function, FuncVoid to FunctionVoid and place them in Nemerle.Builtins namespace
Author: nazgul
Date: Wed Oct 5 21:16:43 2005
New Revision: 5804
Modified:
nemerle/trunk/boot/Nemerle.Compiler.dll
nemerle/trunk/boot/Nemerle.Macros.dll
nemerle/trunk/boot/Nemerle.dll
nemerle/trunk/boot/ncc.exe
nemerle/trunk/lib/internal-numbered.n
nemerle/trunk/lib/internal.n
nemerle/trunk/misc/gen-func.n
nemerle/trunk/ncc/external/InternalTypes.n
nemerle/trunk/ncc/external/LibrariesLoader.n
nemerle/trunk/ncc/hierarchy/NamespaceTree.n
Modified: nemerle/trunk/boot/Nemerle.Compiler.dll
==============================================================================
Binary files. No diff available.
Modified: nemerle/trunk/boot/Nemerle.Macros.dll
==============================================================================
Binary files. No diff available.
Modified: nemerle/trunk/boot/Nemerle.dll
==============================================================================
Binary files. No diff available.
Modified: nemerle/trunk/boot/ncc.exe
==============================================================================
Binary files. No diff available.
Modified: nemerle/trunk/lib/internal-numbered.n
==============================================================================
--- nemerle/trunk/lib/internal-numbered.n (original)
+++ nemerle/trunk/lib/internal-numbered.n Wed Oct 5 21:16:43 2005
@@ -28,43 +28,43 @@
using Nemerle.Extensions;
-// note that the fact that Tuple2 and 3 are structs
+// note that the fact that Tuple`2 and `3 are structs
// is also needed in MType.IsValueType
-namespace Nemerle.IntTypes {
-public abstract class FuncNew0 ['r] : FuncNew1 [System.Object, 'r]
+namespace Nemerle.Builtins {
+public abstract class Function ['r] : Function [System.Object, 'r]
{
public abstract apply () : 'r;
public override apply (_ : System.Object) : 'r { apply () }
}
-public abstract class FuncVoid0 : FuncNew0 [System.Object]
+public abstract class FunctionVoid : Function [System.Object]
{
public abstract apply_void () : void;
public override apply () : System.Object { apply_void (); null }
}
-public abstract class FuncNew1 ['p1, 'r]
+public abstract class Function ['p1, 'r]
{
public abstract apply (_ : 'p1) : 'r;
}
-public abstract class FuncVoid1 ['p1] : FuncNew1 ['p1, System.Object]
+public abstract class FunctionVoid ['p1] : Function ['p1, System.Object]
{
public abstract apply_void (_ : 'p1) : void;
public override apply (p1 : 'p1) : System.Object { apply_void (p1); null }
}
-public abstract class FuncNew2 ['p1, 'p2, 'r] : FuncNew1 [Tuple2 ['p1, 'p2], 'r]
+public abstract class Function ['p1, 'p2, 'r] : Function [Tuple ['p1, 'p2], 'r]
{
public abstract apply (_ : 'p1, _ : 'p2) : 'r;
- public override apply (o : Tuple2 ['p1, 'p2]) : 'r { apply (o.field0, o.field1) }
+ public override apply (o : Tuple ['p1, 'p2]) : 'r { apply (o.field0, o.field1) }
}
-public abstract class FuncVoid2 ['p1, 'p2] : FuncVoid1 [Tuple2 ['p1, 'p2]]
+public abstract class FunctionVoid ['p1, 'p2] : FunctionVoid [Tuple ['p1, 'p2]]
{
public abstract apply_void (_ : 'p1, _ : 'p2) : void;
- public override apply_void (o : Tuple2 ['p1, 'p2]) : void { apply_void (o.field0, o.field1); }
+ public override apply_void (o : Tuple ['p1, 'p2]) : void { apply_void (o.field0, o.field1); }
}
@@ -73,22 +73,22 @@
StructuralEquality,
TupleToString,
StructuralHashCode]
- public struct Tuple2 ['p0, 'p1]
+ public struct Tuple ['p0, 'p1]
{
public field0 : 'p0;
public field1 : 'p1;
}
-public abstract class FuncNew3 ['p1, 'p2, 'p3, 'r] : FuncNew1 [Tuple3 ['p1, 'p2, 'p3], 'r]
+public abstract class Function ['p1, 'p2, 'p3, 'r] : Function [Tuple ['p1, 'p2, 'p3], 'r]
{
public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3) : 'r;
- public override apply (o : Tuple3 ['p1, 'p2, 'p3]) : 'r { apply (o.field0, o.field1, o.field2) }
+ public override apply (o : Tuple ['p1, 'p2, 'p3]) : 'r { apply (o.field0, o.field1, o.field2) }
}
-public abstract class FuncVoid3 ['p1, 'p2, 'p3] : FuncVoid1 [Tuple3 ['p1, 'p2, 'p3]]
+public abstract class FunctionVoid ['p1, 'p2, 'p3] : FunctionVoid [Tuple ['p1, 'p2, 'p3]]
{
public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3) : void;
- public override apply_void (o : Tuple3 ['p1, 'p2, 'p3]) : void { apply_void (o.field0, o.field1, o.field2); }
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3]) : void { apply_void (o.field0, o.field1, o.field2); }
}
@@ -97,23 +97,23 @@
StructuralEquality,
TupleToString,
StructuralHashCode]
- public struct Tuple3 ['p0, 'p1, 'p2]
+ public struct Tuple ['p0, 'p1, 'p2]
{
public field0 : 'p0;
public field1 : 'p1;
public field2 : 'p2;
}
-public abstract class FuncNew4 ['p1, 'p2, 'p3, 'p4, 'r] : FuncNew1 [Tuple4 ['p1, 'p2, 'p3, 'p4], 'r]
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4], 'r]
{
public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4) : 'r;
- public override apply (o : Tuple4 ['p1, 'p2, 'p3, 'p4]) : 'r { apply (o.field0, o.field1, o.field2, o.field3) }
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4]) : 'r { apply (o.field0, o.field1, o.field2, o.field3) }
}
-public abstract class FuncVoid4 ['p1, 'p2, 'p3, 'p4] : FuncVoid1 [Tuple4 ['p1, 'p2, 'p3, 'p4]]
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4]]
{
public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4) : void;
- public override apply_void (o : Tuple4 ['p1, 'p2, 'p3, 'p4]) : void { apply_void (o.field0, o.field1, o.field2, o.field3); }
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4]) : void { apply_void (o.field0, o.field1, o.field2, o.field3); }
}
@@ -123,7 +123,7 @@
TupleToString,
StructuralHashCode,
DisableImplicitConstructor]
- public sealed class Tuple4 ['p0, 'p1, 'p2, 'p3]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3]
{
public field0 : 'p0;
public field1 : 'p1;
@@ -131,16 +131,16 @@
public field3 : 'p3;
}
-public abstract class FuncNew5 ['p1, 'p2, 'p3, 'p4, 'p5, 'r] : FuncNew1 [Tuple5 ['p1, 'p2, 'p3, 'p4, 'p5], 'r]
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5], 'r]
{
public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5) : 'r;
- public override apply (o : Tuple5 ['p1, 'p2, 'p3, 'p4, 'p5]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4) }
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4) }
}
-public abstract class FuncVoid5 ['p1, 'p2, 'p3, 'p4, 'p5] : FuncVoid1 [Tuple5 ['p1, 'p2, 'p3, 'p4, 'p5]]
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5]]
{
public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5) : void;
- public override apply_void (o : Tuple5 ['p1, 'p2, 'p3, 'p4, 'p5]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4); }
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4);}
}
@@ -150,7 +150,7 @@
TupleToString,
StructuralHashCode,
DisableImplicitConstructor]
- public sealed class Tuple5 ['p0, 'p1, 'p2, 'p3, 'p4]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4]
{
public field0 : 'p0;
public field1 : 'p1;
@@ -159,16 +159,16 @@
public field4 : 'p4;
}
-public abstract class FuncNew6 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'r] : FuncNew1 [Tuple6 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6], 'r]
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6], 'r]
{
public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6) : 'r;
- public override apply (o : Tuple6 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5) }
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5) }
}
-public abstract class FuncVoid6 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6] : FuncVoid1 [Tuple6 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6]]
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6]]
{
public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6) : void;
- public override apply_void (o : Tuple6 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5); }
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5); }
}
@@ -178,7 +178,7 @@
TupleToString,
StructuralHashCode,
DisableImplicitConstructor]
- public sealed class Tuple6 ['p0, 'p1, 'p2, 'p3, 'p4, 'p5]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5]
{
public field0 : 'p0;
public field1 : 'p1;
@@ -188,16 +188,16 @@
public field5 : 'p5;
}
-public abstract class FuncNew7 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'r] : FuncNew1 [Tuple7 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7], 'r]
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7], 'r]
{
public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7) : 'r;
- public override apply (o : Tuple7 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6) }
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6) }
}
-public abstract class FuncVoid7 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7] : FuncVoid1 [Tuple7 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7]]
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7]]
{
public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7) : void;
- public override apply_void (o : Tuple7 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6); }
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6); }
}
@@ -207,7 +207,7 @@
TupleToString,
StructuralHashCode,
DisableImplicitConstructor]
- public sealed class Tuple7 ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6]
{
public field0 : 'p0;
public field1 : 'p1;
@@ -218,16 +218,16 @@
public field6 : 'p6;
}
-public abstract class FuncNew8 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'r] : FuncNew1 [Tuple8 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8], 'r]
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8], 'r]
{
public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8) : 'r;
- public override apply (o : Tuple8 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7) }
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7) }
}
-public abstract class FuncVoid8 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8] : FuncVoid1 [Tuple8 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8]]
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8]]
{
public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8) : void;
- public override apply_void (o : Tuple8 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7); }
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7); }
}
@@ -237,7 +237,7 @@
TupleToString,
StructuralHashCode,
DisableImplicitConstructor]
- public sealed class Tuple8 ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7]
{
public field0 : 'p0;
public field1 : 'p1;
@@ -249,16 +249,16 @@
public field7 : 'p7;
}
-public abstract class FuncNew9 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'r] : FuncNew1 [Tuple9 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9], 'r]
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9], 'r]
{
public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9) : 'r;
- public override apply (o : Tuple9 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8) }
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8) }
}
-public abstract class FuncVoid9 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9] : FuncVoid1 [Tuple9 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9]]
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7,'p8, 'p9]]
{
public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9) : void;
- public override apply_void (o : Tuple9 ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8); }
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8); }
}
@@ -268,7 +268,7 @@
TupleToString,
StructuralHashCode,
DisableImplicitConstructor]
- public sealed class Tuple9 ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8]
{
public field0 : 'p0;
public field1 : 'p1;
Modified: nemerle/trunk/lib/internal.n
==============================================================================
--- nemerle/trunk/lib/internal.n (original)
+++ nemerle/trunk/lib/internal.n Wed Oct 5 21:16:43 2005
@@ -156,7 +156,7 @@
namespace Nemerle.Utility
{
- public class Identity ['a, 'b] : IntTypes.FuncNew1 ['a, 'b] where 'a : 'b
+ public class Identity ['a, 'b] : Builtins.Function ['a, 'b] where 'a : 'b
{
// do not work :/
//public static Instance : Identity ['a, 'b] = Identity.['a, 'b] ();
Modified: nemerle/trunk/misc/gen-func.n
==============================================================================
--- nemerle/trunk/misc/gen-func.n (original)
+++ nemerle/trunk/misc/gen-func.n Wed Oct 5 21:16:43 2005
@@ -12,7 +12,7 @@
});
def tps = (tp + ["'r"]).ToString (", ");
// def tupl = if (tp.IsEmpty) "object" else tp.ToString (" * ");
- def tupl_k = if (g) $ "Tuple$k $tp" else $ "Tuple$k";
+ def tupl_k = if (g) $ "Tuple $tp" else $ "Tuple";
def tupl = if (tp.IsEmpty || ! g) "System.Object" else tupl_k;
cnt = -1;
@@ -24,10 +24,10 @@
$ "o.field$(cnt + 1)"
}).ToString (", ");
- print ("public abstract class FuncNew$k [$tps]");
+ print ("public abstract class Function [$tps]");
when (k != 1)
- print ($ " : FuncNew1 [$tupl, 'r]");
+ print ($ " : Function [$tupl, 'r]");
def parms = tp.Map (fun (tp) { $ "_ : $tp" }).ToString (", ");
print ("\n{\n");
@@ -49,9 +49,9 @@
// FuncVoid1 is subtype of FuncNew and other are subtype of FuncVoid with lower parms
if (k <= 1)
- print ($ "public abstract class FuncVoid$k$(tps') : FuncNew$k [$tpso]\n{\n");
+ print ($ "public abstract class FunctionVoid$(tps') : Function [$tpso]\n{\n");
else
- print ($ "public abstract class FuncVoid$k$(tps') : FuncVoid1 [$tupl]\n{\n");
+ print ($ "public abstract class FunctionVoid$(tps') : FunctionVoid [$tupl]\n{\n");
print ($ " public abstract apply_void ($parms) : void;\n");
cnt = 0;
@@ -93,7 +93,7 @@
StructuralEquality,
TupleToString,
StructuralHashCode$impl
- public $cl Tuple$k [$tp]
+ public $cl Tuple [$tp]
{
");
for (mutable i = 0; i < k; ++i)
Modified: nemerle/trunk/ncc/external/InternalTypes.n
==============================================================================
--- nemerle/trunk/ncc/external/InternalTypes.n (original)
+++ nemerle/trunk/ncc/external/InternalTypes.n Wed Oct 5 21:16:43 2005
@@ -252,21 +252,15 @@
}
}
+ static name = ["Nemerle", "Builtins", "Tuple"] : list [string];
+
internal this (size : int)
{
- def name = ["Nemerle", "IntTypes", sprintf ("Tuple%d", size)];
- tycon = NamespaceTree.LookupInternalType (name);
+ tycon = NamespaceTree.LookupInternalType (name, size);
fields = array (size + 1);
for (mutable i = 1; i <= size; ++i)
fields [i] = get_field (i);
- match (tycon.LookupMember (".ctor")) {
- | [x] =>
- match (x.GetKind ()) {
- | MemberKind.Method (m) => ctor = m
- | _ => assert (false)
- }
- | xs => assert (false, xs.ToString ())
- }
+ ctor = tycon.LookupMember (".ctor").Head :> IMethod;
}
}
@@ -309,19 +303,21 @@
}
}
+ static function_name = ["Nemerle", "Builtins", "Function"] : list [string];
+ static function_void_name = ["Nemerle", "Builtins", "FunctionVoid"] : list [string];
+
internal this (size : int)
{
- def name = ["Nemerle", "IntTypes", sprintf ("FuncNew%d", size)];
- tycon = NamespaceTree.LookupInternalType (name);
+ tycon = NamespaceTree.LookupInternalType (function_name, size + 1);
foreach (meth :> IMethod in tycon.LookupMember ("apply")) {
- when (List.Length (meth.GetParameters ()) == size) {
+ when (meth.GetParameters ().Length == size) {
assert (apply == null);
apply = meth
}
};
assert (apply != null);
- def name = ["Nemerle", "IntTypes", sprintf ("FuncVoid%d", size)];
- void_tycon = NamespaceTree.LookupInternalType (name);
+
+ void_tycon = NamespaceTree.LookupInternalType (function_void_name, size);
apply_void = void_tycon.LookupMember ("apply_void").Head :> IMethod;
}
}
Modified: nemerle/trunk/ncc/external/LibrariesLoader.n
==============================================================================
--- nemerle/trunk/ncc/external/LibrariesLoader.n (original)
+++ nemerle/trunk/ncc/external/LibrariesLoader.n Wed Oct 5 21:16:43 2005
@@ -520,16 +520,16 @@
else
[];
- if (framework_type.Namespace == "Nemerle.IntTypes") {
+ if (framework_type.Namespace == "Nemerle.Builtins") {
def make_tupl (l) {
| [x] => x
| [] => InternalType.Void
| _ => MType.Tuple (l)
}
- if (tc.Name.StartsWith ("Tuple"))
+ if (tc.Name == "Tuple")
MType.Tuple (parms)
- else if (tc.Name.StartsWith ("FuncVoid"))
+ else if (tc.Name == "FunctionVoid")
MType.Fun (make_tupl (parms), InternalType.Void)
else {
def (front, last) = parms.DivideLast ();
Modified: nemerle/trunk/ncc/hierarchy/NamespaceTree.n
==============================================================================
--- nemerle/trunk/ncc/hierarchy/NamespaceTree.n (original)
+++ nemerle/trunk/ncc/hierarchy/NamespaceTree.n Wed Oct 5 21:16:43 2005
@@ -467,13 +467,20 @@
}
- public LookupInternalType (name : list[string]) : TypeInfo {
+ internal LookupInternalType (name : list[string]) : TypeInfo {
match (LookupExactType (name)) {
| Some (t) => t
| None => Util.ice ("unbound internal type " + name.ToString ("."))
}
}
+ internal LookupInternalType (name : list[string], args_count : int) : TypeInfo {
+ match (LookupExactType (name, args_count)) {
+ | Some (t) => t
+ | None => Util.ice ("unbound internal type " + name.ToString (".") + args_count.ToString ())
+ }
+ }
+
public LookupExactType (name : string) : option [TypeInfo] {
namespace_tree.LookupType (NString.Split (name, '.'), -1)
}
More information about the svn
mailing list