From: Yuri Leikind Date: 2003-01-24T03:54:29+09:00 Subject: Re: emulating C preprocessor's #if On Fri, 24 Jan 2003 03:51:44 +0900 Yuri Leikind wrote: > module M > > def M.print_platform > print "Platform is..." + M.platform_dependent_code() + "\n" > end > > case RUBY_PLATFORM > > when /solaris/i then > def M.platform_dependent_code > "Solaris" > end > when /linux/i then > def M.platform_dependent_code > "Solaris" > end > when /win/i then > def M.platform_dependent_code > "Solaris" > end > else > def M.platform_dependent_code > "unknown" > end > end > end > > M.print_platform sorry, wrong values in M.platform_dependent_code method: module M def M.print_platform print "Platform is..." + M.platform_dependent_code() + "\n" end case RUBY_PLATFORM when /solaris/i then def M.platform_dependent_code "Solaris" end when /linux/i then def M.platform_dependent_code "Linux" end when /win/i then def M.platform_dependent_code "Windows" end else def M.platform_dependent_code "unknown" end end end M.print_platform ___ Best regards, Yuri Leikind The people sensible enough to give good advice are usually sensible enough to give none.