Lazycoder

9Feb/050

dynamic typing of return values

You know what I’d really like out of a programming language? The ability to dynamically type the object I’m returning from my calling method. I’d like my method to be able to call another method and say “oh by the way, I’d like that to be a String object.” or “give me an int if possible” or “You are giving me a User class, I’d like that to be a MyUser class which is a sub-type of your User type.” I’d like to be able to specify multiple return values for my methods and let my method try to convert the return value to the type the calling method specifies.

I’d like my return values a’la carte I guess.