You misread my message, locale in J is also global. Passing the
name of a locale and the content of locale are quite different.
you may serialize the content of locale into a noun but I think
this is not needed in most cases.
Вт, 25 апр 2017, Xiao-Yong Jin написал(а):
> What kind of mess it would be if you remove locale support.
>
> I would argue that encapsulating using locale is central to J's growth.
> Do you think you can remove locale in any of those important packages
> distributed by JAL? And they are solving a huge number of problems
> for me.
>
> On the flip side, I can also argue for you. Since we can pass
> atomic representation around in J, one only need a finite amount
> of lists of boxed AR for each package, and with proper prefixing
> (elisp people have been doing this for a long time), we don't need
> encapsulating.
>
> By the way, there is one feature of locale that I found superior than
> any other programming languages that I know of.
>
> save=:3 :0
> S=.conew>coname''
> ".@:('0 0$',],'__S=:',])&>nl 0
> S
> )
>
> Very handy in saving the current locale's global state. You can modify
> global names and come back to the current state just by cocurrent to
> the saved locale later. It almost like a time capsule. You can do a
> save inside a time capsule and create a nested time capsule.
>
> > On Apr 25, 2017, at 8:49 PM, bill lam <[email protected]> wrote:
> >
> > J program usually uses globals to share data. Encapsulation is a paradigm
> > commonly used by other programming languages, but as said in other posts, J
> > tends to focus on solving problems. Each programming language has its own
> > style, J needs not imitate paradigm of other programming languages.
> >
> > On 26 Apr, 2017 9:19 am, "Xiao-Yong Jin" <[email protected]> wrote:
> >
> >
> >> On Apr 25, 2017, at 6:30 PM, Eric Iverson <[email protected]>
> > wrote:
> >>
> >> I have not followed this discussion at all and am probably way off base.
> >>
> >> But how is:
> >>
> >> allocate a few structures, and pass their pointers to the same function in
> >> separate callings
> >>
> >> different from:
> >>
> >> allocated a few globals in an agreed upon locale (call it the heap), and
> >> pass their names (pointers) to the same verb in separate callings
> >>
> >> ?
> >
> > This question is actually right on spot, and I am struggling with this.
> > There are two aspects of this problem in my opinion.
> >
> > 1. Unnecessary copying of data, given the current state of the in-place
> > operations in J. To have a varied state in J, passing names to verb
> > essentially amounts to the following operations,
> >
> > State =. State Verb Control NB. akin to usual functional style
> >
> > Most of the time J would make unnecessary copies of the data in State.
> > I haven't found a reliable way to avoid extra copying, except for when
> > the 'Verb' here is a primitive.
> >
> > 2. Inconvenience, if you want to maintain a set of inhomogeneous states.
> > I can do
> >
> > 'State1A State1B State1C' = (State1A;State1B;State1C) Verb Control
> > 'State2A State2B State2C' = (State2A;State2B;State2C) Verb Control
> >
> > Apart from copying/boxing, there are too many names to keep track of.
> > I would rather do
> >
> > Verb_1_ Control
> > Verb_2_ Control
> >
> > I guess I'm just more familiar with the latter, because it resembles
> > a common C function:
> >
> > void Verb(*Locale, const *Control)
> >
> > Maybe I'm missing something in J. Please feel free to correct me.
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm