help-octave
[Top][All Lists]
Advanced

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

Re: "Permanent" variables


From: Andy Buckle
Subject: Re: "Permanent" variables
Date: Mon, 8 Feb 2016 15:44:46 +0000


On 8 February 2016 at 13:54, grg <address@hidden> wrote:
Dear all,

I've now added functions in my path that I can use to abbreviate those
commands as I initially wanted.

Thanks so much for your help!

grg



--
View this message in context: http://octave.1599824.n4.nabble.com/Permanent-variables-tp4674551p4674699.html
Sent from the Octave - General mailing list archive at Nabble.com.

_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave

Beware! There is  a pitfall of having lots of functions with short names. One day you will forget and name a variable the same. Then your function is hidden.

octave:6> aargh
ans = errr
octave:7> type aargh
aargh is the user-defined function defined from: /home/cf/octave/aargh.m   

function a=aargh
   a='errr';
endfunction
octave:8> aargh = 1  
aargh =  1
octave:9> aargh
aargh =  1
octave:10> aargh()
ans =  1
octave:11>

I wish octave would warn you when you do this. (Perhaps I should try a patch).
--
/* andy buckle */

reply via email to

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