Method code for $code_lib.valid_name()

[Turn off line numbering]
  1: arg name, type;
  2: 
  3: if (!(type in ['prop, 'normal, 'uniq]))
  4:     throw(~invarg, "Type must be one of: 'prop, 'normal or 'uniq");
  5: if ("\" in name)
  6:     throw(~invname, "Names cannot include backslashes.");
  7: if (name && name[1] in ["$", "#"])
  8:     throw(~invname, "Names cannot begin with \"$\" or \"#\".");
  9: if (type(name) != 'string)
 10:     throw(~type, "New name must be given as a string.");
 11: if (type != 'prop && name.match_regexp("^(a|an|the) +"))
 12:     throw(~bad_name, "Articles included in unique or normal name.");
 13: if (!(type in ['prop, 'normal, 'uniq]))
 14:     throw(~invarg, "Type must be one of: 'prop, 'normal or 'uniq");

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon