From: Devin Mullins Date: 2005-07-20T09:05:07+09:00 Subject: Re: `not' in parameter lists Daniel Brockman wrote: >This message ended up getting pretty long and off-topic, >with lots of jabbering about syntax, and ending with a >shameless plug. So read it at your own risk. > > Yeah. Sorry, the disclaimer encouraged me to put off reading this for a day. >> assert ((foo.respond_to? :bar) and (plurgh.include? :mif)) >> >>Difficult to read and understand? >> >> > >Not particularly, but a little. I'm not used to that style, >which I guess is why I actually consider the full-blown Lisp >syntax more readable: > > (assert (and (foo.respond_to? :bar) (plurgh.include? :mif))) > >Of course, the conventional Ruby style is just as readable: > > assert foo.respond_to?(:bar) && plurgh.include?(:mif) > > Yeah, my Lisp-with-commas description was always slightly tongue-in-cheek. I find (method *arguments) more readable than method(*arguments) though, especially in a nest of stuff. Yeah, the Ruby one's alright... > (case > (when (bar.respond-to? :moomin) > (puts "snufkin") > (else > (something-or-other)) > > I dunno. Unnecessary parens, IMO. Also, I don't like putting a close paren/closing tag/end keyword at the end of a line unless the open paren/open tag/begin keyword is at the beginning of the same line. That way it's easier to spot code that's missing an end-tag. (And you can't give up the end-tag unless you want significant whitespace.) Joel Spolsky has a decent piece on making wrong code *look* wrong. Of course, in it, he advocates Hungarian notation, but one can look past that to see the meat of the article... :) >Therefore, I think the parentheses of a last-parameter >nested method call should be optional, analogously to the >implicit hash syntax. > OK, for what it's worth, I like. >Maybe you'd be interested in a preprocessor[2] that lets you >use hyphens instead of underscores? > Yeek. Preprocessors = evil! Granted, this one's written in plain Ruby, which is neat, but still. If I could just say require 'hyphen-ruby' and not __END__ at the beginning of the code... > @timers.each { .fire if .ready? } > > That's neat. Devin eat_program. hehe...