Within algebra documentation for a function there are ++ and -- comments
The ++ comments are intended as documentation.
I have extended the meaning of ++ comments by appending a single letter.
For example in the 'map' function from 'StreamFunction3' you'll see
map : ((A,B) -> C,ST A,ST B) -> ST C
++ map(f,st1,st2) returns the stream whose elements are the
++ function f applied to the corresponding elements of st1 and st2.
++ \spad{map(f,[x0,x1,x2,..],[y0,y1,y2,..]) = [f(x0,y0),f(x1,y1),..]}.
++
++S
++X m:=[i for i in 1..]::Stream(Integer)
++X n:=[i for i in 1..]::Stream(Integer)
++X f(i:Integer,j:Integer):Integer == i+j
++X map(f,m,n)
The ++X comments are part of the output shown during display functions, e.g.
)d op map
will show the ++X comments as "examples" of how to use the function.
There is also the 'ApplicationProgramInterface' which allows user-level
access
to various data structures:
)abbrev package API ApplicationProgramInterface
++ Author: Timothy Daly, Martin Rubey
++ Date Created: 3 March 2009
++ Date Last Updated: 24 March 2012
++ Description:
++ This package contains useful functions that expose Axiom system internals
ApplicationProgramInterface() : SIG == CODE where
SIG ==> with
getDomains : Symbol -> Set Symbol
++ getDomains(s) takes a category and returns the list of domains
++ that have that category
++
++X getDomains 'IndexedAggregate
getAncestors : Symbol -> Set Symbol
++ getAncestors(s) takes a category and returns the list of domains
++ that have that category as ancestors
++
++X getAncestors 'IndexedAggregate
credits : () -> Void
++ credits() prints a list of people who contributed to Axiom
++
++X credits()
summary : () -> Void
++ summary() prints a short list of useful console commands
++
++X summary()
reportInstantiations : Boolean -> Void
++ reportInstantiations(bool) is a debugging tool to show
++ instantiation information
++
++X reportInstantiations(true)
++X 1
++X reportInstantiations(false)
CODE ==> add
getDomains(cat:Symbol):Set(Symbol) ==
set [symbol car first destruct a _
for a in (destruct domainsOf(cat,NIL$Lisp)$Lisp)::List(SExpression)]
getAncestors(cat:Symbol):Set(Symbol) ==
set [symbol car first destruct a _
for a in (destruct
ancestorsOf(cat,NIL$Lisp)$Lisp)::List(SExpression)]
credits() == ( credits()$Lisp ; void() )
summary() == ( summary()$Lisp ; void() )
reportInstantiations(b:Boolean): Void ==
REPORTINSTANTIATIONS(b)$Lisp
void
On Thu, Jun 12, 2025 at 5:06 AM Grégory Vanuxem <[email protected]> wrote:
> Hello,
>
>
> Le mer. 11 juin 2025 à 20:59, 'Ralf Hemmecke' via FriCAS - computer
> algebra system <[email protected]> a écrit :
> >
> > Hi Waldek,
> >
> > as you know, I would like to let HyperDoc die.
> > But, maybe that sound too extreme for what I actually mean.
> > And I agree to some extend to your plan for a new hyperdoc.
> >
> > Let me explain my wishes.
> >
> > FriCAS should have an interface (in LISP or SPAD) that let's
> > SPAD or external programs get information about
> > categories/domains/packages/documentation.
> > From such an interface it should be easy to generate any output format
> > be it html, rst or pdf.
>
> +1
>
> For what I am interested in right now, is displaying '++'
> documentation in text form, and. readable directly in the interpreter
> console.
> From what I have read in api.spad and api2.spad the implementations
> are tightly related the reST and HTML formats and I would like
> plain/text format also. I do not want to use a Regex style replacement
> method as it requires Julia or cl-ppcre and/or, for my concern,
> cl-ppcre-unicode. Looking at api2 for example there is code to return
> TexTree as a SEX expression. There is a TeXTree to HTML converter
> which outputs the conversion in a file, no routine from what I have
> seen that converts it to a String. I will eventually code something in
> this regard. Maybe Waldek, you have already done this privately?
> Having a generic parser would be a very good idea, I think. Gathering
> the two parser implementations.
>
>
> jlDocumentation(op) ==
> ops := getDatabase("o")$OperationsQuery
> docs := elt(ops,equation('name, op)$QueryEquation)
> elts : DataList(String) := elt(docs,'doc)
> for i in 1 .. #elts repeat
> output((elts.i)::OutputForm)$OutputPackage
> -- PPRINT(jlEvalString(concat(["replace(raw_"",
>
> "\spad{svd(m)} computes the singular value decomposition \spad{SVD} of
> \spad{
> m} such that \spad{SVD}.\spad{U} * diagonalMatrix(\spad{sv}) *
> \spad{SVD}.\sp
> ad{Vt} = \spad{m}."
> "\spad{svd(m)} computes the singular value decomposition \spad{SVD} of
> \spad{
> m} such that \spad{SVD}.\spad{U} * diagonalMatrix(\spad{sv}) *
> \spad{SVD}.\sp
> ad{Vt} = \spad{m}."
> "\spad{svd(m)} computes the singular value decomposition \spad{SVD} of
> \spad{
> m} such that \spad{SVD}.\spad{U} * diagonalMatrix(\spad{sv}) *
> \spad{SVD}.\sp
> ad{Vt} = \spad{m}."
> "\spad{svd(m)} computes the singular value decomposition \spad{SVD} of
> \spad{
> m} such that \spad{SVD}.\spad{U} * diagonalMatrix(\spad{sv}) *
> \spad{SVD}.\sp
> ad{Vt} = \spad{m}."
> "\spad{svd(m)} computes the singular value decomposition of the matrix
> \spad{
> m}."
> Type:
> Void
>
> And regexing/replacing, completely irrelevant for me, some Tex-like
> construct I would like to obtain something like:
> (25) -> jlDocumentation "svd"
>
> "svd(m) computes the singular value decomposition SVD of m such that
> SVD.U * diagonalMatrix(sv) * SVD.Vt = m."
> "svd(m) computes the singular value decomposition SVD of m such that
> SVD.U * diagonalMatrix(sv) * SVD.Vt = m."
> "svd(m) computes the singular value decomposition SVD of m such that
> SVD.U * diagonalMatrix(sv) * SVD.Vt = m."
> "svd(m) computes the singular value decomposition SVD of m such that
> SVD.U * diagonalMatrix(sv) * SVD.Vt = m."
> "svd(m) computes the singular value decomposition of the matrix m."
> Type:
> Void
>
> or:
>
> (26) -> jlDocumentation "string"
>
> "string(f) gives string corresponding to f. Valid only when string?(f) is
> true"
> "string(i) returns the decimal representation of i as a string."
> "string(s) returns s as an element of Str. Error: if s is not an atom
> that also belongs to Str."
> "string(jt) returns the string representation of jt."
> "string(x) stringifies x."
> "string(s) converts the symbol s to a string. Error: if the symbol is
> subscripted."
>
> (27) -> jlDocumentation "str"
> Type:
> Void
>
> But with more information (conditional exports, origins etc.) and
> more options. Probably as a system command?
> )display doc string as an example.
>
> Just my two cents.
>
> - Greg
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/fricas-devel/mb_O0196RMQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/fricas-devel/CAHnU2dY5SH52A0U56a8kSqSBO%2BFX0Lzsq%3Dw6hzBCfcuBd20m8Q%40mail.gmail.com
> .
>
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/CAJn5L%3D%2B1KwNu4xgtGEFRcRXmGWWoEMYgg2TZ0Y_owk2T81N0oQ%40mail.gmail.com.