-
Notifications
You must be signed in to change notification settings - Fork 104
Style Guide
Phil Burk edited this page Dec 31, 2016
·
8 revisions
This guide is a work in progress. I welcome input from other developers.
PForth currently has very inconsistent style. I would like to have a consistent style for new additions. And I may apply the new style to old code.
Indentation - 4 spaces, no tabs, no trailing spaces
- Capitalize new words when they are defined.
- Capitalize conditional words, eg. IF ELSE THEN WHILE REPEAT etc.
- Lower case for other words, eg. dup swap etc.
- Align conditionals.
For example:
: NEW.WORD ( x y -- , do something interesting )
2dup =
IF +
ELSE *
THEN
;