Thanks for the fast reply. I am far away of producing any package that is
useful for somebody else ;-)
I have to say that the steps that you propose do not work for me. Do I have
to be in any specific directory to make it work.
What I do: I am in some local folder (independent of the folder where
fricas is installed). I have the following source:
--- content of quad.spad ---
)abbrev domain MYFORM MyQuadraticForm
++ Description:
++ This domain provides modest support for quadratic forms.
MyQuadraticForm(n, K) : T == Impl where
n : PositiveInteger
K : Field
T ==> AbelianGroup with
myQuadraticForm : SquareMatrix(n, K) -> %
++ \spad{myQuadraticForm(m)} creates a quadratic
++ form from a symmetric,
++ square matrix \spad{m}.
matrix : % -> SquareMatrix(n, K)
++ \spad{matrix(qf)} creates a square matrix
++ from the quadratic form \spad{qf}.
elt : (%, DirectProduct(n, K)) -> K
++ \spad{qf(v)} evaluates the quadratic form
++ \spad{qf} on the vector \spad{v},
++ producing a scalar.
Impl ==> SquareMatrix(n, K) add
Rep := SquareMatrix(n, K)
myQuadraticForm m ==
not symmetric? m => error
"quadraticForm requires a symmetric matrix"
m::%
matrix q == q :: Rep
elt(q, v) == dot(v, (matrix q * v))
I do start fricas from the command line (Hyperdoc opens in an xwindow). I
do compile ")compile quad.spad". Then I search for myQuadraticForm or
MyQuadraticForm but I do not find anything (even after closing and
reopening of the window).
Fabian
On Wednesday, January 22, 2025 at 9:50:52 AM UTC+1 [email protected] wrote:
> Dear Fabian.
>
> Welcome to FriCAS!
>
> On 1/22/25 09:20, Fabian Hassler wrote:
> > I am stuck with the Ch. 12.3, explaining how to include the documentation
> > in the source code for the spad compiler. I am not sure but it feels that
> > there is a way to produce a page in HyperDoc starting from the formalized
> > way of including the comments. At least looking at the spad files in the
> > algebra folder it looks like that.
>
> It is easier than you think, if you just need it in HyperDoc:
> (1) start FriCAS (that by default also opens up an HyperDoc window.
> (2) say ")compile YourProjectFILE.spad" (without quotes).
> (3) goto the HyperDoc window and click on Browse
> (4) search for one of your domains/categories etc.
> (5) if you have any ++ docstrings in you code, you should see them.
>
> If you want to produce a webpage from your package like this
>
> https://hemmecke.github.io/qeta/
>
> then look at the Makefiles in this package connected to doc and html. It
> is basically the same as for the site http://fricas.github.io/ itself.
>
> > P.S. Regarding the FriCAS book: in Listing 11.1 it seems that "==>"
> > corresponds to a macro definition. Is it the same as "macro". If yes, it
> > would be useful to introduce the alternative notation in Ch. 6.2
>
> Yes,
>
> foo ==> bar
>
> is the same as
>
> macro foo == bar
>
> but is seems that the original authors of the book did not want to
> promote ==> in the book. I actually never realized that ==> is not
> explicitly introduced in the Book.
>
> Ralf
>
>
--
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/84832cb2-e0a6-44f1-8097-87fa677736d2n%40googlegroups.com.