Hmm... interesting. Personally, I try to use 1 + instead of >: except where >: saves typing (like saves me a parenthesis).
I can't think of any personally valid reasons for using sort over /:~ in that context, but it is defined and is a part of J, and I imagine that makes the code more accessible to a novice audience. Anyways, the code works, and is valid J (at least in current implementations), so that's something. Thanks, -- Raul On Sun, Oct 25, 2015 at 1:05 PM, June Kim (김창준) <[email protected]> wrote: > Hello, > > I found a mention of J in a book called Apprenticeship Patterns : > > https://books.google.co.kr/books?id=I3xFAoZT_5AC&lpg=PP1&dq=apprenticeship%20patterns&pg=PA21#v=onepage&q&f=false > > Unfortunately, the example code in J given in the text is, I consider, > unidomatic. > > sort 1 + (6?49) > > I'd rather have coded it as: > > /:~>:6?49 > > One more important thing is the other codes, as in Java and Io, have to > loop over until we get unique six random numbers, whereas J, as I believe, > does not have to -- I guess it internally uses a smarter algorithm to > Deal(for example, Fisher-Yates). Could anyone tell me the internal > algorithm it uses? > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
