tag:blogger.com,1999:blog-4704664917418794835.post2154503568735554613..comments2023-07-01T05:41:30.469-07:00Comments on Headius: Creating a Field-Initializing 'new' Methodheadiushttp://www.blogger.com/profile/15717357218364947795noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-4704664917418794835.post-19676874900220848682007-06-01T04:45:00.000-07:002007-06-01T04:45:00.000-07:00Hmmm nice to see Ruby taking hints from Groovy... ...Hmmm nice to see Ruby taking hints from Groovy... ;-)<br>This is surely helpful, what are the odds of this feature making into mainstream Ruby?Andres Almirayhttp://jroller.com/page/aalmiraynoreply@blogger.comtag:blogger.com,1999:blog-4704664917418794835.post-11182136875428604682007-06-01T07:33:00.000-07:002007-06-01T07:33:00.000-07:00Actually, I think my point was that Ruby doesn'...Actually, I think my point was that Ruby doesn't need to have language-level features like this added because it's trivial to extend the language to support them. There's probably no chance of this getting into mainstream Ruby since anyone could load those 20-25 lines of code themselves and have the feature available. That's what I love about Ruby...it may not have feature X from some other language, but it's almost always trivial to add it using a tiny amount of code.Charles Oliver Nutterhttp://www.blogger.com/profile/06400331959739924670noreply@blogger.comtag:blogger.com,1999:blog-4704664917418794835.post-26477513028415547362007-06-01T11:04:00.000-07:002007-06-01T11:04:00.000-07:00Sure, but I think this feature is really handy and...Sure, but I think this feature is really handy and perhaps a good number of developers like to have it in their projects, how many copies/versions of the code will exist? perhaps it won't make it into mainstream Ruby but I wonder if there is an extension project (like Java's jakarta-commons) where this feature may find a home.Andres Almirayhttp://jroller.com/page/aalmiraynoreply@blogger.comtag:blogger.com,1999:blog-4704664917418794835.post-46822571595929887252007-06-01T21:58:00.000-07:002007-06-01T21:58:00.000-07:00I think this solution, while cute, is too complex....I think this solution, while cute, is too complex.<br><br>eg:<br><br>class Person < Struct.new(:firstname, :lastname)<br><br>You can also just extend OpenStruct if you don't know what fields you will use ahead of time.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4704664917418794835.post-23614110266616831542007-06-03T19:06:00.000-07:002007-06-03T19:06:00.000-07:00Very clever, thank you for posting this.Very clever, thank you for posting this.Jason Seiferhttp://www.railsenvy.comnoreply@blogger.com