Name: Anonymous 2009-10-01 7:48
I've recently started nesting functions far more than I used to and I wondered whether nesting functions has any drawbacks. Nesting functions? (fine/bad)
(map 'string (lambda (x) (if (upper-case-p x) (char-downcase x) (char-upcase x))) "nESTING FUNCTIONS IN WHICH LANGUAGE? (tHERE'S DIFFERENT EFFECTS IN EACH OBVIOUSLY). wHICH IS TO SAY, IF YOUR LANGUAGE HAS THE ANONYMOUS FUNCTION FEATURE - LAMBDA EXPRESSIONS - USE IT WHEN RECURSION IS NOT NECESSARY INSIDE THE BODY (UNLESS YOUR LANGUAGE SOLVES THIS PROBLEM IN A MORE CONVENIENT WAY, cl CAN DO THAT WITH MACROS AND PEOPLE HAVE PROVIDED ANONYMOUS LAMBDA FUNCTIONS THAT RECURSE IN THE FUNCTION THEY DESIGNATE), OR IF THE FUNCTION NEEDS TO BE USED MULTIPLE TIMES IN YOUR EXPRESSION/FOLLOWING CODE. (TYPING THE ANONYMOUS EXPRESSION MULTIPLE TIMES IS STUPID AND MIGHT NOT BE THE SAME IF THERE'S SIDE EFFECTS, I.E. CLOSURE"))
"Nesting functions in which language? (There's different effects in each obviously). Which is to say, if your language has the anonymous function feature - lambda expressions - use it when recursion is not necessary inside the body (unless your language solves this problem in a more convenient way, CL can do that with macros and people have provided anonymous lambda functions that recurse in the function they designate), or if the function needs to be used multiple times in your expression/following code. (typing the anonymous expression multiple times is stupid and might not be the same if there's side effects, i.e. closure"
main() and then use goto statements to navigate around.