, , | }
"""
@@ -417,6 +421,7 @@ class TitleImport(_TagImport):
'HTML`TitleImport["filename"]'
imports the title string from a HTML file.
+
>> Import["ExampleData/PrimeMeridian.html", "Title"]
= Prime meridian - Wikipedia
"""
@@ -438,6 +443,7 @@ class XMLObjectImport(_HTMLBuiltin):
'HTML`XMLObjectImport["filename"]'
imports XML objects from a HTML file.
+
>> Part[Import["ExampleData/PrimeMeridian.html", "XMLObject"], 2, 3, 1, 3, 2]
= XMLElement[title, {}, {Prime meridian - Wikipedia}]
"""
diff --git a/mathics/builtin/fileformats/xmlformat.py b/mathics/builtin/fileformats/xmlformat.py
index caa9fdf51..a93dfb39c 100644
--- a/mathics/builtin/fileformats/xmlformat.py
+++ b/mathics/builtin/fileformats/xmlformat.py
@@ -294,6 +294,7 @@ class XMLGetString(_Get):
'XML`Parser`XMLGetString["string"]'
parses "string" as XML code, and returns an XMLObject.
+
>> Head[XML`Parser`XMLGetString[""]]
= XMLObject[Document]
diff --git a/mathics/builtin/files_io/files.py b/mathics/builtin/files_io/files.py
index 9263b6124..cb930cf8f 100644
--- a/mathics/builtin/files_io/files.py
+++ b/mathics/builtin/files_io/files.py
@@ -721,6 +721,7 @@ class Read(Builtin):
reads the input stream for an Expression and puts it inside 'Hold'.
+
$type$ is one of:
- Byte
diff --git a/mathics/builtin/functional/composition.py b/mathics/builtin/functional/composition.py
index 2c5853282..9d9c969f9 100644
--- a/mathics/builtin/functional/composition.py
+++ b/mathics/builtin/functional/composition.py
@@ -79,6 +79,7 @@ class Identity(Builtin):
- 'Identity[$x$]'
- is the identity function, which returns $x$ unchanged.
+
X> Identity[x]
= x
X> Identity[x, y]
diff --git a/mathics/builtin/graphics.py b/mathics/builtin/graphics.py
index 2af729e66..45cf787ea 100644
--- a/mathics/builtin/graphics.py
+++ b/mathics/builtin/graphics.py
@@ -1339,6 +1339,7 @@ class EdgeForm(Builtin):
- 'EdgeForm[$g$]'
- is a graphics directive that specifies that edges of filled graphics objects are to be drawn using the graphics directive or list of directives $g$.
+
>> Graphics[{EdgeForm[{Thick, Green}], Disk[]}]
= -Graphics-
diff --git a/mathics/builtin/kernel_sessions.py b/mathics/builtin/kernel_sessions.py
index 4e1cbaf50..215f76514 100644
--- a/mathics/builtin/kernel_sessions.py
+++ b/mathics/builtin/kernel_sessions.py
@@ -98,5 +98,6 @@ class Exit(Quit):
- 'Exit[$n$]'
- Terminates the mathics session with exit code $n$.
+
'Exit' is the same thing as 'Quit'.
"""
diff --git a/mathics/builtin/list/associations.py b/mathics/builtin/list/associations.py
index ed0a7b6b7..f28930bc2 100644
--- a/mathics/builtin/list/associations.py
+++ b/mathics/builtin/list/associations.py
@@ -272,6 +272,7 @@ class Missing(Builtin):
- 'Missing[]'
- represents a data that is missing.
+
>> ElementData["Meitnerium","MeltingPoint"]
= Missing[NotAvailable]
"""
diff --git a/mathics/builtin/mainloop.py b/mathics/builtin/mainloop.py
index e56194e3e..49548b498 100644
--- a/mathics/builtin/mainloop.py
+++ b/mathics/builtin/mainloop.py
@@ -37,6 +37,7 @@ class HistoryLength(Builtin):
- '$HistoryLength'
- specifies the maximum number of 'In' and 'Out' entries.
+
>> $HistoryLength
= 100
>> $HistoryLength = 1;
@@ -68,6 +69,7 @@ class In(Builtin):
- 'In[$k$]'
- gives the $k$th line of input.
+
>> x = 1
= 1
>> x = x + 1
@@ -207,6 +209,7 @@ class Line(Builtin):
- '$Line'
- holds the current input line number.
+
>> $Line
= 1
>> $Line
diff --git a/mathics/builtin/numbers/algebra.py b/mathics/builtin/numbers/algebra.py
index c62df6312..f97e991d5 100644
--- a/mathics/builtin/numbers/algebra.py
+++ b/mathics/builtin/numbers/algebra.py
@@ -1671,6 +1671,7 @@ class FullSimplify(Simplify):
- 'FullSimplify[$expr$, $assump$]'
- simplifies $expr$ assuming $assump$ instead of $Assumptions$.
+
TODO: implement the extension. By now, this does the same than Simplify...
>> FullSimplify[2*Sin[x]^2 + 2*Cos[x]^2]
diff --git a/mathics/builtin/numbers/constants.py b/mathics/builtin/numbers/constants.py
index 4eb1e6a6b..9fef149a7 100644
--- a/mathics/builtin/numbers/constants.py
+++ b/mathics/builtin/numbers/constants.py
@@ -298,6 +298,7 @@ class Degree(_MPMathConstant, _NumpyConstant, _SympyConstant):
- 'Degree'
- is the number of radians in one degree. It has a numerical value of \u03c0 / 180.
+
>> Cos[60 Degree]
= 1 / 2
diff --git a/mathics/builtin/numbers/randomnumbers.py b/mathics/builtin/numbers/randomnumbers.py
index 77910941e..c7cbd8903 100644
--- a/mathics/builtin/numbers/randomnumbers.py
+++ b/mathics/builtin/numbers/randomnumbers.py
@@ -229,6 +229,7 @@ class Random(Builtin):
$type$, in the specified interval $range$. Possible types are \
'Integer', 'Real' or 'Complex'.
+
Legacy function. Superseded by RandomReal, RandomInteger and RandomComplex.
"""
diff --git a/mathics/builtin/numeric.py b/mathics/builtin/numeric.py
index 613a1a03a..80f5a08c0 100644
--- a/mathics/builtin/numeric.py
+++ b/mathics/builtin/numeric.py
@@ -175,6 +175,7 @@ class N(Builtin):
- 'N[$expr$, $prec$]'
- evaluates $expr$ numerically with a precision of $prec$ digits.
+
>> N[Pi, 50]
= 3.1415926535897932384626433832795028841971693993751
@@ -553,6 +554,7 @@ class RealAbs(Builtin):
- 'RealAbs[$x$]'
- returns the absolute value of a real number $x$.
+
'RealAbs' is also known as modulus. It is evaluated if $x$ can be compared \
with $0$.
@@ -595,6 +597,7 @@ class RealSign(Builtin):
- returns -1, 0 or 1 depending on whether $x$ is negative,
zero or positive.
+
'RealSign' is also known as $sgn$ or $signum$ function.
>> RealSign[-3.]
diff --git a/mathics/builtin/patterns.py b/mathics/builtin/patterns.py
index 46a8c433f..3b7eed271 100644
--- a/mathics/builtin/patterns.py
+++ b/mathics/builtin/patterns.py
@@ -1490,6 +1490,7 @@ class Longest(Builtin):
- is a pattern object that matches the longest sequence consistent \
with the pattern $p$.
+
>> StringCases["aabaaab", Longest["a" ~~ __ ~~ "b"]]
= {aabaaab}
@@ -1716,6 +1717,7 @@ class DispatchAtom(AtomBuiltin):
In the future, it should return an optimized DispatchRules atom, \
containing an optimized set of rules.
+
>> rules = {{a_,b_}->a^b, {1,2}->3., F[x_]->x^2};
>> F[2] /. rules
= 4
diff --git a/mathics/builtin/procedural.py b/mathics/builtin/procedural.py
index 3ebb5f8d8..250183359 100644
--- a/mathics/builtin/procedural.py
+++ b/mathics/builtin/procedural.py
@@ -49,6 +49,7 @@ class Abort(Builtin):
- 'Abort[]'
- aborts an evaluation completely and returns '$Aborted'.
+
>> Print["a"]; Abort[]; Print["b"]
| a
= $Aborted
@@ -70,6 +71,7 @@ class Break(Builtin):
- 'Break[]'
- exits a 'For', 'While', or 'Do' loop.
+
>> n = 0;
>> While[True, If[n>10, Break[]]; n=n+1]
>> n
@@ -245,6 +247,7 @@ class Do(IterationFunction):
- evaluates $expr$ for each $j$ from $jmin$ to $jmax$, for each $i$ from $imin$
to $imax$, etc.
+
>> Do[Print[i], {i, 2, 4}]
| 2
| 3
@@ -392,6 +395,7 @@ class Interrupt(Builtin):
- 'Interrupt[]'
- Interrupt an evaluation and returns '$Aborted'.
+
>> Print["a"]; Interrupt[]; Print["b"]
| a
= $Aborted
diff --git a/mathics/builtin/specialfns/gamma.py b/mathics/builtin/specialfns/gamma.py
index 7369e0ba6..625f25443 100644
--- a/mathics/builtin/specialfns/gamma.py
+++ b/mathics/builtin/specialfns/gamma.py
@@ -42,6 +42,7 @@ class Beta(MPMathMultiFunction):
- 'Beta[$z$, $a$, $b$]'
- gives the incomplete Beta function.
+
The Beta function satisfies the property
Beta[x, y] = Integrate[t^(x-1)(1-t)^(y-1),{t,0,1}] = Gamma[a] Gamma[b] / Gamma[a + b]
>> Beta[2, 3]
@@ -174,6 +175,7 @@ class Factorial2(PostfixOperator, MPMathFunction):
- '$n$!!'
- computes the double factorial of $n$.
+
The double factorial or semifactorial of a number $n$, is the product of all the \
integers from 1 up to n that have the same parity (odd or even) as $n$.
diff --git a/mathics/builtin/system.py b/mathics/builtin/system.py
index 30f4ab8fe..9948253f9 100644
--- a/mathics/builtin/system.py
+++ b/mathics/builtin/system.py
@@ -132,6 +132,7 @@ class CommandLine(Predefined):
- '$CommandLine'
- is a list of strings passed on the command line to launch the Mathics3 session.
+
>> $CommandLine
= {...}
"""
@@ -154,6 +155,7 @@ class Environment(Builtin):
- 'Environment[$var$]'
- gives the value of an operating system environment variable.
+
X> Environment["HOME"]
= ...
"""
@@ -215,6 +217,7 @@ class Machine(Predefined):
- returns a string describing the type of computer system on which the \
Mathics3 is being run.
+
X> $Machine
= linux
"""
@@ -235,6 +238,7 @@ class MachineName(Predefined):
- is a string that gives the assigned name of the computer on which Mathics3 \
is being run, if such a name is defined.
+
X> $MachineName
= buster
"""
@@ -360,6 +364,7 @@ class PythonImplementation(Predefined):
- '$PythonImplementation'
- gives a string indication the Python implementation used to run Mathics3.
+
>> $PythonImplementation
= ...
"""
@@ -381,6 +386,7 @@ class ScriptCommandLine(Predefined):
- '$ScriptCommandLine'
- is a list of string arguments when running the kernel is script mode.
+
>> $ScriptCommandLine
= {...}
"""
@@ -408,6 +414,7 @@ class Run(Builtin):
- runs command as an external operating system command, returning the exit \
code returned from running the system command.
+
X> Run["date"]
= ...
"""
@@ -428,6 +435,7 @@ class SystemID(Predefined):
- '$SystemID'
- is a short string that identifies the type of computer system on which the \Mathics is being run.
+
X> $SystemID
= linux
"""
@@ -447,6 +455,7 @@ class SystemWordLength(Predefined):
- gives the effective number of bits in raw machine words on the computer \
system where Mathics3 is running.
+
X> $SystemWordLength
= 64
"""
diff --git a/mathics/builtin/testing_expressions/logic.py b/mathics/builtin/testing_expressions/logic.py
index 9ffc80118..534c19bde 100644
--- a/mathics/builtin/testing_expressions/logic.py
+++ b/mathics/builtin/testing_expressions/logic.py
@@ -394,6 +394,7 @@ class Nand(Builtin):
- $expr1$ \u22BC $expr2$ \u22BC ...
- Implements the logical NAND function. The same as 'Not[And['$expr1$, $expr2$, ...']]'
+
>> Nand[True, False]
= True
"""
@@ -415,6 +416,7 @@ class Nor(Builtin):
- $expr1$ \u22BD $expr2$ \u22BD ...
- Implements the logical NOR function. The same as 'Not[Or['$expr1$, $expr2$, ...']]'
+
>> Nor[True, False]
= False
"""
diff --git a/mathics/builtin/testing_expressions/numerical_properties.py b/mathics/builtin/testing_expressions/numerical_properties.py
index 02205eaa3..cb8834487 100644
--- a/mathics/builtin/testing_expressions/numerical_properties.py
+++ b/mathics/builtin/testing_expressions/numerical_properties.py
@@ -245,6 +245,7 @@ class Negative(Builtin):
- 'Negative[$x$]'
- returns 'True' if $x$ is a negative real number.
+
>> Negative[0]
= False
>> Negative[-3]
|