Unexpected behavior with built-in

Joel LeBlanc jwleblan at gmail.com
Thu Jul 9 18:02:35 CDT 2009


I need to think about it (and eat!).
I think there are two issues here.  One is about what should be done (as you
have said), and the other is about what is happening.

For example, run this one instead
*****************************************

function builtinFailure



builtin('fopen','noFile');



end



function fopen(varargin)

disp('Calling overloaded load function: Test Failed!');

end

*****************************************
I get:
>> which fopen
`fopen' is a built-in function
>> builtinFailure
Calling overloaded load function: Test Failed!

So I maintain that builtin is not working, and I'll think about the other
issue.

Thanks John!

~Joel

On Thu, Jul 9, 2009 at 4:22 PM, John W. Eaton <jwe at octave.org> wrote:

> On  9-Jul-2009, Joel LeBlanc wrote:
>
> | The current tip (9423:f284e2a26ff9) gives unexpected behavior when I run
> | built-in.  I am running on OSX (Darwin Kernel Version 9.7.0: Tue Mar 31
> | 22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386 i386
> | MacBookPro2,2 Darwin).
> | Sorry about not having the
> | standard debug format, but bug_report gives (octave-bug-3.1.55: command
> not
> | found).
> |
> | So here is a simple function to replicate my concern:
> | ************************
> |
> | function builtinFailure
> |
> |
> |
> | builtin('beep');
> |
> |
> |
> | end
> |
> |
> |
> | function beep
> |
> | disp('Calling overloaded load function: Test Failed!');
> |
> | end
>
> In Octave, beep is not a built-in function.  I'm not sure what should
> happen here.  Should we have builtin only look up built-in functions
> (I think that is what Matlab does)?
>
> Or maybe we should have builtin only look up built-in functions and
> functions on the default path?  But if we do that, then how do we
> decide what is the default path?
>
> I'm really not sure what is best here.  I lean toward the first
> solution, but then it seems likely that we will get complaints that
> the list of built-in functions in Octave and Matlab are different.
> And I don't really want to have to be compatible at that level, so I
> don't expect that situation to change.
>
> jwe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20090709/e97b3be5/attachment-0001.html 


More information about the Bug-octave mailing list