axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] )d op foo


From: daly
Subject: [Axiom-developer] )d op foo
Date: Sun, 22 May 2011 19:39:36 -0400

Axiom now displays examples of use as well as type information:

)d op pop!

There are 4 exposed functions called pop!:
  [1] ArrayStack D1 -> D1 from ArrayStack D1 if D1 has SETCAT
  [2] Dequeue D1 -> D1 from Dequeue D1 if D1 has SETCAT
  [3] D -> D1 from D if D has SKAGG D1 and D1 has TYPE
  [4] Stack D1 -> D1 from Stack D1 if D1 has SETCAT

Examples of pop! from ArrayStack

a:ArrayStack INT:= arrayStack [1,2,3,4,5]
pop! a
a

Examples of pop! from Dequeue

a:Dequeue INT: dequeue [1,2,3,4,5]
pop! a
a

Examples of pop! from StackAggregate

a:Stack INT:= stack [1,2,3,4,5]
pop! a
a

Examples of pop! from Stack

a:Stack INT:= stack [1,2,3,4,5]
pop! a
a

These are part of the ++ comments for the operations with a
special ++X prefix. For instance, in ArrayStack, the pop! operation
comments are:

  pop_! : % -> S
    ++
    ++X a:ArrayStack INT:= arrayStack [1,2,3,4,5]
    ++X pop! a
    ++X a

The )d op parsing routine looks for these special ++X examples
and includes them in the output.

This is a simple change to the display routine since the ++
comments are stored in the database. All the author has to
do is prefix example lines in the comment with ++X

I think this is a useful documentation feature. I would hope
that the other systems would pick up this change. We can all
benefit from the additional documentation.

Tim Daly





reply via email to

[Prev in Thread] Current Thread [Next in Thread]