|  |  4.17.1 proc declaration 
 
Syntax:
[static]procproc_name [(<parameter_list>)[<help_string>]
 
 {<procedure_body>
 
 }[
 example
 {<sequence_of_commands>
 
 }]Purpose:
Defines a new function, the procproc_name. Once loaded in a
SINGULAR session, the information provided in the help string will be
displayed upon enteringhelp proc_name;, while theexamplesection will be executed  upon enteringexample proc_name;.
See  Parameter list,  Help string, and the example in
 Procedures in a library.The help string, the parameter list, and the example section are optional.
They are, however, mandatory for the procedures listed in the header of a library.
The help string is ignored and no example section is allowed if the procedure is defined
interactively, i.e., if it is not loaded from a file by the
 LIBorloadcommand (see  LIB and see  load ).In the body of a library, each procedure not meant to be accessible by
users should be declared static. See  Procedures in a library.
 
Example:
|  |   proc milnor_number (poly p)
  {
    ideal i= std(jacob(p));
    int m_nr=vdim(i);
    if (m_nr<0)
    {
      "// not an isolated singularity";
    }
    return(m_nr);         // the value of m_nr is returned
  }
  ring r1=0,(x,y,z),ds;
  poly p=x^2+y^2+z^5;
  milnor_number(p);
==> 4
 | 
 
See
 LIB;
 Libraries;
 apply.
 
 |