From help-octave-request at bevo dot che dot wisc dot edu Tue Jan 20 03:14:09 1998 Subject: Re: How to tell a function from a string From: "John W. Eaton" To: "Lorenzo M. Catucci" Cc: help-octave at bevo dot che dot wisc dot edu Date: Tue, 20 Jan 1998 03:10:58 -0600 On 20-Jan-1998, Lorenzo M. Catucci wrote: | On Tue, 20 Jan 1998, John W. Eaton wrote: | | > On 17-Jan-1998, Lorenzo M. Catucci wrote: | > | > Unfortunately, there isn't a good way to do this from Octave, though | > you could probably wrap is_valid function from src/variables.cc in a | > DEFUN easily enough. | > | > In 2.0.x, you can do something like this (from src/lsode.cc): | > | > tree_fvc *lsode_fcn = is_valid_function (args(0), "lsode", 1); | > | > if (! lsode_fcn) | > error ... | > | > In 2.1.x and later the interface will change. You will have to use | > octave_function* instead of tree_fvc*. | > | Now comes another question: does there exist some reason not to have such | a wrapper defined into octave's main? If you mean why haven't I written it, probably because I never needed it and I don't recall anyone else ever complaining that it was missing. jwe