eliminate writeln et comp?

Sean Reque seanthenewt at yahoo.com
Wed Mar 18 10:45:24 PDT 2009


Ruby handles this by putting such functions on its IO class as instance methods, and then defining global functions that are just aliases to more verbosely calling instance methods on global IO objects. For instance, puts is just an alias to $stdout.puts, gets is just an alias to $stdin.gets, etc. That way, people who want to type as little as possible to write Hello World programs are happy, and people who want a consistent object-oriented syntax and the benefits of polymorphism are also happy. Everyone is happy!



More information about the Digitalmars-d mailing list