From: "Mauricio Fernández" Date: 2002-10-04T03:22:44+09:00 Subject: Re: bugs On Thu, Oct 03, 2002 at 10:05:37PM +0900, William Djaja Tjokroaminata wrote: > > As for me, I voted for |external;local| > Hi Mauricio, > > Isnt't that using the syntax below contrary to "the ruby way" that we > should be able to create a variable at any time, anywhere? Not quite: a = [1, 2, 3] b = "I'll change" c = "I'm static" a.each do |b| # whatever # can use other vars any way I want end # here b = 3 a.each do |;c| #whatever #can use other vars any way I want end # c still the same Now I see this syntax (or my understanding of it) is broken as you cannot specify the order in which your vars are assigned... Maybe a.each do |:a,b,:c,d| # a and c local # b and d "external" (outer scope) end It is better to mark local vars as this way all the existing code works unmodified. I've used ':' cause I cannot think of any other semantics for it in that position. You see, it's still "the Ruby way" as it's just like before, only with additional scope markers. If we want to discriminate between variable usages, it's either this or "my"... -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Linux: Where Don't We Want To Go Today? -- Submitted by Pancrazio De Mauro, paraphrasing some well-known sales talk