Re: [OT] PostLisp, a language experiment

From: Paul E. Bennett (peb_at_amleth.demon.co.uk)
Date: 03/12/05

  • Next message: Trent Buck: "Re: |SYMBOL| vs 'SYMBOL"
    Date: Sat, 12 Mar 2005 13:48:06 +0000
    
    

    Duane Rettig wrote:

    >> >>But the reality is that experienced Forth programmers have very little
    >> >>trouble here. Write short definitions, document stack effect, test
    >> >>bottom up.
    >> > Right. What if I wanted to write longer definitions?
    >>
    >>
    >> Why, to make your code unreadable?
    >
    > I guess it depends on your definition of short. But if your language
    > doesn't allow you to write a definition that is longer than normal,
    > without the code becoming unreadable, then that is one mark against
    > your language.

    Why would anyone want to write longer definitions than is absolutely
    necessary.

    Take for example the cliche DUP *

    This gives you the square of the number at TOS. In certain applications it
    might be used a large number of times in different definitions. Hence we
    might define:-

    : SQUARED (S n -- n^2)
    (G n^2 is the resultant of the number n multiplied by itself. )
    ( Limitations: the number n can be no larger than the square )
    ( root of an n^2 which occupies all the bits of a cell).
       DUP * ;

    There is very little cost in doing this as the call structure of Forth was
    built in at a very fundamental level and is in common enough usage that
    this was the first part of Forth to be considered for opitimisation on any
    real machine. Would you have it that we should just include the DUP *
    cliche instead of defining and using SQUARED. How much longer does it need
    to be?

    -- 
    ********************************************************************
    Paul E. Bennett ....................<email://peb@amleth.demon.co.uk>
    Forth based HIDECS Consultancy .....<http://www.amleth.demon.co.uk/>
    Mob: +44 (0)7811-639972
    Tel: +44 (0)1235-811095
    Going Forth Safely ....EBA. http://www.electric-boat-association.org.uk/
    ********************************************************************
    

  • Next message: Trent Buck: "Re: |SYMBOL| vs 'SYMBOL"

    Relevant Pages

    • Re: Chess Bitch
      ... > Maybe such language is ... > used in the square, and maybe by the 30-year-old women in the square, most ... > of whom, if anything, are even less well-educated than Ms. Shahade. ... > frequently are dismissed for indulging in gender-based hate speech and/or ...
      (rec.games.chess.misc)
    • Re: maximize dos window
      ... I am creating a magic square game...it consists of several ... Each sentence in the English language should begin with a capital letter and end with exactly one punctuation mark. ... The issue you describe is not just operating system dependent, but is more a question about your platform's API than about the C++ language. ... have an appropriate newsgroups line in your header for your mail to be seen, ...
      (comp.lang.c.moderated)
    • Re: Weird problem with special characters in filename
      ... > merely formalises the language we use so you can ... >> I'm talking English, ... > completing the square - forever adding a little bit more on to the side ... > reasoning how to do it, although I did not know that I could do it ...
      (comp.os.linux.misc)
    • Re: Lisp popularity
      ... So if Language A and B are related, ... and Language A has 100 hits and language B has 90 hits, ... Lisp category. ... Duane Rettig duane@xxxxxxxxx Franz Inc. http://www.franz.com/ ...
      (comp.lang.lisp)
    • Re: Commutativity of operator []
      ... I seem it more as a "by-product" of how the C language handles the square ... brackets operator. ...
      (comp.lang.c)