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


Groups > comp.lang.forth > #48924

Re: defer this not

From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.forth
Subject Re: defer this not
Date 2016-07-07 13:32 -0700
Organization A noiseless patient Spider
Message-ID <87bn29faur.fsf@jester.gateway.pace.com> (permalink)
References <6f902b6d-b141-4a32-9848-3959eb135610@googlegroups.com> <nllg3b$rm9$1@news.luis.uni-hannover.de> <d915f08f-56dd-4d1c-94b6-60292707ef9b@googlegroups.com> <e875f01e-bfad-4516-a02f-89e63f5857ba@googlegroups.com>

Show all headers | View raw


Alex Dowad <alexinbeijing@gmail.com> writes:
>> A programmer should have the freedom to arrange his word definitions
>> in whatever order he/she wishes (within one compilation unit)...
> With some programming languages, your code is executed as it is
> read. With others.... Forth and Lisp are firmly in the first category,
> as are all the "scripting languages".  Of course, the second type also
> has its place. But trying to force Forth into the latter paradigm is a
> poor fit.

The difference isn't whether the whole file is read before execution
starts.  Rather, it's that Forth traditionally uses early binding while
Lisp and scripting languages typically use late binding.  So

  (defun cube (x) (* x (square x)))
  (defun square (x) (* x x))
  (print (cube 3))

prints 27, because when cube is compiled, it allocates a cell for the
previously unseen symbol "square", then when square is compiled it puts
code into that cell, and then when cube is called, it runs the code that
is now in the "square" cell.  The Forth approach would throw an error
in the definition of cube, because square was not already defined.

I believe late-binding Forths have also been implemented.

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


Thread

defer this not Enoch <ixew@hotmail.com> - 2016-07-06 14:21 -0700
  Re: defer this not lawrencedo99@gmail.com - 2016-07-06 18:31 -0700
    Re: defer this not hughaguilar96@gmail.com - 2016-07-06 18:45 -0700
      Re: defer this not lawrencedo99@gmail.com - 2016-07-06 19:54 -0700
        Re: defer this not hughaguilar96@gmail.com - 2016-07-06 22:53 -0700
          Re: defer this not Raimond Dragomir <raimond.dragomir@gmail.com> - 2016-07-06 23:13 -0700
            Re: defer this not Lars Brinkhoff <lars.spam@nocrew.org> - 2016-07-07 08:24 +0200
              Re: defer this not hughaguilar96@gmail.com - 2016-07-06 23:43 -0700
              Re: defer this not "Elizabeth D. Rather" <erather@forth.com> - 2016-07-06 20:52 -1000
                Re: defer this not JennyB <jennybrien@googlemail.com> - 2016-07-07 00:12 -0700
                Re: defer this not Raimond Dragomir <raimond.dragomir@gmail.com> - 2016-07-07 03:52 -0700
                Re: defer this not hughaguilar96@gmail.com - 2016-07-07 00:53 -0700
                Re: defer this not Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-07-07 10:01 +0100
                Re: defer this not Coos Haak <chforth@hccnet.nl> - 2016-07-07 12:46 +0200
                Re: defer this not hughaguilar96@gmail.com - 2016-07-07 16:19 -0700
                Re: defer this not Coos Haak <chforth@hccnet.nl> - 2016-07-08 01:39 +0200
                Re: defer this not "Elizabeth D. Rather" <erather@forth.com> - 2016-07-07 14:31 -1000
                Re: defer this not hughaguilar96@gmail.com - 2016-07-07 17:46 -0700
                Re: defer this not Brad Eckert <hwfwguy@gmail.com> - 2016-07-12 19:48 -0700
                Re: defer this not "Elizabeth D. Rather" <erather@forth.com> - 2016-07-12 20:58 -1000
                Re: defer this not hughaguilar96@gmail.com - 2016-07-07 17:41 -0700
              Re: defer this not Raimond Dragomir <raimond.dragomir@gmail.com> - 2016-07-07 00:11 -0700
                Re: defer this not Lars Brinkhoff <lars.spam@nocrew.org> - 2016-07-07 09:33 +0200
                Re: defer this not Raimond Dragomir <raimond.dragomir@gmail.com> - 2016-07-07 03:42 -0700
                Re: defer this not Lars Brinkhoff <lars.spam@nocrew.org> - 2016-07-07 20:31 +0200
                Re: defer this not "Elizabeth D. Rather" <erather@forth.com> - 2016-07-06 22:22 -1000
  defer this not JennyB <jennybrien@googlemail.com> - 2016-07-06 23:42 -0700
    Re: defer this not hughaguilar96@gmail.com - 2016-07-06 23:49 -0700
  Re: defer this not Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2016-07-07 13:59 +0200
    Re: defer this not Enoch <ixew@hotmail.com> - 2016-07-07 11:37 -0700
      Re: defer this not Julian Fondren <julian.fondren@gmail.com> - 2016-07-07 12:09 -0700
      Re: defer this not Alex Dowad <alexinbeijing@gmail.com> - 2016-07-07 13:01 -0700
        Re: defer this not Paul Rubin <no.email@nospam.invalid> - 2016-07-07 13:32 -0700
          Re: defer this not Julian Fondren <julian.fondren@gmail.com> - 2016-07-07 14:54 -0700
        Re: defer this not lawrencedo99@gmail.com - 2016-07-12 15:32 -0700

csiph-web