<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 1, 2012, at 7:51 PM, <a href="mailto:openbios-request@openbios.org">openbios-request@openbios.org</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Message: 2<br>Date: Fri, 31 Aug 2012 13:40:58 -0500<br>From: Tarl Neustaedter <<a href="mailto:tarl-b2@tarl.net">tarl-b2@tarl.net</a>><br>To: The OpenBIOS Mailinglist <<a href="mailto:openbios@openbios.org">openbios@openbios.org</a>><br>Subject: Re: [OpenBIOS] Fwd: [PATCH] Adds local variable support to<br><span class="Apple-tab-span" style="white-space: pre; ">        </span>OpenBIOS.<br>Message-ID: <<a href="mailto:5041053A.90303@tarl.net">5041053A.90303@tarl.net</a>><br>Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"<br><br>On 2012-Aug-31 09:50 , Programmingkid wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">Are you saying my-variable is better than myVariable?<br></blockquote><br>Yes.<br></span></blockquote><div><br></div><div>I have changed all my code from camelCase to hyphens. </div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br><blockquote type="cite">How do global variables get you in trouble in recursion? Do you have<span class="Apple-converted-space"> </span><br></blockquote><blockquote type="cite">an example?<br></blockquote><br>Not off-hand, we learn to avoid doing that. To construct one - let's<span class="Apple-converted-space"> </span><br>take a method doing recursion properly, and break it:<br><br>\ Correct way, using stack manipulation<br>: fibonacci ( fib -- return ) recursive<br>   dup 2 >= if                 ( fib )<br>      dup 1- fibonnaci         ( fib fib-1 )<br>      swap 2 - fibonnaci       ( fib-1 fib-2 )<br>      +                        ( fib )<br>   then                        ( fib )<br>;<br><br>\ Incorrect way - using variable "fib", which will get overwritten<span class="Apple-converted-space"> </span><br>during recursion<br>0 value fib;<br>: fibonnaci ( fib -- return ) recursive<br>   to fib \ to avoid stack manipulation<br>   fib 2 < if<br>      fib exit<br>   then<br>   fib 1- fibonnaci           ( fib-1)<br>   fib 2 - fibonnaci          ( fib-1 fib-2 )<br>   +                          ( fib )<br>;<br></span></blockquote></div><br><div>There is nothing to worry about. All the global variables in my code are only used at compile- time - not during runtime. </div></body></html>