Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #28630

Re: Forth reinvention

From "Alex McDonald" <blog@rivadpm.com>
Newsgroups comp.lang.forth
Subject Re: Forth reinvention
Date 2014-02-20 23:25 +0000
Organization A noiseless patient Spider
Message-ID <le62sf$csc$1@dont-email.me> (permalink)
References <b5ec955a-146f-41ea-a227-22e4224cab49@googlegroups.com> <op.xbkrqu0h5zc71u@localhost> <le553r$d32$1@dont-email.me> <op.xblmpdha5zc71u@localhost>

Show all headers | View raw


on 20/02/2014 21:16:16, "Rod Pemberton" wrote:
> On Thu, 20 Feb 2014 09:56:59 -0500, Alex McDonald <blog@rivadpm.com>
> > wrote:
>> on 20/02/2014 10:07:32, "Rod Pemberton" wrote:
> > wrote:
>>
> wrote:
> 
>>> Of course, once you eliminate infix from Forth, progress towards use
>>
>> You mean postfix.
> 
> Yes, true, sorry.  Technically, I meant to eliminate prefix too, not
> just postfix. So, unfortunately, 'eliminate' was actually the opposite
> meaning of what I meant.
> 
>>> of symbols for logical, binary, math operations, begin to use curly
>>
>> Forth doesn't have logical operations.
>>
> 
> If that were true, there would be no need for a "well formed flag" in
> Forth.
> 
> That was debated here recently and it seems you've supported use of
> "well formed flags" in other threads.

I mean in the sense of C's && and ||. There are no Forth equivalent
logical operators, and Forth's IF does not test for false or true; it
tests against zero.

> 
>>> braces, and eliminate the work of the user keeping track of stack
>>
>> Forth doesn't have a block structure.
> 
> It does.
> 
> E.g., this is a block structure:
> 
> ( ... singular pre-computed condition on data stack ... )
> IF
> ( ... block ... )
> ELSE
> ( ... block ... )
> THEN
> 
> Of course, Forth is not always expressed as well formatted text,
> and doesn't have to be.
> 
> All of Forth's control-flow has words to mark the beginning and
> ending of each block.  This is like many other languages, but
> especially block oriented scripting languages.  But, I'll
> demonstrate in COBOL (a language I've never programmed BTW):
> 
> IF ( ... set of conditions ... )
> THEN
> ( ... block ... )
> ELSE
> ( ... block ... )
> END-IF
> 
> The THEN keyword for Forth and END-IF keyword for COBOL are needed
> because they're block structured.  Inherently, all programming
> languages are.
> 
> Of course, in C the syntax uses braces, if the block is more
> than just one statement:
> 
> if  /* conditions */
> {
> /* block */
> }
> else
> {
> /* block */
> }
> 
> You can do the same thing with any other control flow too, e.g.,
> DO .. LOOP , ?DO .. +LOOP , BEGIN .. AGAIN , BEGIN .. UNTIL ,
> BEGIN .. WHILE .. REPEAT , Eaker's case, etc.
> 
> Basically, the curly braces mark some of the locations where
> branches for assembly or binary are placed in C.  


Rubbish. This is legal C that has no blocks.

  if ( x==y ) then a=1; else b=1;

> These locations
> correspond to where they are used in Forth control-flow words too.
> Some Forths use BRANCH and 0BRANCH or ?BRANCH to place these branches.
> The keywords in C mark some of other locations just as in Forth. The
> rest are escape control-flow words like UNLOOP and EXIT in Forth or
> 'break', 'continue' or 'goto' in C.
> 
> Block
> http://en.wikipedia.org/wiki/Block_(programming)
> 
> Control-flow
> http://en.wikipedia.org/wiki/Control_flow
> 
> 

Control flow doesn't make it a block structured language (and the
articles you provide make that clear).

{ int a; a=1; f(a) } { int b; b=2; f(b) } 

and not a control flow in sight.

> Rod Pemberton
> 

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Forth reinvention dambere@web.de - 2014-02-20 01:19 -0800
  Re: Forth reinvention "Rod Pemberton" <dont_use_email@xnohavenotit.cnm> - 2014-02-20 05:07 -0500
    Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-20 14:56 +0000
      Re: Forth reinvention "Rod Pemberton" <dont_use_email@xnohavenotit.cnm> - 2014-02-20 16:16 -0500
        Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-20 23:25 +0000
          Re: Forth reinvention "Rod Pemberton" <dont_use_email@xnohavenotit.cnm> - 2014-02-20 20:42 -0500
            Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-21 12:41 +0000
  Re: Forth reinvention Hans Bezemer <the.beez.speaks@gmail.com> - 2014-02-20 11:18 +0100
    Re: Forth reinvention dambere@web.de - 2014-02-20 02:36 -0800
      Re: Forth reinvention Hans Bezemer <the.beez.speaks@gmail.com> - 2014-02-20 17:35 +0100
        Re: Forth reinvention dambere@web.de - 2014-02-20 11:34 -0800
          Re: Forth reinvention "Elizabeth D. Rather" <erather@forth.com> - 2014-02-20 09:53 -1000
          Re: Forth reinvention Paul Rubin <no.email@nospam.invalid> - 2014-02-20 12:23 -0800
            Re: Forth reinvention dambere@web.de - 2014-02-20 14:00 -0800
              Re: Forth reinvention Paul Rubin <no.email@nospam.invalid> - 2014-02-20 14:23 -0800
                Re: Forth reinvention dambere@web.de - 2014-02-22 02:21 -0800
                Re: Forth reinvention AKK <akk@nospam.org> - 2014-02-22 12:02 +0100
              Re: Forth reinvention Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-02-21 04:38 -0600
          Re: Forth reinvention Mark Wills <markrobertwills@yahoo.co.uk> - 2014-02-20 12:35 -0800
            Re: Forth reinvention Paul Rubin <no.email@nospam.invalid> - 2014-02-20 13:38 -0800
  Re: Forth reinvention m.a.m.hendrix@tue.nl - 2014-02-20 03:59 -0800
    Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-20 15:11 +0000
      Re: Forth reinvention m.a.m.hendrix@tue.nl - 2014-02-20 07:41 -0800
  Re: Forth reinvention Richard Owlett <rowlett@pcnetinc.com> - 2014-02-20 06:38 -0600
    Re: Forth reinvention dambere@web.de - 2014-02-20 12:03 -0800
  Re: Forth reinvention Julian Fondren <julian.fondren@gmail.com> - 2014-02-20 07:08 -0800
  Re: Forth reinvention "Elizabeth D. Rather" <erather@forth.com> - 2014-02-20 09:37 -1000
    Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-20 20:50 +0000
      Re: Forth reinvention "Elizabeth D. Rather" <erather@forth.com> - 2014-02-20 15:39 -1000
        Re: Forth reinvention albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-02-21 10:50 +0000
        Re: Forth reinvention Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-02-21 11:10 +0000
          Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-21 13:50 +0000
        Re: Forth reinvention Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-02-21 05:46 -0600
          Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-21 12:55 +0000
          Re: Forth reinvention anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-02-21 15:11 +0000
            Re: Forth reinvention Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-02-22 09:23 -0600
        Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-21 12:38 +0000
        Re: Forth reinvention anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-02-22 13:29 +0000
          Re: Forth reinvention "Elizabeth D. Rather" <erather@forth.com> - 2014-02-22 07:52 -1000
            Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-22 19:06 +0000
            Re: Forth reinvention anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-02-23 13:40 +0000
    Re: Forth reinvention "Rod Pemberton" <dont_use_email@xnohavenotit.cnm> - 2014-02-20 20:40 -0500
      Re: Forth reinvention "Elizabeth D. Rather" <erather@forth.com> - 2014-02-20 18:43 -1000
        Re: Forth reinvention Hans Bezemer <the.beez.speaks@gmail.com> - 2014-02-21 13:16 +0100
      Re: Forth reinvention stephenXXX@mpeforth.com (Stephen Pelc) - 2014-02-21 10:49 +0000
    Re: Forth reinvention anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-02-21 14:50 +0000
      Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-21 16:28 +0000
        Re: Forth reinvention anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-02-22 12:54 +0000
          Re: Forth reinvention "Rod Pemberton" <dont_use_email@xnohavenotit.cnm> - 2014-02-22 10:27 -0500
          Re: Forth reinvention "Alex McDonald" <blog@rivadpm.com> - 2014-02-22 17:49 +0000
      Re: Forth reinvention Bernd Paysan <bernd.paysan@gmx.de> - 2014-02-21 20:51 +0100
        Re: Forth reinvention Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-02-22 09:39 -0600
          Re: Forth reinvention Bernd Paysan <bernd.paysan@gmx.de> - 2014-02-23 02:40 +0100
            Re: Forth reinvention Paul Rubin <no.email@nospam.invalid> - 2014-02-22 19:24 -0800
              Re: Forth reinvention Bernd Paysan <bernd.paysan@gmx.de> - 2014-02-23 22:48 +0100
            Re: Forth reinvention Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-02-23 04:39 -0600
              Re: Forth reinvention Bernd Paysan <bernd.paysan@gmx.de> - 2014-02-23 22:46 +0100
                Re: Forth reinvention Paul Rubin <no.email@nospam.invalid> - 2014-02-23 14:26 -0800
                Re: Forth reinvention Bernd Paysan <bernd.paysan@gmx.de> - 2014-02-24 02:44 +0100
                Re: Forth reinvention Spam@ControlQ.com - 2014-03-03 12:43 -0500
                Re: Forth reinvention Paul Rubin <no.email@nospam.invalid> - 2014-03-03 10:06 -0800
                Re: Forth reinvention Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-02-24 03:59 -0600
  Re: Forth reinvention mike73900@gmail.com - 2014-03-03 14:04 -0800
    Re: Forth reinvention mhx@iae.nl - 2014-03-05 06:59 -0800
      Re: Forth reinvention Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2014-03-05 16:33 +0100
      Re: Forth reinvention Mark Wills <markwills1970@gmail.com> - 2014-03-05 09:08 -0800
        Re: Forth reinvention mhx@iae.nl - 2014-03-05 10:47 -0800
  Re: Forth reinvention AKK <akk@nospam.org> - 2014-03-07 07:30 +0100
    Re: Forth reinvention Lars Brinkhoff <lars.spam@nocrew.org> - 2014-03-07 07:55 +0100
    Re: Forth reinvention albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-03-07 09:29 +0000
      Re: Forth reinvention AKK <akk@nospam.org> - 2014-03-07 12:04 +0100
      Re: Forth reinvention "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-03-07 17:03 -0500
        Re: Forth reinvention Mark Wills <markwills1970@gmail.com> - 2014-03-08 05:31 -0800

csiph-web