octave-maintainers
[Top][All Lists]
Advanced

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

Re: stubs for missing functions


From: John W. Eaton
Subject: Re: stubs for missing functions
Date: Wed, 24 Mar 2010 07:04:26 -0400

On 24-Mar-2010, Jaroslav Hajek wrote:

| 1. I'm a bit sceptical that this will help. I suppose most users
| realize that the missing functions are not implemented.

My impression is that many users think their copy of Octave is broken
in some way.  After all, they have probably read somewhere on the web
that Octave is a "Matlab clone" so many seem to not understand that
some things are not available.  By pointing them to an explanation of
the situation, I'm hoping to be able to explain that it is not our job
to provide for them.

| 2. Several times when writing code compatible with Matlab I used tricks like
| if exist ("somematlabfunc")
|   ## Use it.
| else
|   ## Work it around.
| end
| 
| this will now be impossible.

We could make exist return 0 for stub functions, but that is a bit of
a kluge and might cause other trouble.

| 4. This may give users a false impression that we eventually intend to
| implement all of these functions, which I think is not true.
| Some are handled by Octave forge instead, others make no sense with
| Octave (isstudent etc.).

I would certainly try to avoid giving that impression in the longer
description on the web page.  Or, perhaps I could point to a section in
the manual instead, so that the information is available with Octave
and not separate on the web.

| Here's an alternative suggestion:
| Let's create a global pseudo-variable missing_function_handler that,
| if set, will be called with the missing identifier name
| just prior to raising an error. By default, we'll point it to an
| m-file handler. This has several advantages:
| 
| 1. much less code
| 2. is configurable (relieved sigh)
| 3. doesn't spoil tab completion or shadowing
| 4. we can easily specialize it for certain classes of functions. We
| can point users to OctaveForge extensions or suggest alternatives.
| (for instance, we can write "textscan is not implemented, try using
| textread" or "gsvd is not part of core Octave, see linear-algebra
| package on OctaveForge"). And all this can happen in one function.
| 
| what do you think?

OK, as this has the same effect by default and several advantages, go
ahead and check it in.

Thanks,

jwe


reply via email to

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