Tangent work tonight was some updates to the .NET importer and certain bits of the type system to support importing generic types such that the objects still interoperated with .NET where only .NET types were involved, but supported Tangent types for the generic params. Plus getting Tangent's partial application of type params working beside .NET's required full application. Pretty much entirely aimed at getting lists and dictionaries.
Most things seem to be there now. The types are imported nicely, the generic params setup for the equivalent Tangent Type. I'm not exactly a whiz at .NET reflection, so I'm feeling my way into discovering the vagaries of generic parameters and the such. Plus some of the bits and oddities surrounding enumerators and explicit interface implementations. Those things are keeping the useful bits of Lists from being imported. Once that's done, I'll need to add generic type binding to Tangent syntax; and then foreach.
I've got 3 choices I figure for Tangent foreach.
1- Make it just like C# foreach.
2- Include an implicit 'where typeof(x) == foo':
List Inventory;//...foreach(Bottle entry in Inventory){ // implicitly no-op on Inventory entries which are not Bottles quaff entry;}
3- Implement primitive matching (essentially sugar for anonymous method groups) and make foreach a specialized use for it:
//// syntax designed on the fly!//List Inventory;//...foreach(entry in Inventory){ match (entry)=>void{ (Bottle)=>{ quaff entry; } (Garbage)=>{ drop entry; } (NuclearWeapon)=>{ activate entry; } (Any)=>{ } } }
Not quite sure yet. #3 can mostly be implemented on-top of 1 or 2 if need be. I'm wary of treading on functional niceties at this point. Not familiar enough to know many of the nuances, quirks and expectations of them. I'm not too worried that the naive use cases aren't sufficient enough for getting stuff done, but I'm not too confidant that I'd implement things sufficiently for those who are aware of the quirks.