From: Ben Tilly Date: 2001-02-17T03:37:24+09:00 Subject: [ruby-talk:10990] Re: RCR Summary 02/16/01 "Mike Wilson" wrote: > > >>From: "Ben Tilly" >>Reply-To: ruby-talk@ruby-lang.org >>To: ruby-talk@ruby-lang.org (ruby-talk ML) >>Subject: [ruby-talk:10975] Re: RCR Summary 02/16/01 >>Date: Sat, 17 Feb 2001 01:58:49 +0900 >> >>Do you mind just anyone adding a request? I was about to >>and then thought better of it. > >Well, I don't really mind right now, but thought I should get folks in the >habit of posting stuff to ruby-talk, and I'll summarize on the wiki. That >way, as we grow, things won't get too chaotic (well, they will for me, but >not for the community ;) with everyone posting their own items to the wiki. > >> >>There are three requests I have actually. All connected >>to enabling Ruby to catch most of my typos. >> >>1. Have a pragma to lexically turn off the ability >> to declare a variable as a variable just by >> assigning to it. >> >>2. Add an explicit alternate way to declare a variable. >> >>3. Keep track of what symbols are currently in use as >> method names, and add an assertion that all methods >> accessed in the current class should now be defined >> or inherited. (An assertion that you would normally >> place at the end of a class.) >> >>Those 3 should make a reasonable spellchecker between >>them. :-) >> >>Cheers, >>Ben > >I'll go ahead and suggest, feel free to ignore my suggestion ;), that you >post seperately for each of these, with a little more detail/enticement to >get people talking. As it stands, I've got a decent idea of what you want, >but could also use a little more detail for the change request summary >(especially #2). If, for some reason, you don't want to post with more >detail, I'll try to summarize as best I can. Well 1 and 2 are intertwined. 2 is just the request that there be another way to declare that something is a variable. Like "let" in Lisp or "my" in Perl. By itself this is useful as a way of telling Ruby that I don't care if there is already something in scope called foo, this foo is private. 1 is the request that there be a pragma to (lexically) disallow declaring a variable by just assigning to it. Combining 1 and 2 you can therefore avoid accidentally creating variables through a typo. Of course you call lots of methods. And 3 is the request to keep track of what methods have been implicitly called and have a function you can call that checks that they all resolve properly. If you make a habit of adding this at the end of classes, this will catch the common error where a method will blow up later due to a typo. (There is, of course, no good way to test for typos in explicit method calls. That wouldn't stop it from being a useful feature though.) Oh, if I am going to make requests, I would also like it if "#foo" was syntactic sugar for "#{foo}". (Just to stop people complaining that interpolation requires 2 extra characters.) Cheers, Ben _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com