Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: well this code works and I had some guy say it doesn't Date: Sat, 21 Sep 2013 13:09:23 -0400 Organization: Aioe.org NNTP Server Lines: 33 Message-ID: References: <5e19d09b-027f-420a-a569-5123a16319e6@googlegroups.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; 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:25894 On Sat, 21 Sep 2013 08:46:46 -0400, rickman wrote: > On 9/20/2013 11:52 PM, Elizabeth D. Rather wrote: >> On 9/20/13 4:48 PM, Ed wrote: >>> Elizabeth D Rather wrote: ... >> For learners, stack comments are especially helpful, since by having to >> state them at the beginning of the definition they're led to focus on >> the stack going in and coming out, and the comment is there to remind >> them. One of the early simple exercises in Forth Application Techniques >> involves printing out [n] stars, which many define as: >> >> : STARS ( n -- ) 0 DO ." * " LOOP DROP ; >> >> The ones who include the stack comment are far less likely to just type >> STARS without an argument or forget the DROP at the end. But the >> consequences of forgetting the number are also a good teaching moment. >> ;-) > > I don't think you are helping your argument. The DROP at the end of > your definition is incorrect. The input argument is consumed by the DO. Wow, the troll discusses Forth, gets one correct, and isn't calling someone else a troll. What's even more notable is that she (IIRC) pointed out to me, and either Andrew or Mark, maybe about a year and half ago, that if our loop control words were coded correctly then they shouldn't need DROPs or 2DROPs at the end. Yet, she used a DROP after a loop. Rod Pemberton