On Tue, Sep 27, 2011 at 4:55 PM, Mark Niemiec <[email protected]> wrote:
> Use of global x and y is NEVER prohibited.

That's a contextual issue, I think.

Your point -- that when global y cannot be used we can go to a
different context to use it -- is valid.  I could define:

getGlobalY=: 1 :'".''y'''
setGlobalY=: 1 :'''y''=:m'

and these can be used anywhere to get and set the global value for y.

But y=:1 will still be an error in some contexts.  And, for good
reason.  It's there to discourage people from writing code that will
in most cases not do what they probably think it would do.

Meanwhile, if you do not like the word "prohibited" to describe "not
allowed [in certain contexts]" that can also be an issue, but I am not
sure how interesting that one can be.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to