Differences between revisions 1 and 35 (spanning 34 versions)
Revision 1 as of 2009-10-20 19:38:59
Size: 1781
Editor: KaiJaeger
Comment:
Revision 35 as of 2017-02-24 20:38:28
Size: 3791
Editor: KaiJaeger
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= User Command ADOC (Dyalog) = ## page was renamed from UserCommands/Latest2
<<TableOfContents>>

= User Command "Latest2" =
Line 5: Line 8:
[[ADOC]] is a utility useful to generate documentation (semi-) automatically from class scripts as well as namespace scripts. This User Command prints the fully qualified names of functions and operators together with time stamps and the user names to the session, sorted by time stamp (oldest first).
Line 7: Line 10:
Obviously it makes sense to make ADOCs services available as a User Command. Note that fns/opr in scripted namespaces are '''execluded'''. In the context of a command `Latest` they don't offer real value since they all get the same time stamp from when the script gets fixed. This is more often misleading than useful.
Line 9: Line 12:
This page offers a small class script `ADOC` which is designed to do exactly that. The User Command also ignores Class Instances but investigates the contents of any GUI namespaces if `KeepOnClose` is 1.
Line 11: Line 14:
== Assumptions == The following is a sample session taken in the workspace "CPro" (Causeway) a Dyalog installation is coming with at the time of writing (2012-03).
Line 13: Line 16:
When User Commands got introduced in Dyalog with version 12.1, the User Commands where expected to reside in a sub folder `Salt\Spice` inside the Dyalog installation folder. An empty vector means ALL fns/opr:
{{{
      ]q←Latest2 ⍬
      ⍴q
1832 3
}}}
Line 15: Line 23:
The ADOC User Command assumes that there is a sibling folder of `SALT` named `UserCommands`. Please make sure that the [[ADOC]] script is copied into this folder `UserCommands`. This enables the User Command script to address the real ADOC script as `..\UserCommands\ADOC`. A positive integer n is treated as "report n fns/opr changed most recently", therefore you get 6 or less objects printed to the session:
{{{
      ]Latest2 6
 #.Class.Initialise 2008.02.22 18:40:42 Adrian
 #.Class.Qualify 2008.02.22 18:52:15 Adrian
 #.Class.PM.Refresh 2008.02.22 19:01:15 Adrian
 #.Class.IL.Refresh 2008.02.22 19:27:25 Adrian
 #.Class.IC.Refresh 2008.02.22 19:42:32 Adrian
 #.CPro.Fns.Exec0 2008.02.22 19:43:40 Adrian
}}}
Line 17: Line 34:
The script '''ADOC''' attached to this page needs to go into `SALT\SPICE` A negative integer n is treated as "report all fns/opr changed during the nth recent days":
{{{
      ]Latest2 ¯2
 #.CPro.Class.EventNumber 2008.01.24 14:46:02 Adrian
 #.Class.MakeBitmap 2008.02.22 18:37:41 Adrian
 #.Class.Initialise 2008.02.22 18:40:42 Adrian
 #.Class.Qualify 2008.02.22 18:52:15 Adrian
 #.Class.PM.Refresh 2008.02.22 19:01:15 Adrian
 #.Class.IL.Refresh 2008.02.22 19:27:25 Adrian
 #.Class.IC.Refresh 2008.02.22 19:42:32 Adrian
 #.CPro.Fns.Exec0 2008.02.22 19:43:40 Adrian
}}}
Line 19: Line 47:
== Samples == Note that you cannot specify the negative value as `-4` rather than `¯4` because Dyalog considers it to be a switch then and refuses to accept that.
Line 21: Line 49:
Given that the two different ADOC scripts went into the right folders, this would be a sample session: For that reason there is also a `-d` switch which means that the integer shall be treated as a day. That way the value can be positive.

By default `Latest` investigates `#`. With the optional switch `-s` one can change that. The following statement returns 6 fns/opr from the namespace `#.Class.IC`:
Line 24: Line 54:
      ]?ADOC
"??" for general help, "?CMD" for more specific info on command CMD

 Group Name Description
 ===== ==== ===========
 ADOC ADOC.Browse Creates full documentation and displayes it in the default browser
        ADOC.List Prints syntax of all public stuff to the session

      ]?ADOC.Browse
Command "ADOC.Browse". Syntax: 1 arguments; accepts switches -b=
Script location: ........\SALT\Spice\ADOC
Gathers all sort of information from a class script

      ]?ADOC.List
Command "ADOC.List".
Script location: ........\SALT\Spice\ADOC
Prints a list with all sorts of information to the session

]ADOC.Browse ADOC -b=Opera
Watch your browser
      ]Latest2 ¯5 -s=#.Class.IC
 #.Class.IC.Caption 1997.07.31 18:13:06 Adrian
 #.Class.IC.Design 1997.07.31 23:38:26 Adrian
 #.Class.IC.Create 1997.08.01 11:50:52 Adrian
 #.Class.IC.onConfigure 1997.08.01 11:54:51 Adrian
 #.Class.IC.Read 1997.09.01 15:36:54 Adrian
 #.Class.IC.Fns 2008.01.23 12:51:28 Adrian
 #.Class.IC.Refresh 2008.02.22 19:42:32 Adrian
Line 46: Line 64:
Occasionally it might be useful to include fns/opr from scripted namespaces as well. This can be achieved with the `-a` switch (for "all").

Let's create a scripted namespace in order to get something to bite into:

{{{
      ⎕fix ':Namespace Foo' '∇r←Hello' 'r←''World''' '∇' ':EndNamespace'
      ]Latest2 3
 #.Class.IL.Refresh 2008.02.22 19:27:25 Adrian
 #.Class.IC.Refresh 2008.02.22 19:42:32 Adrian
 #.CPro.Fns.Exec0 2008.02.22 19:43:40 Adrian
      ]Latest2 3 -a
 #.Class.IC.Refresh 2008.02.22 19:42:32 Adrian
 #.CPro.Fns.Exec0 2008.02.22 19:43:40 Adrian
 #.Foo.Hello 2012.03.05 16:20:35 Kai

}}}


== Download ==

[[attachment:Latest2.zip | Download]] the script and the workspace.

== Version ==
The script is version 1.1.9 from 2017-02-24
Line 47: Line 90:

-- KaiJaeger <<DateTime(2012-03-05T14:37:53Z)>>

User Command "Latest2"

Overview

This User Command prints the fully qualified names of functions and operators together with time stamps and the user names to the session, sorted by time stamp (oldest first).

Note that fns/opr in scripted namespaces are execluded. In the context of a command Latest they don't offer real value since they all get the same time stamp from when the script gets fixed. This is more often misleading than useful.

The User Command also ignores Class Instances but investigates the contents of any GUI namespaces if KeepOnClose is 1.

The following is a sample session taken in the workspace "CPro" (Causeway) a Dyalog installation is coming with at the time of writing (2012-03).

An empty vector means ALL fns/opr:

      ]q←Latest2 ⍬                 
      ⍴q
1832 3

A positive integer n is treated as "report n fns/opr changed most recently", therefore you get 6 or less objects printed to the session:

      ]Latest2 6
 #.Class.Initialise  2008.02.22 18:40:42  Adrian 
 #.Class.Qualify     2008.02.22 18:52:15  Adrian 
 #.Class.PM.Refresh  2008.02.22 19:01:15  Adrian 
 #.Class.IL.Refresh  2008.02.22 19:27:25  Adrian 
 #.Class.IC.Refresh  2008.02.22 19:42:32  Adrian 
 #.CPro.Fns.Exec0    2008.02.22 19:43:40  Adrian 

A negative integer n is treated as "report all fns/opr changed during the nth recent days":

      ]Latest2 ¯2
 #.CPro.Class.EventNumber  2008.01.24 14:46:02  Adrian 
 #.Class.MakeBitmap        2008.02.22 18:37:41  Adrian 
 #.Class.Initialise        2008.02.22 18:40:42  Adrian 
 #.Class.Qualify           2008.02.22 18:52:15  Adrian 
 #.Class.PM.Refresh        2008.02.22 19:01:15  Adrian 
 #.Class.IL.Refresh        2008.02.22 19:27:25  Adrian 
 #.Class.IC.Refresh        2008.02.22 19:42:32  Adrian 
 #.CPro.Fns.Exec0          2008.02.22 19:43:40  Adrian 

Note that you cannot specify the negative value as -4 rather than ¯4 because Dyalog considers it to be a switch then and refuses to accept that.

For that reason there is also a -d switch which means that the integer shall be treated as a day. That way the value can be positive.

By default Latest investigates #. With the optional switch -s one can change that. The following statement returns 6 fns/opr from the namespace #.Class.IC:

      ]Latest2 ¯5 -s=#.Class.IC
 #.Class.IC.Caption      1997.07.31 18:13:06  Adrian 
 #.Class.IC.Design       1997.07.31 23:38:26  Adrian 
 #.Class.IC.Create       1997.08.01 11:50:52  Adrian 
 #.Class.IC.onConfigure  1997.08.01 11:54:51  Adrian 
 #.Class.IC.Read         1997.09.01 15:36:54  Adrian 
 #.Class.IC.Fns          2008.01.23 12:51:28  Adrian 
 #.Class.IC.Refresh      2008.02.22 19:42:32  Adrian 

Occasionally it might be useful to include fns/opr from scripted namespaces as well. This can be achieved with the -a switch (for "all").

Let's create a scripted namespace in order to get something to bite into:

      ⎕fix ':Namespace Foo' '∇r←Hello' 'r←''World''' '∇' ':EndNamespace'
      ]Latest2 3
 #.Class.IL.Refresh  2008.02.22 19:27:25  Adrian 
 #.Class.IC.Refresh  2008.02.22 19:42:32  Adrian 
 #.CPro.Fns.Exec0    2008.02.22 19:43:40  Adrian 
      ]Latest2 3 -a
 #.Class.IC.Refresh  2008.02.22 19:42:32  Adrian 
 #.CPro.Fns.Exec0    2008.02.22 19:43:40  Adrian 
 #.Foo.Hello         2012.03.05 16:20:35  Kai    

Download

Download the script and the workspace.

Version

The script is version 1.1.9 from 2017-02-24

Author: KaiJaeger

-- KaiJaeger 2012-03-05 14:37:53


CategoryDyalogUserCommands