octave-maintainers
[Top][All Lists]
Advanced

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

File extensions in __list_functions__


From: John W. Eaton
Subject: File extensions in __list_functions__
Date: Tue, 26 May 2009 09:52:34 -0400

On 26-May-2009, Søren Hauberg wrote:

| When generating documentation caches for 'lookfor' we use the
| '__list_functions__' function (defined in 'src/help.cc'), which returns
| a list of functions in a given directory. Currently, the returned list
| of functions includes extensions, i.e. you get list elements like
| "foo.m" and "bar.oct". This is breaking the cache generation in 'pkg'.
| 
| My questions is, should '__list_functions__' be changed such that
| extensions are not returned, or should functions calling
| '__list_functions__' remove the extensions themselves?

Are the extensions actually used anywhere?  If so, how?  Would it be
useful to be able to distinguish among .m, .oct, and .mex files?

It seems odd that __list_funtions__ returns a list of function names
without extensions, but __list_functions__ (DIR) returns a list with
extensions.

Your message also reminds me that we currently have

  __list_functions__
  __builtins__
  __keywords__

How about being consistent and using

  __list_functions__
  __list_built_in_functions__
  __list_keywords__

?

Also, why do we need a separate list of built-in functions?  Could we
simply include the built-in function names in the output of
__list_functions__?

Finally, is there currently a way to list all the visible function
names with a single function call?  I think that could be useful thing
to have.

What about having a single function to list all the function names and
keywords?  It could return a structure array with names and additional
info about the functions.  For example, we could use the fields

  name = "for"
  keyword = true
  builtin = false
  m = false
  oct = false
  mex = false

Or maybe there is a better way to do this?

It might also be good to have a data structure that would allow us to
easily produce diagnostics about functions that have multiple
definitions.

jwe



reply via email to

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