https://code.jsoftware.com/wiki/Vocabulary/Locales#An_example_using_explicit_and_object_locatives
I made some further changes. First, to use cocreate for the name of each numbered locale, and Second I indented the code slightly, and replaced smoutput with echo, for (in my opinion) improved readability. (Using cocreate and discarding its result did not actually work.) Thanks, -- Raul On Thu, May 19, 2022 at 12:01 PM Devon McCormick <[email protected]> wrote: > > Which is here - https://code.jsoftware.com/wiki/Vocabulary/Locales - and I > made the change without checking the code. > > > On Thu, May 19, 2022 at 11:55 AM Devon McCormick <[email protected]> wrote: > > > You can get the required authorization by asking for it. > > If you do want someone else to do it, it would be nice to know where this > > example is. > > > > On Thu, May 19, 2022 at 10:21 AM Robert Cyr <[email protected]> wrote: > > > >> I do not have the required authorization to correct a wiki. All that is > >> required is an extra line creating a numbered locale, and the sample > >> script > >> would simply become: > >> > >> make=: verb define > >> NB. make doubly-linked queue of (y) numbered locales > >> for_i. i.y do. > >> > >> cocreate '' > >> > >> loc=. < ": i > >> name__loc=: 'This is locale ' , ": i > >> prev__loc=: < ": y| i-1 > >> next__loc=: < ": y| i+1 > >> end. > >> empty'' > >> ) > >> > >> Numbered locales are different from named locales in that they must be > >> explicitly created before using. This verb conew'' in the context of a > >> class script will create a numbered locale, and so will the verb > >> cocreate''. > >> > >> > >> > >> > >> > >> > >> Le ven. 6 mai 2022, à 22 h 43, Henry Rich <[email protected]> a écrit > >> : > >> > >> > I think you're right; please fix the Wiki. > >> > > >> > Henry Rich > >> > > >> > On 5/6/2022 8:34 PM, Robert Cyr wrote: > >> > > In > >> > > An example using explicit and object locatives > >> > > > >> > > The sampe script: > >> > > > >> > > make=: verb define > >> > > NB. make doubly-linked queue of (y) numbered locales > >> > > for_i. i.y do. > >> > > loc=. < ": i > >> > > name__loc=: 'This is locale ' , ": i > >> > > prev__loc=: < ": y| i-1 > >> > > next__loc=: < ": y| i+1 > >> > > end. > >> > > empty'' > >> > > ) > >> > > > >> > > generates a locale error. > >> > > > >> > > Numbered locales can only be used in the context of Class scripts and > >> > > are instances of the defined class. These numbered classes names are > >> > > created using > >> > > > >> > > conew 'ClassName'. > >> > > > >> > > The sample code should therefore be modified to use legal locale names > >> > like > >> > > > >> > > loc =. <'loc',":i > >> > > ---------------------------------------------------------------------- > >> > > For information about J forums see > >> http://www.jsoftware.com/forums.htm > >> > > >> > > >> > -- > >> > This email has been checked for viruses by AVG. > >> > https://www.avg.com > >> > > >> > ---------------------------------------------------------------------- > >> > For information about J forums see http://www.jsoftware.com/forums.htm > >> > > >> ---------------------------------------------------------------------- > >> For information about J forums see http://www.jsoftware.com/forums.htm > >> > > > > > > -- > > > > Devon McCormick, CFA > > > > Quantitative Consultant > > > > > > -- > > Devon McCormick, CFA > > Quantitative Consultant > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
