DefaultRegistry.mesa
Created Thursday, June 14, 1984 4:06 pm PDT
Eric Nickell, June 15, 1984 3:49:06 pm PDT
DIRECTORY
Rope USING [ROPE];
DefaultRegistry: CEDAR DEFINITIONS ~ {
ROPE: TYPE ~ Rope.ROPE;
MakeRegistryExplicit: PROC [in: ROPE, packages: LIST OF ATOMLIST [$Default], defaultDefault: ROPE ← UsersRegistry[]] RETURNS [out: ROPE];
Does the obvious. If 'in' has a period in it, then it just returns that. Otherwise, it will look in the user profile for entries of the form 'x.DefaultRegistry: registry', where the x's come from the list of ropes (packages), and registry is the registry that will be appended. If there is no appropriate user profile entry, the defaultDefault is used.
Philosophy: Most clients should default the packages argument. Thus, if a user of the client does not specify a full user name, the default will come from 'Default.DefaultRegistry' in the user profile. If the implementor of a client package thinks that users are likely to want a different default for their package (a Gripe package, let's say), then that implementor would be wise to have a call of the form
MakeRegistryExplicit[in: userName, packages: [$Gripe, $Default]].
Here, the default registry will come from 'Gripe.DefaultRegistry' if it exists, else from 'Default.DefaultRegistry'
GetDefaultRegistry: PROC [packages: LIST OF ATOMLIST [$Default], defaultDefault: ROPE ← UsersRegistry[]] RETURNS [registry: ROPE];
Tells you what the default registry would be for the packages listed.
UsersRegistry: PROC RETURNS [registry: ROPE];
Returns the registry of the current CEDAR user.
}.