Comments inline... On Thu, Aug 9, 2012 at 11:42 AM, Ian Clark <[email protected]> wrote: > @Henry Given the choice between the "package" or the "addon" (eg for > 'stats'), which is the one to use: the package or the addon? > > I'd plump for the "addon", because you can keep it up-to-date using > pacman. But of course you have to opt to install it using pacman, > whereas the "package" gets installed when J is first installed. Are > there maybe other things to consider here?
Agreed. Use Addons were available, especially because going forward (i.e. post J6) many packages won't be available because they have been moved to JAL (J Addon Library). The reason for this is that the scripts are much more easily maintained or augmented as part of an Addon than as part of the J System. > AFAICS there's no good reason not to install *all* the addons using > pacman, and keep them up to date the same way. They don't take up much > room, don't take long to download, and don't get in your way if you > don't use them. Also, downloading an addon will automatically install > any (updated) labs that come with it. Am I overlooking something? Sure if you like. Another benefit of this is that it should prevent any dependency problems (where one Addon depends on another one). I prefer to install the addons that I'm likely to use because some can be quite big. > Mind you, there's a gotcha lurking here. If you enter: > > open 'stats' > open 'stats/base/random' > > in the first case you get the "package", in the second you get the > "addon". You have to be alert and watch for the path that appears in > the window header. > > In j602, the verb: "open" uses a system noun: PUBLIC_j_ to decide > where to look for 'stats'. In J6 there are/were a number of aliases available for commonly used packages to simplify loading. For example in J6 the command ( load 'stats' ) will load the script ~system/packages/stats/stats.ijs (which in turn loads the other scripts in that folder) and makes the normalrand verb available in the session. The verb is actually defined in ~system/packages/stats/statdist.ijs. These aliases have in almost all cases been preserved in J7 but they point instead to the equivalent Addon so in the case of ( load 'stats') it loads the script ~addons/stats/base/base.ijs which loads the other scripts in that folder. > AFAIK, PUBLIC_j_ is created by the script: > ~system/extras/config/scripts.ijs . But I don't know whether pacman > updates this script, ever. From the date on the .ijs file, I suspect > it can. This script can be updated by the Package Manager, but only when the Package Manager upgrades your "base library" (i.e. the J system scripts). An addon could theoretically augment PUBLIC_j_ ( Public_j_ in J7 ) but not before it is loaded. If you wanted to create new aliases you could append them to PUBLIC_j_/Public_j_ in your startup script. Obviously these aliases will only be available to you, so it would not be a great idea to use these aliases in scripts you wanted others to be able to run. > Comments? (Like: what's different in j701?) The normalrand verb is available in J6 as part of the base install in the script '~system/packages/stats/statdist.ijs' The normalrand verb is also available as part of the stats/base Addon in both J6 and J7 in the script '~addons/stats/base/random.ijs' > On Wed, Aug 8, 2012 at 11:55 PM, Henry Rich <[email protected]> wrote: >> The verbs are defined in the 'stats' package. >> >> To see what they are, I do >> >> open 'stats' >> >> that is a 3-line verb. The last line looks promising, so I do >> >> open '~system\packages\stats\statdist.ijs' >> >> That brings up the header, which shows that >> >> normalrand >> >> is what you are looking for. You can scroll down to see the header of the >> verb. >> >> Then, >> >> load 'stats' >> >> to load the scripts, and >> >> normalrand 5 >> 0.351534 _1.1435 _0.097765 0.378719 0.543748 >> >> Henry Rich >> >> >> On 8/8/2012 6:37 PM, Owen Marschall wrote: >>> >>> Hi everyone, >>> >>> Quick question: >>> How do you generate normally distributed random numbers? I remember one of >>> the labs showed me how, but I've tried every possible combination of >>> abbreviations of "normal" and "random," yet nothing's working. I'm guessing >>> the lab must have loaded some package I forgot about. What package is this? >>> I've looked through the labs and can't find it. >>> >>> Also, does anyone know how to make the J dictionary work on a mac? My >>> computer opens it with gedit for some reason and won't compile it. >>> >>> Thanks, >>> Owen >>> ---------------------------------------------------------------------- >>> 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
