Just like arrays, it would be nice to (optionally) be able to limit what you can stuff into a map or list.
Something like:
Then, if I tried to stuff, say, a filename in a string into the Songs map, the compiler would give an error.
This syntax, of course, should be optional.
Not only would it stop some unnecessary bugs, it would also make the code clearer by clearly stating "I intend this list to hold objects of this type!".
Something like:
B4X:
Dim Songs as Map of cMediaFiles
Dim Events as List of cCalendarEvents
Then, if I tried to stuff, say, a filename in a string into the Songs map, the compiler would give an error.
This syntax, of course, should be optional.
Not only would it stop some unnecessary bugs, it would also make the code clearer by clearly stating "I intend this list to hold objects of this type!".