<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 25, 2012, at 8:19 AM, <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; ">On 22/08/12 02:44, Programmingkid wrote:<br><br><blockquote type="cite">The following code is for the use of local variables in OpenBIOS. I was<br></blockquote><blockquote type="cite">able to successfully make a word that used local variables. The work<br></blockquote><blockquote type="cite">isn't complete. There is still work to be done with the INTERPRET word.<br></blockquote><blockquote type="cite">The LFIND word has be implemented in the INTERPRET word for local<br></blockquote><blockquote type="cite">variables to be recognized during the compile state. I just need a<br></blockquote><blockquote type="cite">C-like CONTINUE word to go back to the start of a loop to fix all my<br></blockquote><blockquote type="cite">problems with INTERPRET. Maybe someone knows a better way of adding<br></blockquote><blockquote type="cite">LFIND to INTERPRET.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I would appreciate any comments, suggestions, or advice for the<br></blockquote><blockquote type="cite">following code.<br></blockquote><br>Interesting work! I think that you may have made this a harder problem<span class="Apple-converted-space"> </span><br>that it should be though.<br><br>When I had a quick look at doing something earlier a while back, I<span class="Apple-converted-space"> </span><br>noticed that OpenBIOS already has a concept of multiple dictionaries<span class="Apple-converted-space"> </span><br>with a search order (see dict-list?). My idea for an implementation was<span class="Apple-converted-space"> </span><br>to intercept docol to create a new dictionary at the top of the<span class="Apple-converted-space"> </span><br>function, add it to the head of the search list and then add the values<span class="Apple-converted-space"> </span><br>from the local variable declaration. This is pretty much what happens<span class="Apple-converted-space"> </span><br>when you "cd" to a particular path in the device tree.<br><br>Similarly you can then intercept dosemi from the search list to remove<span class="Apple-converted-space"> </span><br>the dictionary and clear up. The advantage of this approach is that you<span class="Apple-converted-space"> </span><br>can use all the in-built dictionary functions to manage your local<span class="Apple-converted-space"> </span><br>variable words, rather than your current approach which is to<span class="Apple-converted-space"> </span><br>re-implement this functionality yourself.<br><br><br>HTH,<br><br>Mark.</span></blockquote><br></div><div><br></div><div>I did try at one time to do this, but decided to go the route of imitating how x86 assembly uses local variables. </div><br></body></html>