Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: How could have I factored this better? Date: Fri, 20 May 2016 20:08:05 -0700 Organization: A noiseless patient Spider Lines: 19 Message-ID: <87oa80cdm2.fsf@jester.gateway.pace.com> References: <5e60dbda-f34b-4be0-bfac-d32ddc67062f@googlegroups.com> <871t4we4e3.fsf@jester.gateway.pace.com> <87wpmock1u.fsf@jester.gateway.pace.com> <87shxcchyt.fsf@jester.gateway.pace.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="52eac348160ce62b68e4635eee7cc854"; logging-data="32463"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PYznNS+JzFDbN7R6KX+rP" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:0ygVNO9PbMsoYrzQ1mssaMwrQsQ= sha1:rKnduGhq3U8zqpG2QtcGeGghmuw= Xref: csiph.com comp.lang.forth:47387 "Elizabeth D. Rather" writes: > I don't know how the gForth compiler handles locals. It's an interpreter and it uses a locals stack, so there's a bit of overhead to what I did. >> Forth programs tend to not use anything except possibly naming >> conventions to prevent words from being globally usable. > That's right. Reusability is a good thing. If you're a solo > programmer, you should be able to manage your programs.... Sure. Part of managing programs is being able to change the interface to a word and quickly find all the places that call it so you can fix the calls, and be sure that you can't have missed any. One way to do that is limit the word's visibility so that it can only be called from a specific part of the program. Of course can still use the word somewhere else if you decide to. You just have to update the visibility (export the word from a module or whatever) first. Forth lets you do this with word lists.