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