If you click the '+' next to the 'useloops' icon in the Projects window, you will see that the program INCLUDEs the file 'loops' (symbolized by a single up-arrow: ).
Click the line that says loops
. We would like to save the do-parts in another file; our implementation file.
While viewing 'loops' choose 'SLOTs->Create Implementation File...' and type loopsbody
. Now you have created a new file 'loopsbody' whose ORIGIN is 'loops' (symbolized by a double up-arrow: ). Conversely, 'loops' now has BODY 'loopsbody' (symbolized by a down arrow: ).
Go back to 'loops' by clicking loops
in the Projects window.
Mark the do-part of upTo
(press and hold the mouse button from the middle of 'do' to somewhere in the do-part).
Choose 'SLOTs->Make DoPart SLOT', and name it upToImplementation
. Now the implementation of upTo
is automatically moved down into 'loopsbody'.
Double-click <<SLOT upToImplementation: DoPart>>
in 'loops'. This takes you directly to the code in 'loopsbody' (or click the Definiton button in the toolbar or press Alt+Right).
The Mjolner tool keeps track of your current implementation file at all times. This is the file into which the implementaion is moved when you choose 'SLOTs->Make DoPart SLOT'. When you use 'SLOTs->Create Implementation File...' to create a new file, that file becomes the current implementation file. If you wish to change it, use the SLOTs menu.
Move the do-parts of downTo
and stepTo
down into 'loopsbody' as well. This can be done in one step by selecting both downTo
and stepTo
and choosing 'SLOTs->Hide Implementation'.
<<SLOT blahblah: DoPart>>
. The corresponding fragment form contains a line such as ---blahblah: DoPart---
.
Using the Mjolner tool you can easily jump from a SLOT to the corresponding fragment form or vice versa.
While viewing 'loops', double-click the stepTo
SLOT. This causes the implementation of stepTo
to be displayed. In the Fragment Forms window you can see that it contains three do-parts and that currently 'stepToImplementation' is displayed.
Jump to the implementation of downTo
by clicking on the corresponding line in the Fragment Forms window.
To find the SLOT mathing the 'downTo' fragment form, click the 'ToSlot' button in the toolbar or right click in the Form window and select 'Follow->Link To SLOT'.
Now the tool searches through the chain of ORIGINs (adhering to the rules for doing so) looking for a matching SLOT. It ends up finding such a SLOT in 'loops'.
Three patterns are defined in 'loops': upTo
, downTo
and stepTo
. To be precise, they are defined in a lib:attributes
fragment form. as can be seen in the Fragment Forms window. But which slot will this fragment form be inserted into, i.e. where is the SLOT corresponding to lib:attributes
? Find out the same way as above. Of course, the matching SLOT is located in 'betaenv'.
Mjolner Tool Workshop | © 2001-2004 Mjølner Informatics |
[Modified: Thursday September 13th 2001 at 18:47]
|