From: gabriele renzi Date: 2004-11-12T19:23:27+09:00 Subject: Re: Receiving blocks in Proc? nobu.nokada@softhome.net ha scritto: > Hi, > > At Fri, 12 Nov 2004 12:38:37 +0900, > Yukihiro Matsumoto wrote in [ruby-talk:120009]: > >>|> > I have no plan to allow this. I have alternative idea, which allows >>|> > parentheses instead of brackets. But it still is a vague idea, no >>|> > promise. >> >>|I tried it but it breaks many code. >> >>Yours was too thorough, I guess. What I was thinking was to allow >>calling parentheses only after >> >> * predefined local variables >> * explicit method calls (with parentheses) >> >>which should break less code. > > > Well, it did just those things, IIRC. Yes, "many" was not > correct word, but, even in bundled libraries, tests and > samples, some codes were using the variable of the same name as > a method. sorry if I'm asking a stupid question, I know I am dumb.. but would'nt be enough to give precedence to a method when called and to the variable when not explicit called? I.e. a=proc {|x| 'proc' } a # # a() # 'proc' a 10 # 'proc' def a(x) p 'meth' end a # # precedence to var, as now a() # 'meth' precedence to meth as now a 10 # 'meth' precedence to meth as now Maybe this is impossible to do at runtime and when building the ast you were just making a simple 'text substitution' like a() => a.call() ?