bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Free APL reference documentation, any takers?


From: Juergen Sauermann
Subject: Re: [Bug-apl] Free APL reference documentation, any takers?
Date: Mon, 17 Apr 2017 20:16:40 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Hi Elias,

the API to the APL help texts is the help_def() macro. See e.g. Command.cc line 778.

Showing )HELP for defined function seems to be a cool idea, but I need a little more time
for that.

Best Regards,
/// Jürgen


On 04/17/2017 01:18 PM, Elias Mårtenson wrote:
Hello Jürgen,

What is the API provided to programmatically access the documentation for a given function?

Whatever the API is, may I suggest that this function also accepts any defined function? The text returned should of course be the content of the comment header (i.e. the comments at the beginning of the function prefixed with two ⍝ symbols. The first line is the summary, while the rest is the long description.

For the benefit of others on the list that doesn't know how that works, here's an example from the SQL library:

∇Z←statement SQL∆Select[db] args
⍝⍝ Execute a select statement and return the result table.
⍝⍝
⍝⍝ The axis parameter indicates the database handle.
⍝⍝
⍝⍝ L is a select statement to be executed. Positional parameters can
⍝⍝ be supplied by specifying a question mark "?" in the statemement.
⍝⍝
⍝⍝ R is an array containing the values for the positional parameters.
⍝⍝ If the array is of rank 2, the statement will be executed multiple
⍝⍝ times with each row being the values for each call.
⍝⍝
⍝⍝ The return value is a rank-2 array representing the result of the
⍝⍝ select statement. Null values are returned as ⍬ and empty strings
⍝⍝ are returned as ''.
  Z←statement ⎕SQL[3,db] args





reply via email to

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