New edition of "Programming Forth" by Pelc (July 2016)

Topics relating to various Forth models on the 6502, 65816, and related microprocessors and microcontrollers.
dwight
Posts: 213
Joined: 08 Jun 2004

Re: New edition of "Programming Forth" by Pelc (July 2016)

Post by dwight »

To take things in a different direction, in Forth, I often put 3 or 4
Forth words on a single line.
I don't do it to compact the code but to make the code more readable.
Often strings of Forth words are almost sentences.
How do others feel about this?
I've gotten away from the one words, followed by a usually useless comment.
Dwight
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: New edition of "Programming Forth" by Pelc (July 2016)

Post by GARTHWILSON »

dwight wrote:
To take things in a different direction, in Forth, I often put 3 or 4
Forth words on a single line.
I don't do it to compact the code but to make the code more readable.
Visual factoring is very valuable.
Quote:
Often strings of Forth words are almost sentences.
I've had some that truly are sentences, like

Code: Select all

   TURN ON #4 LED
where TURN is a flag variable, ON sets it to true, #4 is a constant's name and it puts the LED number on the stack, and LED does the job. English does not operate in RPN like Korean does though, so in most cases the code won't sound very English-like, which is fine with me. It can still be Forth sentences.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
scotws
Posts: 576
Joined: 07 Jan 2013
Location: Just outside Berlin, Germany
Contact:

Re: New edition of "Programming Forth" by Pelc (July 2016)

Post by scotws »

GARTHWILSON wrote:
Does it just overwrite your comments?
No, it doesn't touch them - I put that in by hand so people here don't have to figure out what lda.di does. Seemed like the polite thing to do until you've all switched to Typist's Notation as well :D .
Bregalad
Posts: 149
Joined: 27 Mar 2010
Location: Chexbres, VD, Switzerland
Contact:

Re: New edition of "Programming Forth" by Pelc (July 2016)

Post by Bregalad »

Looks great, is there a way to get this book in Switzerland ?
Post Reply