I noticed that all of the packages that come with Mathematica start with a header that is in a standard format. (See e.g. the header of NIntegrateUtilities`
at the end.)
There are several commented sections, each starting with a word surrounded by colons.
Question: What is the purpose of these colon-surrounded words? Do they have any meaning to Mathematica? They look like they were made for a machine to parse. Does Mathematica have any functions/tools that can read these?
(* :Name: NIntegrateUtilities` *)
(* :Title: Utility functions for NIntegrate. *)
(* :Author: Anton Antonov *)
(* :Summary:
This package provides a number of supporting functions for NIntegrate.
*)
(* :Context: DifferentialEquations`NIntegrateUtilities` *)
(* :Package Version: 1.0 *)
(* :Copyright: Copyright 2007, Wolfram Research, Inc. *)
(* :History:
Version 1.0 by Anton Atnonov, March 2007.
*)
(* :Keywords:
NIntegrate, integration, evaluations, profiling.
*)
(* :Source:
*)
(* :Mathematica Version: 6.0 *)
(* :Limitation:
*)
(* :Discussion:
*)
Answer
Old versions of Mathematica featured the package Utilities`Package`
. This had the function Annotation[]
that read those commented lines in packages so that one could see those annotations without having to explicitly open those packages in the front end.
Needs["Utilities`Package`"]
Annotation["Statistics`NonlinearFit`"]
{"Title", "Context", "Name", "Author", "Summary", "Copyright", "Package Version", "Mathematica Version", "History", "Keywords", "Sources", "Discussion", "Warning", "Example", "Example", "Example"}
Annotation["Statistics`NonlinearFit`", "Mathematica Version"]
{"(* :Mathematica Version: 5.0 *)"}
If you want to still use this function, it's available here. I would say those specific delimiters allowed the package to pick out annotations instead of code comments.
Comments
Post a Comment