Skip to content

ToString ​

expr printed as a string — of Epsil, this repo's own syntax, not Wolfram InputForm.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageToString!
ToString(expr)expr printed as Epsil source, via @enumeratio/engine's toInputForm
Typed signatures
TypePackageApplies
(any) -> stringcombinatoricsalways

Domain: Collections

Details
  • Prints Epsil, not Wolfram's InputForm: this repo has no Wolfram-syntax printer, and Epsil is InputForm's counterpart here — it round-trips through parseExpression the way InputForm round-trips through Wolfram's own parser.
  • expr is evaluated first, then printed — same as Wolfram's own ToString.

Examples

Basic #
live ↗
InToString([1,2,3])\mathrm{ToString}(\bigl\lbrack1, 2, 3\bigr\rbrack)Out[1, 2, 3]\text{[1, 2, 3]}
live ↗
InToString(x2)\mathrm{ToString}(x^2)Outx ^ 2\text{x \textasciicircum{} 2}
Scope #
live ↗
InToString(x+1)\mathrm{ToString}(x+1)Outx + 1\text{x + 1}
live ↗
InToString(ex)\mathrm{ToString}(e^{x})OutExponentialE ^ x\text{ExponentialE \textasciicircum{} x}
live ↗
InToString(cos⁡(x)+cos⁡(y))\mathrm{ToString}(\cos(x)+\cos(y))OutCos(x) + Cos(y)\text{Cos(x) + Cos(y)}
Properties #

A symbol converts to its name

live ↗
InToString(κ)\mathrm{ToString}(κ)Outkappa\text{kappa}
About
Examples6
Checked againstWolfram Language 1 agree5 differ
CrosswalkWolfram Language

See also: FromCharacterCode