lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


 

To Grey Knight

 

>How well does it interact with the regular Lua types?

 

The struct system are built for value validation, any lua string can pass the System.String’s validation, there is no special data for the struct part, they are regular Lua types with contracts.

 

> There are a few functions like Map, Filter, Range, ToList, Reduce, Each, Any, All, First, FirstOrDefault which I expected to be on Iterable rather than IList, why is that?

 

Well, I diff the collections to List & Dictionary(for hash), I don’t think a dictionary can have any value as its first. So the IList is focused on the value, and the IDictionary is focused on the key-value paris.

 

> about GetDefault(enum): another C#-ism I didn't like was that everything is defaultable.  Sometimes I have types for which there is no sensible default value, I expect the user must always provide something explicitly.

 

You can find more details in the member struct, its fields can be requirable.

 

> I'm not clear on the difference between struct and class in your model.

 

The struct are designed for value validation, and also provide structures for tables who have no meta-table related, so they are simply data types, normally used as value in the system.