Quantcast

stubs for missing functions

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

stubs for missing functions

John W. Eaton
Administrator
We frequently see people sending bug reports or questions on the help
list about functions that are available in Matlab but missing from
Octave.  I think we could avoid many of these problems with the
attached patch.  The idea is that for every core Matlab function that
we know about that is missing from Octave, we create a simple stub
function which when run fails with the error:

  error: The FCN function is not yet implemented in Octave.  Please read
  `http://www.octave.org/missing.html' to find out how you can help to
  contribute a working version of this function.
  error: called from:
  ...

Likewise, if someone asks for help about one of these functions, they
will get the following help text:

  `FCN' is a function from the file .../FCN.m

   -- Function File:  FCN ()
       This function is not yet implemented in Octave.  Please read
       `http://www.octave.org/missing.html' to find out how you can help
       to contribute a working version of this function.

(In both cases, FCN will be replaced by the actual function name).

The referenced web page, http://www.octave.org/missing.html remains to
be written.  I intend to explain that there are several possible
reasons why the function is missing:

  The function may exist in Octave Forge but has not yet been adopted
  as a part of the core Octave distribution.

  The function may be new to Matlab.  Perhaps the Octave community
  has no knowledge of it.

  Octave is developed by volunteers who tend to contribute the
  functions which they need, and so far no one has contributed a
  version of this function.

My advice will be something like

  1. check Octave Forge, as a similar function may be available there.

  2. consider writing a function and contributing it.

  3. consider paying someone to implement the function for you.

  4. file a feature request in the bug tracker.

Comments?

Are there any objections to committing this patch?

Thanks,

jwe



# HG changeset patch
# User John W. Eaton <[hidden email]>
# Date 1269382331 14400
# Node ID 875e6b7088f1bffed1454fd90a57a89387f41821
# Parent  146e615b667496161f7a94eb3a89f5f54acf5de2
create stub functions for unimplemented Matlab functions

diff --git a/scripts/ChangeLog b/scripts/ChangeLog
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,14 @@
+2010-03-23  John W. Eaton  <[hidden email]>
+
+ * Makefile.am: Include stub/module.mk.
+ (nobase_fcn_file_DATA, EXTRA_DIST, DISTCLEANFILES):
+ Include stub_FCN_FILES in the list.
+ (all-local): Depend on stub_FCN_FILES.
+ (stub/$(octave_dirstamp)): New target.
+ * mkstub.sh: New script.
+ * stub/module.mk, stub/function-list: New files.
+ * stub/private/unimplemented.m: New function.
+
 2010-03-23  John W. Eaton  <[hidden email]>
 
  * plot/refreshdata.m: Don't use cell2mat on cell array of cell arrays.
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -65,16 +65,17 @@
 include statistics/models/module.mk
 include statistics/tests/module.mk
 include strings/module.mk
+include stub/module.mk
 include testfun/module.mk
 include time/module.mk
 
-nobase_fcnfile_DATA = $(FCN_FILES) $(GEN_FCN_FILES)
+nobase_fcnfile_DATA = $(FCN_FILES) $(GEN_FCN_FILES) $(stub_FCN_FILES)
 
 image_DATA = $(IMAGES)
 
 FCN_FILES_IN = $(GEN_FCN_FILES:.m=.in)
 
-all-local: $(GEN_FCN_FILES) $(PKG_ADD_FILES) .DOCSTRINGS
+all-local: $(GEN_FCN_FILES) $(stub_FCN_FILES) $(PKG_ADD_FILES) .DOCSTRINGS
 
 octave_dirstamp = $(am__leading_dot)dirstamp
 
@@ -305,6 +306,9 @@
 strings/$(octave_dirstamp):
  $(MKDIR_P) strings
  : > strings/$(octave_dirstamp)
+stub/$(octave_dirstamp):
+ $(MKDIR_P) stub
+ : > stub/$(octave_dirstamp)
 testfun/$(octave_dirstamp):
  $(MKDIR_P) testfun
  : > testfun/$(octave_dirstamp)
@@ -403,6 +407,7 @@
   $(FCN_FILES) \
   $(FCN_FILES_IN) \
   $(GEN_FCN_FILES) \
+  $(stub_FCN_FILES) \
   DOCSTRINGS \
   mkdoc \
   mk-pkg-add
@@ -411,5 +416,6 @@
   DOCSTRINGS \
   $(PKG_ADD_FILES) \
   $(DIRSTAMP_FILES) \
-  $(GEN_FCN_FILES)
+  $(GEN_FCN_FILES) \
+  $(stub_FCN_FILES)
 
diff --git a/scripts/mkstub.sh b/scripts/mkstub.sh
new file mode 100755
--- /dev/null
+++ b/scripts/mkstub.sh
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+if [ $# -eq 1 ]; then
+  FCN="$1"
+else
+  echo "usage: mkstub.sh fcn" 1>&2
+  exit 1;
+fi
+
+cat << EOF
+## -*- texinfo -*-
+## @deftypefn {Function File} {} $FCN ()
+## This function is not yet implemented in Octave.  Please read
+## @url{http://www.octave.org/missing.html} to find out how you can
+## help to contribute a working version of this function.
+## @end deftypefn
+
+function $FCN ()
+
+  unimplemented ("$FCN");
+
+endfunction
+EOF
diff --git a/scripts/stub/function-list b/scripts/stub/function-list
new file mode 100644
--- /dev/null
+++ b/scripts/stub/function-list
@@ -0,0 +1,400 @@
+DelaunayTri
+MException
+RandStream
+TriRep
+TriScatteredInterp
+addpref
+align
+alim
+alpha
+alphamap
+annotation
+audiodevinfo
+audioplayer
+audiorecorder
+aufinfo
+auread
+auwrite
+avifile
+aviinfo
+aviread
+bar3
+bar3h
+bench
+betaincinv
+bicg
+bicgstabl
+break
+brush
+builddocsearchdb
+bvp4c
+bvp5c
+bvpget
+bvpinit
+bvpset
+bvpxtend
+callSoapService
+calllib
+camdolly
+cameratoolbar
+camlight
+camlookat
+camorbit
+campan
+campos
+camproj
+camroll
+camtarget
+camup
+camva
+camzoom
+case
+catch
+cdf2rdf
+cdfepoch
+cdfinfo
+cdfread
+cdfwrite
+cellplot
+checkin
+checkout
+cholinc
+classdef
+clearvars
+clipboard
+cmopts
+cmpermute
+cmunique
+colordef
+colormapeditor
+comet3
+commandhistory
+commandwindow
+condeig
+coneplot
+continue
+contourslice
+copyobj
+createClassFromWsdl
+createSoapMessage
+curl
+customverctrl
+daqread
+datacursormode
+datatipinfo
+dbmex
+dde23
+ddeget
+ddesd
+ddeset
+decic
+depdir
+depfun
+deval
+dialog
+dither
+divergence
+docopt
+docsearch
+dragrect
+dynamicprops
+echodemo
+ellipj
+ellipke
+else
+elseif
+end
+erfcinv
+errordlg
+evalc
+events
+exifread
+expint
+export2wsdlg
+figurepalette
+filebrowser
+fill3
+findfigs
+fitsinfo
+fitsread
+flow
+fminsearch
+for
+frame2im
+freqspace
+function
+function_handle
+funm
+gallery
+gammaincinv
+gco
+getappdata
+getframe
+getpixelposition
+getpref
+global
+gmres
+grabcode
+graymon
+gsvd
+guidata
+guide
+guihandles
+handle
+hdf
+hdf5
+hdf5info
+hdf5read
+hdf5write
+hdfinfo
+hdfread
+hdftool
+helpbrowser
+helpdesk
+helpdlg
+helpwin
+hgexport
+hgload
+hgsave
+hgsetget
+hgtransform
+hostid
+if
+ilu
+im2frame
+im2java
+imapprox
+imformats
+import
+importdata
+inmem
+inputParser
+inputdlg
+inspect
+instrfind
+instrfindall
+interpstreamspeed
+isappdata
+iscom
+isinterface
+isjava
+isocaps
+ispref
+isprop
+isstudent
+javaArray
+javaMethod
+javaMethodEDT
+javaObject
+javaObjectEDT
+javaaddpath
+javachk
+javaclasspath
+javarmpath
+ldl
+libfunctions
+libfunctionsview
+libisloaded
+libpointer
+libstruct
+light
+lightangle
+lighting
+linkaxes
+linkdata
+linsolve
+listdlg
+listfonts
+loadlibrary
+lscov
+lsqr
+makehgtform
+material
+matlabrc
+maxNumCompThreads
+memmapfile
+memory
+metaclass
+methodsview
+minres
+mlint
+mlintrpt
+mmfileinfo
+mmreader
+movegui
+movie
+movie2avi
+msgbox
+multibandread
+multibandwrite
+native2unicode
+noanimate
+ode113
+ode15i
+ode15s
+ode23
+ode23s
+ode23t
+ode23tb
+ode45
+odefile
+odeget
+odeset
+odextend
+onCleanup
+open
+openfig
+opengl
+openvar
+ordeig
+ordqz
+ordschur
+otherwise
+padecoef
+pagesetupdlg
+pan
+parfor
+parseSoapResponse
+path2rc
+pathtool
+pcode
+pdepe
+pdeval
+persistent
+pie3
+playshow
+plotbrowser
+plotedit
+plottools
+polyeig
+prefdir
+preferences
+printdlg
+printopt
+printpreview
+profile
+profsave
+propedit
+properties
+propertyeditor
+psi
+publish
+qmr
+quad2d
+questdlg
+randi
+rbbox
+rectangle
+recycle
+reducepatch
+reducevolume
+resample
+reset
+return
+rgbplot
+rmappdata
+rmpref
+root
+rotate
+rotate3d
+rsf2csf
+saveas
+selectmoveresize
+sendmail
+serial
+setappdata
+setpixelposition
+setpref
+showplottool
+shrinkfaces
+smooth3
+snapnow
+sound
+soundsc
+ss2tf
+stream2
+stream3
+streamline
+streamparticles
+streamribbon
+streamslice
+streamtube
+strings
+subvolume
+superclasses
+support
+surf2patch
+switch
+symmlq
+syntax
+tetramesh
+texlabel
+textscan
+textwrap
+tfqmr
+timer
+timerfind
+timerfindall
+timeseries
+toolboxdir
+try
+tscollection
+tstool
+uibuttongroup
+uicontextmenu
+uicontrol
+uigetdir
+uigetfile
+uigetpref
+uiimport
+uimenu
+uiopen
+uipanel
+uipushtool
+uiputfile
+uiresume
+uisave
+uisetcolor
+uisetfont
+uisetpref
+uistack
+uitable
+uitoggletool
+uitoolbar
+uiwait
+undocheckout
+unicode2native
+unloadlibrary
+unmesh
+usejava
+userpath
+validateattributes
+varargin
+varargout
+verLessThan
+verctrl
+viewmtx
+visdiff
+volumebounds
+waitbar
+waitfor
+warndlg
+waterfall
+wavfinfo
+wavplay
+wavrecord
+web
+whatsnew
+while
+whitebg
+wk1finfo
+wk1read
+wk1write
+workspace
+xlsfinfo
+xlsread
+xlswrite
+xmlread
+xmlwrite
+xslt
+zoom
diff --git a/scripts/stub/module.mk b/scripts/stub/module.mk
new file mode 100644
--- /dev/null
+++ b/scripts/stub/module.mk
@@ -0,0 +1,16 @@
+FCN_FILE_DIRS += stub
+
+stub_PRIVATE_FCN_FILES = \
+  stub/private/unimplemented.m
+
+stub_fcn_names = $(shell cat $(srcdir)/stub/function-list)
+
+stub_FCN_FILES = \
+  $(addprefix stub/, $(addsuffix .m, $(stub_fcn_names))) \
+  $(stub_PRIVATE_FCN_FILES)
+
+$(stub_FCN_FILES):
+ $(srcdir)/mkstub.sh $(notdir $(basename $@)) > $@-t
+ mv $@-t $@
+
+DIRSTAMP_FILES += stub/$(octave_dirstamp)
diff --git a/scripts/stub/private/unimplemented.m b/scripts/stub/private/unimplemented.m
new file mode 100644
--- /dev/null
+++ b/scripts/stub/private/unimplemented.m
@@ -0,0 +1,34 @@
+## Copyright (C) 2010 John W. Eaton
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} unimplemented ()
+## Undocumented internal function.
+## @end deftypefn
+
+function unimplemented (fcn)
+
+  txt = __makeinfo__ (sprintf ("The %s function is not yet implemented in Octave.  Please read @url{http://www.octave.org/missing.html} to find out how you can help to contribute a working version of this function.", fcn));
+
+  while (txt(end) == "\n")
+    txt(end) = "";
+  endwhile
+
+  error (txt);
+
+endfunction
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stubs for missing functions

Søren Hauberg
tir, 23 03 2010 kl. 18:33 -0400, skrev John W. Eaton:
> We frequently see people sending bug reports or questions on the help
> list about functions that are available in Matlab but missing from
> Octave.
[snip]
> Comments?

I think this idea is good. Just a few minor comments/questions:

     1. We recently introduced warnings when a function in a package
        shadows something that is distributed with Octave. If we start
        distributing a bunch of stubs, won't that generate a bunch of
        warnings if the user installs a package that provides some of
        these functions?
     2. It would be nice if http://www.octave.org/missing.html included
        the list of stubs. When suggesting the user to look at
        Octave-Forge we can then use the following link:
        http://octave.sourceforge.net/find_function.php?fun=STUB_FUNCTION where 'STUB_FUNCTION' should be replaced with the name of the stub in question.
     3. It seems like you forgot to deal with keywords in your list of
        potential stubs. At least the list includes stuff like 'end',
        'for', 'varargin', etc. In Octave, you can get the complete list
        of keywords, using the '__keywords__' function.

Also

> +function unimplemented (fcn)
> +
> +  txt = __makeinfo__ (sprintf ("The %s function is not yet implemented in Octave.  Please read @url{http://www.octave.org/missing.html} to find out how you can help to contribute a working version of this function.", fcn));
> +
> +  while (txt(end) == "\n")
> +    txt(end) = "";
> +  endwhile

Can't this while-loop be replaced by a call to a 'strip' function. Ohh,
I see we don't have functions for stripping spaces from text. In 'pkg.m'
we have some functions for doing stuff like this. Perhaps they should be
made generally available?

Søren

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stubs for missing functions

Søren Hauberg
tir, 23 03 2010 kl. 15:52 -0700, skrev Søren Hauberg:
> tir, 23 03 2010 kl. 18:33 -0400, skrev John W. Eaton:
> > We frequently see people sending bug reports or questions on the help
> > list about functions that are available in Matlab but missing from
> > Octave.
> [snip]
> > Comments?
>
> I think this idea is good. Just a few minor comments/questions:

Ohh, I also forgot to mention that this might be annoying when it comes
to tab-completion. I would find it really confusing if I pressed tab and
was confronted with a list of functions that I actually couldn't use.
Perhaps a solution would be to have a function 'isstub' that determined
if a function was only a stub. The warning system and the tab-completion
system could then skip functions where 'isstub' returns true. Such a
function would also be of use to me in the 'generate_html' package that
we use to create the Octave-Forge web site. This would allow us to not
generate web pages for stubs or at least to mark it clearly that the
function is but a stub.

Søren

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stubs for missing functions

John W. Eaton
Administrator
On 23-Mar-2010, S ren Hauberg wrote:

| tir, 23 03 2010 kl. 15:52 -0700, skrev S ren Hauberg:
| > tir, 23 03 2010 kl. 18:33 -0400, skrev John W. Eaton:
| > > We frequently see people sending bug reports or questions on the help
| > > list about functions that are available in Matlab but missing from
| > > Octave.
| > [snip]
| > > Comments?
| >
| > I think this idea is good. Just a few minor comments/questions:
|
| Ohh, I also forgot to mention that this might be annoying when it comes
| to tab-completion. I would find it really confusing if I pressed tab and
| was confronted with a list of functions that I actually couldn't use.
| Perhaps a solution would be to have a function 'isstub' that determined
| if a function was only a stub. The warning system and the tab-completion
| system could then skip functions where 'isstub' returns true. Such a
| function would also be of use to me in the 'generate_html' package that
| we use to create the Octave-Forge web site. This would allow us to not
| generate web pages for stubs or at least to mark it clearly that the
| function is but a stub.

Yes, I agree we should have some way of ignoring stub functions for
all these reasons.

jwe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stubs for missing functions

John W. Eaton
Administrator
In reply to this post by Søren Hauberg
On 23-Mar-2010, S ren Hauberg wrote:

|      3. It seems like you forgot to deal with keywords in your list of
|         potential stubs. At least the list includes stuff like 'end',
|         'for', 'varargin', etc. In Octave, you can get the complete list
|         of keywords, using the '__keywords__' function.

OK, I removed keywords from the list.

| Also
|
| > +function unimplemented (fcn)
| > +
| > +  txt = __makeinfo__ (sprintf ("The %s function is not yet implemented in Octave.  Please read @url{http://www.octave.org/missing.html} to find out how you can help to contribute a working version of this function.", fcn));
| > +
| > +  while (txt(end) == "\n")
| > +    txt(end) = "";
| > +  endwhile
|
| Can't this while-loop be replaced by a call to a 'strip' function. Ohh,
| I see we don't have functions for stripping spaces from text. In 'pkg.m'
| we have some functions for doing stuff like this. Perhaps they should be
| made generally available?

I guess

  regexprep (txt, "\n*$", "")

will also work?

jwe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stubs for missing functions

John W. Eaton
Administrator
In reply to this post by Søren Hauberg
On 23-Mar-2010, S ren Hauberg wrote:

| tir, 23 03 2010 kl. 18:33 -0400, skrev John W. Eaton:
| > We frequently see people sending bug reports or questions on the help
| > list about functions that are available in Matlab but missing from
| > Octave.
| [snip]
| > Comments?
|
| I think this idea is good. Just a few minor comments/questions:
|
|      1. We recently introduced warnings when a function in a package
|         shadows something that is distributed with Octave. If we start
|         distributing a bunch of stubs, won't that generate a bunch of
|         warnings if the user installs a package that provides some of
|         these functions?
|      2. It would be nice if http://www.octave.org/missing.html included
|         the list of stubs. When suggesting the user to look at
|         Octave-Forge we can then use the following link:
|         http://octave.sourceforge.net/find_function.php?fun=STUB_FUNCTION where 'STUB_FUNCTION' should be replaced with the name of the stub in question.
|      3. It seems like you forgot to deal with keywords in your list of
|         potential stubs. At least the list includes stuff like 'end',
|         'for', 'varargin', etc. In Octave, you can get the complete list
|         of keywords, using the '__keywords__' function.
|
| Also
|
| > +function unimplemented (fcn)
| > +
| > +  txt = __makeinfo__ (sprintf ("The %s function is not yet implemented in Octave.  Please read @url{http://www.octave.org/missing.html} to find out how you can help to contribute a working version of this function.", fcn));
| > +
| > +  while (txt(end) == "\n")
| > +    txt(end) = "";
| > +  endwhile
|
| Can't this while-loop be replaced by a call to a 'strip' function. Ohh,
| I see we don't have functions for stripping spaces from text. In 'pkg.m'
| we have some functions for doing stuff like this. Perhaps they should be
| made generally available?

I'm attaching an updated version of the patch.  I haven't tried to
skip stub functions when doing completion, but I have added the
functions is_stub_function and stub_functions.

jwe


# HG changeset patch
# User John W. Eaton <[hidden email]>
# Date 1269406154 14400
# Node ID e1dde1e1e1e4b6dd2d2e93da64645b9e92c295cb
# Parent  146e615b667496161f7a94eb3a89f5f54acf5de2
create stub functions for unimplemented Matlab functions

diff --git a/scripts/ChangeLog b/scripts/ChangeLog
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,14 @@
+2010-03-24  John W. Eaton  <[hidden email]>
+
+ * Makefile.am: Include stub/module.mk.
+ (nobase_fcn_file_DATA, EXTRA_DIST, DISTCLEANFILES):
+ Include stub_FCN_FILES in the list.
+ (all-local): Depend on stub_FCN_FILES.
+ (stub/$(octave_dirstamp)): New target.
+ * mkstub.sh, mkstubs.sh: New scripts.
+ * stub/module.mk, stub/function-list: New files.
+ * stub/is_stub_function.m, stub/private/unimplemented.m: New functions.
+
 2010-03-23  John W. Eaton  <[hidden email]>
 
  * plot/refreshdata.m: Don't use cell2mat on cell array of cell arrays.
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -65,16 +65,17 @@
 include statistics/models/module.mk
 include statistics/tests/module.mk
 include strings/module.mk
+include stub/module.mk
 include testfun/module.mk
 include time/module.mk
 
-nobase_fcnfile_DATA = $(FCN_FILES) $(GEN_FCN_FILES)
+nobase_fcnfile_DATA = $(FCN_FILES) $(GEN_FCN_FILES) $(stub_FCN_FILES)
 
 image_DATA = $(IMAGES)
 
 FCN_FILES_IN = $(GEN_FCN_FILES:.m=.in)
 
-all-local: $(GEN_FCN_FILES) $(PKG_ADD_FILES) .DOCSTRINGS
+all-local: $(GEN_FCN_FILES) $(stub_FCN_FILES) $(PKG_ADD_FILES) .DOCSTRINGS
 
 octave_dirstamp = $(am__leading_dot)dirstamp
 
@@ -305,6 +306,9 @@
 strings/$(octave_dirstamp):
  $(MKDIR_P) strings
  : > strings/$(octave_dirstamp)
+stub/$(octave_dirstamp):
+ $(MKDIR_P) stub
+ : > stub/$(octave_dirstamp)
 testfun/$(octave_dirstamp):
  $(MKDIR_P) testfun
  : > testfun/$(octave_dirstamp)
@@ -403,6 +407,7 @@
   $(FCN_FILES) \
   $(FCN_FILES_IN) \
   $(GEN_FCN_FILES) \
+  $(stub_FCN_FILES) \
   DOCSTRINGS \
   mkdoc \
   mk-pkg-add
@@ -411,5 +416,6 @@
   DOCSTRINGS \
   $(PKG_ADD_FILES) \
   $(DIRSTAMP_FILES) \
-  $(GEN_FCN_FILES)
+  $(GEN_FCN_FILES) \
+  $(stub_FCN_FILES)
 
diff --git a/scripts/mkstub.sh b/scripts/mkstub.sh
new file mode 100755
--- /dev/null
+++ b/scripts/mkstub.sh
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+if [ $# -eq 1 ]; then
+  FCN="$1"
+else
+  echo "usage: mkstub.sh fcn" 1>&2
+  exit 1;
+fi
+
+cat << EOF
+## -*- texinfo -*-
+## @deftypefn {Function File} {} $FCN ()
+## This function is not yet implemented in Octave.  Please read
+## @url{http://www.octave.org/missing.html} to find out how you can
+## help to contribute a working version of this function.
+## @end deftypefn
+
+function $FCN ()
+
+  unimplemented ("$FCN");
+
+endfunction
+EOF
diff --git a/scripts/mkstubs.sh b/scripts/mkstubs.sh
new file mode 100755
--- /dev/null
+++ b/scripts/mkstubs.sh
@@ -0,0 +1,50 @@
+#! /bin/sh
+
+if [ $# -eq 1 ]; then
+  fcn_list_file="$1"
+else
+  echo "usage: mkstubs.sh fcn-list-file" 1>&2
+  exit 1;
+fi
+
+cat << EOF
+## Copyright (C) 2010 John W. Eaton
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} stub_functions ()
+## List all stub functions distributed with Octave.
+## @end deftypefn
+
+function retval = stub_functions ()
+
+  persistent stub_fcn_list = {
+EOF
+
+while read fcn
+do
+  echo "    \"$fcn\";";
+done < $fcn_list_file
+
+cat << EOF
+  };
+
+  retval = stub_fcn_list;
+
+endfunction
+EOF
diff --git a/scripts/stub/function-list b/scripts/stub/function-list
new file mode 100644
--- /dev/null
+++ b/scripts/stub/function-list
@@ -0,0 +1,377 @@
+DelaunayTri
+MException
+RandStream
+TriRep
+TriScatteredInterp
+addpref
+align
+alim
+alpha
+alphamap
+annotation
+audiodevinfo
+audioplayer
+audiorecorder
+aufinfo
+auread
+auwrite
+avifile
+aviinfo
+aviread
+bar3
+bar3h
+bench
+betaincinv
+bicg
+bicgstabl
+brush
+builddocsearchdb
+bvp4c
+bvp5c
+bvpget
+bvpinit
+bvpset
+bvpxtend
+callSoapService
+calllib
+camdolly
+cameratoolbar
+camlight
+camlookat
+camorbit
+campan
+campos
+camproj
+camroll
+camtarget
+camup
+camva
+camzoom
+cdf2rdf
+cdfepoch
+cdfinfo
+cdfread
+cdfwrite
+cellplot
+checkin
+checkout
+cholinc
+clearvars
+clipboard
+cmopts
+cmpermute
+cmunique
+colordef
+colormapeditor
+comet3
+commandhistory
+commandwindow
+condeig
+coneplot
+contourslice
+copyobj
+createClassFromWsdl
+createSoapMessage
+curl
+customverctrl
+daqread
+datacursormode
+datatipinfo
+dbmex
+dde23
+ddeget
+ddesd
+ddeset
+decic
+depdir
+depfun
+deval
+dialog
+dither
+divergence
+docopt
+docsearch
+dragrect
+dynamicprops
+echodemo
+ellipj
+ellipke
+erfcinv
+errordlg
+evalc
+exifread
+expint
+export2wsdlg
+figurepalette
+filebrowser
+fill3
+findfigs
+fitsinfo
+fitsread
+flow
+fminsearch
+frame2im
+freqspace
+funm
+gallery
+gammaincinv
+gco
+getappdata
+getframe
+getpixelposition
+getpref
+gmres
+grabcode
+graymon
+gsvd
+guidata
+guide
+guihandles
+handle
+hdf
+hdf5
+hdf5info
+hdf5read
+hdf5write
+hdfinfo
+hdfread
+hdftool
+helpbrowser
+helpdesk
+helpdlg
+helpwin
+hgexport
+hgload
+hgsave
+hgsetget
+hgtransform
+hostid
+ilu
+im2frame
+im2java
+imapprox
+imformats
+import
+importdata
+inmem
+inputParser
+inputdlg
+inspect
+instrfind
+instrfindall
+interpstreamspeed
+isappdata
+iscom
+isinterface
+isjava
+isocaps
+ispref
+isprop
+isstudent
+javaArray
+javaMethod
+javaMethodEDT
+javaObject
+javaObjectEDT
+javaaddpath
+javachk
+javaclasspath
+javarmpath
+ldl
+libfunctions
+libfunctionsview
+libisloaded
+libpointer
+libstruct
+light
+lightangle
+lighting
+linkaxes
+linkdata
+linsolve
+listdlg
+listfonts
+loadlibrary
+lscov
+lsqr
+makehgtform
+material
+matlabrc
+maxNumCompThreads
+memmapfile
+memory
+metaclass
+methodsview
+minres
+mlint
+mlintrpt
+mmfileinfo
+mmreader
+movegui
+movie
+movie2avi
+msgbox
+multibandread
+multibandwrite
+native2unicode
+noanimate
+ode113
+ode15i
+ode15s
+ode23
+ode23s
+ode23t
+ode23tb
+ode45
+odefile
+odeget
+odeset
+odextend
+onCleanup
+open
+openfig
+opengl
+openvar
+ordeig
+ordqz
+ordschur
+padecoef
+pagesetupdlg
+pan
+parfor
+parseSoapResponse
+path2rc
+pathtool
+pcode
+pdepe
+pdeval
+pie3
+playshow
+plotbrowser
+plotedit
+plottools
+polyeig
+prefdir
+preferences
+printdlg
+printopt
+printpreview
+profile
+profsave
+propedit
+propertyeditor
+publish
+qmr
+quad2d
+questdlg
+randi
+rbbox
+rectangle
+recycle
+reducepatch
+reducevolume
+resample
+reset
+rgbplot
+rmappdata
+rmpref
+root
+rotate
+rotate3d
+rsf2csf
+saveas
+selectmoveresize
+sendmail
+serial
+setappdata
+setpixelposition
+setpref
+showplottool
+shrinkfaces
+smooth3
+snapnow
+sound
+soundsc
+ss2tf
+stream2
+stream3
+streamline
+streamparticles
+streamribbon
+streamslice
+streamtube
+strings
+subvolume
+superclasses
+support
+surf2patch
+symmlq
+syntax
+tetramesh
+texlabel
+textscan
+textwrap
+tfqmr
+timer
+timerfind
+timerfindall
+timeseries
+toolboxdir
+tscollection
+tstool
+uibuttongroup
+uicontextmenu
+uicontrol
+uigetdir
+uigetfile
+uigetpref
+uiimport
+uimenu
+uiopen
+uipanel
+uipushtool
+uiputfile
+uiresume
+uisave
+uisetcolor
+uisetfont
+uisetpref
+uistack
+uitable
+uitoggletool
+uitoolbar
+uiwait
+undocheckout
+unicode2native
+unloadlibrary
+unmesh
+usejava
+userpath
+validateattributes
+varargin
+varargout
+verLessThan
+viewmtx
+visdiff
+volumebounds
+waitbar
+waitfor
+warndlg
+waterfall
+wavfinfo
+wavplay
+wavrecord
+web
+whatsnew
+whitebg
+wk1finfo
+wk1read
+wk1write
+workspace
+xlsfinfo
+xlsread
+xlswrite
+xmlread
+xmlwrite
+xslt
+zoom
diff --git a/scripts/stub/is_stub_function.m b/scripts/stub/is_stub_function.m
new file mode 100644
--- /dev/null
+++ b/scripts/stub/is_stub_function.m
@@ -0,0 +1,43 @@
+## Copyright (C) 2010 John W. Eaton
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} is_stub_function (@var{name})
+## Return true if @var{name} is a stub function included in the
+## Octave distribution.
+## @end deftypefn
+
+function retval = is_stub_function (name)
+
+  if (nargin == 1)
+    if (ischar (name))
+      if (ismember (name, stub_functions ()))
+        d = fileparts (which (name));
+        i = strchr (d, "/", 1, "last");
+        retval = strcmp (d(i+1:end), "stub");
+      else
+        retval = false;
+      endif
+    else
+      error ("is_stub_function: expecting function name as argument");
+    endif
+  else
+    print_usage ();
+  endif
+
+endfunction
diff --git a/scripts/stub/module.mk b/scripts/stub/module.mk
new file mode 100644
--- /dev/null
+++ b/scripts/stub/module.mk
@@ -0,0 +1,24 @@
+FCN_FILE_DIRS += stub
+
+stub_PRIVATE_FCN_FILES = \
+  stub/private/unimplemented.m
+
+stub_fcn_names = $(shell cat $(srcdir)/stub/function-list)
+
+gen_stub_fcns = $(addprefix stub/, $(addsuffix .m, $(stub_fcn_names)))
+
+stub_FCN_FILES = \
+  stub/is_stub_function.m \
+  stub/stub_functions.m \
+  $(gen_stub_fcns) \
+  $(stub_PRIVATE_FCN_FILES)
+
+$(gen_stub_fcns):
+ $(srcdir)/mkstub.sh $(notdir $(basename $@)) > $@-t
+ mv $@-t $@
+
+stub/stub_functions.m: mkstubs.sh stub/function-list
+ $(srcdir)/mkstubs.sh $(srcdir)/stub/function-list > $@-t
+ mv $@-t $@
+
+DIRSTAMP_FILES += stub/$(octave_dirstamp)
diff --git a/scripts/stub/private/unimplemented.m b/scripts/stub/private/unimplemented.m
new file mode 100644
--- /dev/null
+++ b/scripts/stub/private/unimplemented.m
@@ -0,0 +1,32 @@
+## Copyright (C) 2010 John W. Eaton
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} unimplemented ()
+## Undocumented internal function.
+## @end deftypefn
+
+function unimplemented (fcn)
+
+  txt = __makeinfo__ (sprintf ("The %s function is not yet implemented in Octave.  Please read @url{http://www.octave.org/missing.html} to find out how you can help to contribute a working version of this function.", fcn));
+
+  txt = regexprep (txt, "\n\n", "");
+
+  error (txt);
+
+endfunction
diff --git a/src/ChangeLog b/src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-24  John W. Eaton  <[hidden email]>
+
+ * load-path.cc (load_path::add_to_fcn_map):
+ Don't warn about shadowing stub functions.
+
 2010-03-23  Jaroslav Hajek  <[hidden email]>
 
  * data.cc (Frem, Fmod): New DEFUNs.
diff --git a/src/load-path.cc b/src/load-path.cc
--- a/src/load-path.cc
+++ b/src/load-path.cc
@@ -1688,13 +1688,27 @@
           else
             {
               // Warn if a built-in or library function is being shadowed.
+
               if (! file_info_list.empty ())
                 {
                   file_info& old = file_info_list.front ();
-                  if (sys_path.find (old.dir_name) != std::string::npos)
-                  if (in_path_list (sys_path, old.dir_name))
+
+                  std::string odir = old.dir_name;
+
+                  bool is_stub_dir =
+                    (file_ops::is_dir_sep (odir[odir.length () - 5])
+                     && (odir.substr (odir.length () - 4) == "stub"));
+
+                  // FIXME -- do we need to be more careful about the
+                  // way we look for old.dir_name in sys_path to avoid
+                  // partial matches?
+
+                  if (! is_stub_dir
+                      && sys_path.find (old.dir_name) != std::string::npos
+                      && in_path_list (sys_path, old.dir_name))
                     {
                       std::string fcn_path = file_ops::concat (dir_name, fname);
+
                       warning_with_id ("Octave:shadowed-function",
                                        "function %s shadows a core library function",
                                        fcn_path.c_str ());
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stubs for missing functions

Jaroslav Hajek-2
In reply to this post by John W. Eaton
On Tue, Mar 23, 2010 at 11:33 PM, John W. Eaton <[hidden email]> wrote:

> We frequently see people sending bug reports or questions on the help
> list about functions that are available in Matlab but missing from
> Octave.  I think we could avoid many of these problems with the
> attached patch.  The idea is that for every core Matlab function that
> we know about that is missing from Octave, we create a simple stub
> function which when run fails with the error:
>
>  error: The FCN function is not yet implemented in Octave.  Please read
>  `http://www.octave.org/missing.html' to find out how you can help to
>  contribute a working version of this function.
>  error: called from:
>  ...
>
> Likewise, if someone asks for help about one of these functions, they
> will get the following help text:
>
>  `FCN' is a function from the file .../FCN.m
>
>   -- Function File:  FCN ()
>       This function is not yet implemented in Octave.  Please read
>       `http://www.octave.org/missing.html' to find out how you can help
>       to contribute a working version of this function.
>
> (In both cases, FCN will be replaced by the actual function name).
>
> The referenced web page, http://www.octave.org/missing.html remains to
> be written.  I intend to explain that there are several possible
> reasons why the function is missing:
>
>  The function may exist in Octave Forge but has not yet been adopted
>  as a part of the core Octave distribution.
>
>  The function may be new to Matlab.  Perhaps the Octave community
>  has no knowledge of it.
>
>  Octave is developed by volunteers who tend to contribute the
>  functions which they need, and so far no one has contributed a
>  version of this function.
>
> My advice will be something like
>
>  1. check Octave Forge, as a similar function may be available there.
>
>  2. consider writing a function and contributing it.
>
>  3. consider paying someone to implement the function for you.
>
>  4. file a feature request in the bug tracker.
>
> Comments?
>
> Are there any objections to committing this patch?
>
> Thanks,
>
> jwe
>
>


Besides Soren's comments, I have a couple more:

1. I'm a bit sceptical that this will help. I suppose most users
realize that the missing functions are not implemented.
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.
3. I am almost sure when implementing new functions I will forget to
delete them from the list. (Not that this is serious :)

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.).

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?

--
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stubs for missing functions

Jaroslav Hajek-2
On Wed, Mar 24, 2010 at 7:53 AM, Jaroslav Hajek <[hidden email]> wrote:

> On Tue, Mar 23, 2010 at 11:33 PM, John W. Eaton <[hidden email]> wrote:
>> We frequently see people sending bug reports or questions on the help
>> list about functions that are available in Matlab but missing from
>> Octave.  I think we could avoid many of these problems with the
>> attached patch.  The idea is that for every core Matlab function that
>> we know about that is missing from Octave, we create a simple stub
>> function which when run fails with the error:
>>
>>  error: The FCN function is not yet implemented in Octave.  Please read
>>  `http://www.octave.org/missing.html' to find out how you can help to
>>  contribute a working version of this function.
>>  error: called from:
>>  ...
>>
>> Likewise, if someone asks for help about one of these functions, they
>> will get the following help text:
>>
>>  `FCN' is a function from the file .../FCN.m
>>
>>   -- Function File:  FCN ()
>>       This function is not yet implemented in Octave.  Please read
>>       `http://www.octave.org/missing.html' to find out how you can help
>>       to contribute a working version of this function.
>>
>> (In both cases, FCN will be replaced by the actual function name).
>>
>> The referenced web page, http://www.octave.org/missing.html remains to
>> be written.  I intend to explain that there are several possible
>> reasons why the function is missing:
>>
>>  The function may exist in Octave Forge but has not yet been adopted
>>  as a part of the core Octave distribution.
>>
>>  The function may be new to Matlab.  Perhaps the Octave community
>>  has no knowledge of it.
>>
>>  Octave is developed by volunteers who tend to contribute the
>>  functions which they need, and so far no one has contributed a
>>  version of this function.
>>
>> My advice will be something like
>>
>>  1. check Octave Forge, as a similar function may be available there.
>>
>>  2. consider writing a function and contributing it.
>>
>>  3. consider paying someone to implement the function for you.
>>
>>  4. file a feature request in the bug tracker.
>>
>> Comments?
>>
>> Are there any objections to committing this patch?
>>
>> Thanks,
>>
>> jwe
>>
>>
>
>
> Besides Soren's comments, I have a couple more:
>
> 1. I'm a bit sceptical that this will help. I suppose most users
> realize that the missing functions are not implemented.
> 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.
> 3. I am almost sure when implementing new functions I will forget to
> delete them from the list. (Not that this is serious :)
>
> 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.).
>
> 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?
>
Attached is a suggested patch. I started from John's list (deleted
things like varargout), which should serve as a fallback, but anyone
is welcome to add more specific, descriptive messages for certain
classes of functions.
I'll add some myself unless there are objections to this patch.

--
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

missing.diff (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stubs for missing functions

John W. Eaton
Administrator
In reply to this post by Jaroslav Hajek-2
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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stubs for missing functions

Jaroslav Hajek-2
On Wed, Mar 24, 2010 at 12:04 PM, John W. Eaton <[hidden email]> wrote:

> 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
>

OK, I did so with some modifications: I encapsulated the gripe and
moved it to variables.cc so that it can be called from multiple
places. I added a call from feval. I don't think it's needed to cover
all cases where an unknown identifier may result in an error, however.
I also reformatted the message a bit and added special messages for
some functions. So now it works like this:

octave:1> a = onCleanup (@(~) dosomething)
warning:
onCleanup is not implemented. Consider using unwind_protect, which is
more versatile. For more info, type `help unwind_protect'.  Please read
`http://www.octave.org/missing.html'to find out how you can help with
contributing missing functionality.


error: `onCleanup' undefined near line 1 column 5
octave:1> missing_function_hook ("")
octave:2> a = onCleanup (@(~) dosomething)
error: `onCleanup' undefined near line 2 column 5

Feel free to add more specializations or correct existing ones. For
instance, perhaps we can comment on the gui functions and why they're
unlikely to be ever added.

This is also a good place to advertise your OctaveForge package.

--
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

Loading...