bug-apl
[Top][All Lists]
Advanced

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

[Bug-apl] Function definition information (extension proposal)


From: David Lamkins
Subject: [Bug-apl] Function definition information (extension proposal)
Date: Mon, 14 Jul 2014 10:56:13 -0700

Elias' thread about docstrings got me to thinking about other function metadata.

One thing that might be nice to have is for APL to record the source location of a function's definition.

If the function is defined in a file, record the path and the line number of the first line of the definition. If the function is defined from some other source, either record a suitable token that won't be confused for a filename or simply record nothing.

The source location information could be exposed to APL programs via an extension to ⎕AT or via a new system function created for this purpose.

Source location information could be used to implement a meta-dot command. Unlike an approach that requires use of a tags file (I'd be surprised if ctags or etags even works for APL code), the location information maintained by the APL session would be up-to-date and would correctly distinguish between a function loaded from a file and a function redefined from within the session.

Finally, it'd be nice to expose a system function to allow update of the source location metadata for use by tools which need to programatically load APL code from a file.

Note that capturing the source file location of a function definition is something that can't already be done in APL without writing APL equivalents of )LOAD, )COPY, )PCOPY, )IN, )PIN, etc.

--

reply via email to

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