dao icon indicating copy to clipboard operation
dao copied to clipboard

Template type aliases?

Open Night-walker opened this issue 10 years ago • 2 comments
trafficstars

We need a proper way of supporting iterators in classes. ForIterator which yields any, thus eliding any kind of static checks, seems like a crude hack now, when we have such an advanced type system. I think that any should ultimately be used only when really anything is meant.

This is a good occasion to ask for support of templates in type aliases:

type ForIterator<@T> = tuple<valid: bool, iterator: @T>

Such thing could be of use beyond this case. For instance, I'm thinking about using it for named parameters, which currently look unnecessarily complex in their 'naked' form.

Night-walker avatar Apr 04 '15 20:04 Night-walker

I was already few times thinking about the any type (not only in the case of iterators), but I didn't come up with such elegant solution. The proposed type aliases look like a very strong tool and should be really useful.

dumblob avatar Apr 04 '15 21:04 dumblob

Ping.

dumblob avatar Apr 13 '19 11:04 dumblob