4.13.1 proc declaration
-----------------------

Syntax:
[static] proc proc_name [parameter_list]

["help_text"]

{


\quad
   procedure_body

}

[example

{


\quad
   sequence_of_commands;

}]

proc proc_name = proc_name ;

proc proc_name = string_expression ;
Purpose:
defines a new function, the proc proc_name, with the additional
information help_text, which is copied to the screen by
help proc_name; and the example section
which is executed by example proc_name;.

 The help_text, the parameter_list, and the example section are optional.
The default for a parameter_list is (list #), see Parameter list.
The help and example sections are ignored if the procedure is defined
interactively, i.e., if it was not loaded from a file by a LIB command.

 Specifying static in front of the proc-definition is only possible
in a library file and makes this procedure local to the library,
i.e., accessible only for the other procedures in the same library,
but not for the users.

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;
Procedures.



<font size="-1">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; User manual for <a href="http://www.singular.uni-kl.de/"><i>Singular</i></a> version 2-0-4, October 2002,
generated by <a href="http://www.gnu.org/software/texinfo/"><i>texi2html</i></a>.
</font>

</body>
</html>
