From: Tom Sawyer Date: 2002-07-10T06:02:45+09:00 Subject: Re: Pre-RCR... nil.empty? that's the future of cgi? begats! isn't that going to break existing code? everywhere i put cgi['field'], such that i expect the array, will have to be changed to cgi.params['field']. is that correct? well, i can live with that. its seems like the better way, but i'll have work to do! yet, has anyone thought anymore on "preconditioning" cgi to know what to expect? could be useful for typecasting, formating, and error catching, as well as the aforementioned. ~trasnami On Tue, 2002-07-09 at 14:47, Patrick May wrote: > Tom Sawyer wrote in message news:<1026194588.24015.238.camel@silver>... > > did i miss something? how will it become unnecessary? > > currently: > > cgi["field"] == cgi.params["field"] # <= these return an array > string = cgi["field"][0] # <= array may be empty, > thus [0] may be nil > and must be tested > > future: > > cgi["field"] == cgi.params["field"].join # <= returns a string > cgi["field"].empty? # <= true if "field" > is missing or empty. > > Most of (my) time with web applications, I don't care about testing if > a field is missing. I do care about testing to make sure it's value > is something sensible. Thus, I don't miss the distinction of whether > a field is missing or empty. > > ~ Patrick > -- ~transami "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin