Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Gerry Jackson Newsgroups: comp.lang.forth Subject: Re: Forth for education Date: Thu, 19 Sep 2013 12:47:02 +0100 Organization: A noiseless patient Spider Lines: 108 Message-ID: References: <0d34c96e-d56b-4d85-85f3-7379a3a1eb72@googlegroups.com> <5235eb3d.280545989@news.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 19 Sep 2013 11:46:55 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="d70c4a7c50f40e5d6b9f99940fbca73f"; logging-data="25541"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bMlMj3buE1okcTJQjhTbSjaEtDkZ+RiM=" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: Cancel-Lock: sha1:X4zMcFgJlBEMT5s4nnNNqqVnc60= Xref: csiph.com comp.lang.forth:25814 On 19/09/2013 02:10, Rod Pemberton wrote: > On Wed, 18 Sep 2013 17:08:00 -0400, Gerry Jackson > wrote: > >> On 18/09/2013 14:41, Rod Pemberton wrote: >>> On Wed, 18 Sep 2013 03:57:19 -0400, Andrew Haley >>> wrote: > >>> Don't you think four decades of conversation on what's the best >>> way to implement control-flow in Forth is enough? When it's not how >>> to implement control-flow, it's how to use DOES> ... Etc., Forth is >>> cryptic, Forth has no syntax. >> >> Nonsense. Of course Forth has some syntax, [...] > > Forth has no official syntax. It has some defacto syntax. Again nonsense but taking that at face value - if it has "de facto syntax" then it has syntax so your original statement is wrong. See also para 3.4.1.2 in the ANS Forth document. Anyway what do you mean by "official syntax"? Presumably the fact that there is no section defining a Forth grammar in BNF or some other notation. That's because it's not needed and would probably be difficulty to write if it included all possibilities and restrictions to incorporate Forth's flexibility. But you're wrong again e.g. see the ANS Forth document 12.3.7 where the syntax for a floating point number is defined using a form of BNF. > > E.g., brackets [ ] to distinguish compile-time and run-time > versions of the same Forth word. : (colon) and ; (semis) > could also be viewed as syntax since they separate much > of an immediate stream of executing words from words that > are being compiled. Etc. As Elizabeth says : and ; don't have a syntax. However a colon definition does and could be defined (in outline) as: ::= : ( | | | ... etc )* ; where the definition of would be defined using [ and ] and before you ask "where does it say that?", it's an ad hoc formalisation of descriptions spread around the standard document in word definitions and other text. > [...] >> At the grammar level control structures such as IF ... ELSE ... >> THEN clearly form part of Forth's syntax - > > Not so. > >> if there is no terminating THEN, the structure is wrong. > > Really? Says who or what? > > Which standard or document do you think requires that? > > Hint: > > fig-Forth doesn't say that. > F-79 doesn't say that. > F-83 doesn't say that. > ANS doesn't say that either. Elizabeth answered that. > However, there is no constraint in the stack parameters for any of > them that would actually require a Forth implementor to only allow > THEN to be used with an IF or ELSE. THEN can function correctly > as long as the stack parameters are valid. E.g., I could define > the "WADADABOOP" control-flow to work correctly with and be > terminated by THEN. If someone implements THEN to require a matching > IF , they've added additional functionality not required, perhaps > for safety. I.e., if so, then they've created syntax, but it's not > officially required. You're waffling. The point is that Forth enables the users to define their own syntax and that includes overriding the default Forth syntax itself. > >> If all control structures, colon definitions, variable definitions >> etc are considered there is quite a bit of syntax. > > Of course, that's not official syntax, but, yes, that is a trivial > amount of defacto syntax. You're admitting that Forth does have syntax contrary to your original assertion. > >> The conclusion is that Forth has a *lot* of syntax and so the >> statement "Forth has no syntax" is a load of bollocks. > > I think you're confusing and conflating much. I think arguing with you is like arguing with a religious bigot - a total waste of time. -- Gerry