defining a func within another func...

Devin

Usenet Archive
Joined
Sep 27, 2001
Messages
342
Reaction score
0
O.K. so I've seen people defining a function inside another function or command. But what's the purpose? Is it then local to the func it's declared in? Can outside funcs access it?

Thanks,

Devin
 
So in the early days declaring them locally was a work around for other issues? Memory?
 
Thanks for the info, it clarifies things for me.

Devin
 
Can also be handy if you need the function to work differently based on different conditions.I.E. (If A (defun func Do something one way .....)(defun func Do Something a different way...)).

Usually it is easier to put the condition in the function itself, but if the condition is really complex and/or takes a lot of time to evaluate, then it is better to do it once and just define the appropriate function.
 
Didn't think about that, great perspective.

Devin
 

Latest threads

Back
Top