From: patrick-may@... (Patrick May) Date: 2002-07-09T08:05:03+09:00 Subject: Re: Pre-RCR... nil.empty? TAKAHASHI Masayoshi wrote in message news:<20020708023508V.maki@rubycolor.org>... > It's important that CGI is not the usual case. In CGI, > NULL response and empty string are not different. But, > as I said, we sometimes distinguish between NULL and > empty string. > Therefore, it's the problem with CGI, not with NilClass. I agree with this. CGI interaction with forms has some murky situations: An unchecked checkbox will result in *no* parameter being submited. A multiple select with nothing selected will result in *no* parameter. A radio button with nothing selected will result in *no* parameter. An empty text field submits an empty string. An empty textarea submits an empty string. The standards are screwy, and this leaves room for discussion about the 'best' way to deal with this parameters. One idea off the top of my head: cgi.text['field'] => use rules for text fields to determine value cgi.radio['field'] => use rules for radio buttons cgi.checkbox['field'] => use rules for checkbox and so forth. This isn't the only solution, I'm not even sure if it's the one I prefer :-). I like Wakou's suggestion that cgi['field'] return cgi.params['field'].join("\0"). Basically, I think Dave's problem (having to do 2 checks) originates with the CGI / form standards, and should be solved within (or near) the CGI module. ~ Patrick P.S. I don't want to suggest that cgi.rb is bad. CGI protocol is bad, making the design of cgi.rb hard.