Discussion:
[Bug-apl] )HELP for defined functions
Juergen Sauermann
2017-04-20 16:22:54 UTC
Permalink
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Helvetica, Arial, sans-serif">Hi,<br>
<br>
I have implemented Elias' earlier proposal for <b>)HELP</b> with
defined functions (actually all kinds<br>
of user defined names).<br>
<br>
If there is a name, say <b>NAME</b>, in your workspace, then<br>
<br>
<font face="Courier New, Courier, monospace"><b>      ]HELP NAME</b></font><br>
<br>
should provide some information about <b>NAME</b>, eg:<br>
<br>
<font face="Courier New, Courier, monospace"><b>      NAME←3 3⍴0</b><b><br>
</b><b>      )HELP NAME</b><b><br>
</b><b>symbol NAME is a variable:</b><b><br>
</b><b>    Rank:  2</b><b><br>
</b><b>    Shape: 3 3</b><b><br>
</b><b>    Depth: 1</b></font><br>
<br>
If NAME is a function, then code extraction comments are shown:<br>
<br>
<font face="Courier New, Courier, monospace"><b>            ∇NAME
B</b><b><br>
</b><b>[1] ⍝⍝ code extraction comment (always shown)</b><b><br>
</b><b>[2] ⍝ normal comment (not shown unless in toronto mode)</b><b><br>
</b><b>[3] 1 2 3   ⍝ APL code ends toronto mode</b><b><br>
</b><b>[4] ⍝. toronto code extraction comment</b><b><br>
</b><b>[5] ⍝ normal comment (shown because in toronto mode)</b><b><br>
</b><b>[6] 1 2 3</b><b><br>
</b><b>[7]  ∇</b><b><br>
</b><b>      </b><b><br>
</b><b>      )HELP NAME</b><b><br>
</b><b>symbol NAME is a monadic defined function:</b><b><br>
</b><b>    Header: NAME B</b><b><br>
</b><b>    ⍝⍝ code extraction comment (always shown)</b><b><br>
</b><b>    ⍝. toronto code extraction comment</b><b><br>
</b><b>    ⍝ normal comment (shown because in toronto mode)</b></font><b><br>
</b><br>
Finally, <b>)HELP</b> is subject to tab expansion; tab with <b>]HELP</b>
only shows the APL primitives and,<br>
either the first character of all names (if there are many) or all
names (if there are not too many).<br>
<br>
Tab with <b>)HELP XXX</b> shows all names starting with <b>XXX</b>.<br>
<br>
I hope this implements everything that was discussed earlier. <b>SVN
926</b>.<br>
<br>
/// Jürgen<br>
<br>
</font>
</body>
</html>
Fred Weigel
2017-04-20 19:45:04 UTC
Permalink
Juergen

The help extraction works beautifully! I am making a change to toolkit
to change first line of each comment to double-lamp (because that works
perfectly). And this gives great help when working interactively!

Again, many thanks!
FredW
Louis de Forcrand
2017-04-23 01:33:19 UTC
Permalink
Hi,

Great work JÃŒrgen, Alexey, and all others involved.

May I suggest adding the type of data to its help info? (ie: numeric, literal, mixed)

Thanks a lot,
Louis
Hi,
I have implemented Elias' earlier proposal for )HELP with defined functions (actually all kinds
of user defined names).
If there is a name, say NAME, in your workspace, then
]HELP NAME
NAME←3 3⍮0
)HELP NAME
Rank: 2
Shape: 3 3
Depth: 1
∇NAME B
[1] ⍝⍝ code extraction comment (always shown)
[2] ⍝ normal comment (not shown unless in toronto mode)
[3] 1 2 3 ⍝ APL code ends toronto mode
[4] ⍝. toronto code extraction comment
[5] ⍝ normal comment (shown because in toronto mode)
[6] 1 2 3
[7] ∇
)HELP NAME
Header: NAME B
⍝⍝ code extraction comment (always shown)
⍝. toronto code extraction comment
⍝ normal comment (shown because in toronto mode)
Finally, )HELP is subject to tab expansion; tab with ]HELP only shows the APL primitives and,
either the first character of all names (if there are many) or all names (if there are not too many).
Tab with )HELP XXX shows all names starting with XXX.
I hope this implements everything that was discussed earlier. SVN 926.
/// JÃŒrgen
Juergen Sauermann
2017-04-23 10:06:04 UTC
Permalink
Hi Louis,

thanks, fixed in *SVN 929*.

/// Jürgen
Hi,
Great work Jürgen, Alexey, and all others involved.
May I suggest adding the type of data to its help info? (ie: numeric, literal, mixed)
Thanks a lot,
Louis
On 20 Apr 2017, at 18:22, Juergen Sauermann
Hi,
I have implemented Elias' earlier proposal for *)HELP* with defined
functions (actually all kinds
of user defined names).
If there is a name, say *NAME*, in your workspace, then
*]HELP NAME*
*NAME←3 3⍴0**
** )HELP NAME**
**symbol NAME is a variable:**
** Rank: 2**
** Shape: 3 3**
** Depth: 1*
*∇NAME B**
**[1] ⍝⍝ code extraction comment (always shown)**
**[2] ⍝ normal comment (not shown unless in toronto mode)**
**[3] 1 2 3 ⍝ APL code ends toronto mode**
**[4] ⍝. toronto code extraction comment**
**[5] ⍝ normal comment (shown because in toronto mode)**
**[6] 1 2 3**
**[7] ∇**
****
** )HELP NAME**
**symbol NAME is a monadic defined function:**
** Header: NAME B**
** ⍝⍝ code extraction comment (always shown)**
** ⍝. toronto code extraction comment**
** ⍝ normal comment (shown because in toronto mode)**
*
Finally, *)HELP* is subject to tab expansion; tab with *]HELP* only
shows the APL primitives and,
either the first character of all names (if there are many) or all
names (if there are not too many).
Tab with *)HELP XXX* shows all names starting with *XXX*.
I hope this implements everything that was discussed earlier. *SVN 926*.
/// Jürgen
Loading...