Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.datemas.de!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: Which scripting for embedded automation? Date: Sun, 26 Jul 2015 17:11:22 -0400 Organization: Aioe.org NNTP Server Lines: 48 Message-ID: References: <0e930740-22d8-4e2b-833f-bb5843437d0d@googlegroups.com> <87y4i6rvyc.fsf@jester.gateway.sonic.net> <87lhe5sciz.fsf@jester.gateway.sonic.net> <8f8f8dd6-efca-4f3e-ac18-ed28bce7524c@googlegroups.com> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:40808 On Sun, 26 Jul 2015 13:53:14 -0400, Alex McDonald wrote: > on 26/07/2015 12:01:26, glidedog wrote: ... >> Mark's lament is understandable. Forth doesn't even have a built-in >> cell-sized-element array wordset. > > The definition of a 1 dimensional array is trivial; perhaps that's why. > > : 1dim create cells allot does> swap cells + ; > > 10 1dim myarray > 10 0 myarray ! > 20 1 myarray ! > 0 myarray @ 1 myarray @ + . > Okay, don't blow a fuse for me butting in without reading most of this, but ... How is that on factoring? Shouldn't there be a separate word to do array indexing so the indexing functionality can be re-used? Then, it would be factored, correct? ... E.g., : [] swap cells + ; : 1dim create cells allot ; 10 1dim myarray 10 0 myarray [] ! 20 1 myarray [] ! 0 myarray [] @ 1 myarray [] @ + . Isn't the non-factoring of Forth words the core issue Mark is getting at? Or, perhaps, he is pointing out that everyone has forgotten Forth has or had specialty words like +! and TOGGLE . If Forth has or had *those* words, why shouldn't Forth have a word to index into arrays? Rod Pemberton -- Scientists now say we'll experience a mini-ice in 2030. So, I guess we need more global warming today ...