The JADE 2022 release meets tomorrow’s business demands.
FileVision UK Ltd 12/01/2018 4:52:34 AM
I'd like to vote against this - compile time errors are better than runtime errors.
Having said that, for the case where different kinds of collections could be passed but they all have the same member type, maybe something like a small subset of generic types could be used e.g. all of CustomerArray, CustomerSet and CustomerDictionary would be compatible with Collection.
Software Medical Infomatics Limited 11/01/2018 10:17:22 AM
Yes, I like that idea too. Probably easier to do it as an enhancement to the syntax than to change the semantics of the existing instruction.
Brian Johnstone 11/01/2018 9:32:03 AM
Another possible option would be to add an 'as' modifier to the foreach statement, similar to the existing 'as' modifier on the create statement. This would mean existing type checking rules could remain unchanged and make it more explicit to someone looking at the code that you expect the collection to contain only instances compatible with the supplied. Then, for those scenarios where you 'know' the content is only of a specific type you could code "foreach in as do" and get a 1086 should it encounter an instance not compatible with .