win32utils-devel@rubyforge.org
2004-Mar-13 23:41 UTC
[Win32utils-devel] Quick thought on win32-mmap
I suggest getting rid of the hash style arguments fior new() for this package. In this particular case, you already have a class and accessors, so you can just use the yield trick, e.g. rb_yield(self) if rb_block_given_p(). Thus you can do: mm = Mmap.new do |m| m.namespace = file m.swapfile = sfile m.size = 1024 end Looks just as nice, and is a lot less code on the C side of things. I only use the hash-style keys when I don''t feel like creating separate objects, or where separate objects don''t really make sense. I''ll make this change unless anyone objects. Dan _________________________________________________________________ One-click access to Hotmail from any Web page – download MSN Toolbar now! http://clk.atdmt.com/AVE/go/onm00200413ave/direct/01/