From: Dave Thomas Date: 2002-03-21T23:19:56+09:00 Subject: Re: Windows version of Ruby (proposals) Paul Brannan writes: > On Thu, Mar 21, 2002 at 11:04:55PM +0900, Dave Thomas wrote: > > Then, we provide a set of environment support modules for those > > classes that currently contain non-portable methods. We could have > > (for example) > > > > module SysdepFilePosix > > ... > > end > > > > module SysdepFileWin32 > > ... > > end > > > > Mix one of these into class File and you'll get all the system > > dependent calls. You'll also be explicitly marking your code as > > non-portable. > > This would be a global change, and may not be desirable. What are the > advantages of mixing a module into File over subclassing from File? I view it as changing the underlying semantics of a File object. I thought it would be confusing to have two file objects in the same program, one with portable semantics, and the other with (say) Window's-specific semantics. However, I'd be happy to be argued out of that idea. Mixin vs. subclassing is really a detail in the overall idea. Cheers Dave