On Sat, May 21, 2022 at 9:55 AM Robert Cyr <robert....@gmail.com> wrote:
> I would add that special code is accepted as well:
>   locs =: cocreate &'' i.8
> The first line will work for any verb, the second is specific to cocreate
> and, as far as I can tell, not documented.

It could be better documented, but this actually is documented.

The above expression is equivalent to:
   locs=: (i.8) cocreate ''

And, cocreate has a left rank of zero:

   cocreate b.0
_ 0 _

And, we even have documentation on what the (optional) x argument to
cocreate is, if you know where to look for it:

   cocreate
18!:3

https://www.jsoftware.com/help/dictionary/dx018.htm#3

"x specifies the size of the hash table for the locale, requiring
w*2^6+x bytes where w is the number of bytes in a word. If x is
elided, then the defaults specified in 9!:38 and 9!:39 are used. A
larger hash table size improves performance; regardless of the hash
table size, a locale may contain an effectively unlimited number of
names."

There's even a little guidance on the performance curve at the
documentation for 9!:38 --
https://www.jsoftware.com/help/dictionary/dx009.htm#38 -- but that's
long enough that I won't bother to quote it here. That said,
constructing benchmarks to measure locale namespace performance would
be .. interesting. Mostly, I imagine that we don't use a lot of names,
but sometimes we do. And, locale size might also have performance
implications in contexts where we have a lot of locales.

Anyways... I did not know (or forgot) about this mechanism and did not
think to look it up until you mentioned it.

Thanks,

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

Reply via email to