Skip to content

Commit 81eddb8

Browse files
committed
rename STYLE to HACKING
Also update a bit for the brave new Git-only world.
1 parent d27eb12 commit 81eddb8

File tree

1 file changed

+31
-24
lines changed

1 file changed

+31
-24
lines changed

Diff for: STYLE renamed to HACKING

+31-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SBCL Style Guide
1+
SBCL Hacking Guide
22

33
(This is not a most actively maintained file, but recommended
44
reading anyways.)
@@ -7,27 +7,35 @@ Patch Submissions
77
=================
88

99
Preferred patch format is output from "git format-patch", including
10-
the commit message. The commit message should explain the why and how
11-
of the change.
10+
the commit message.
1211

13-
Please include test-cases in your patch if at all possible.
12+
The commit message should explain the why and how of the change. See
13+
existing commit messages for examples -- for a truly trivial changes
14+
little is needed, but in most cases more is better.
15+
16+
Please include test-cases in your patch if at all possible: if you're
17+
not sure which file in tests/ to put your test case in, just pick one
18+
that seems vaguely appropriate.
1419

1520
Please format your submission for ease of reading: unless the change
1621
is whitespace only, avoid re-indenting code you are not touching, etc.
17-
Unless your patch is large and best understood as a series of
18-
sequential changes, please send it in as single patch file.
22+
23+
Unless your change is large and best understood as a series of
24+
sequential changes, please send it in as single patch.
1925

2026
If your patch includes algorithmic changes, explain them. If your
2127
patch uses a published algorithm, please include a link to the paper.
2228
We aren't always as well-educated as we'd like to...
2329

2430
Ready-to-apply patches should be submitted via Launchpad: please add
25-
the tag "review" to the associated bug.
31+
the tag "review" to the associated bug (create new bug with name if
32+
there isn't one about the issue yet.)
2633

2734
Patches requiring more widespread discussion and feedback should be
2835
sent to the sbcl-devel mailing list.
2936

30-
If you have any questions, feel free to ask them on sbcl-devel.
37+
If you have any questions, feel free to ask them on sbcl-devel,
38+
or the IRC channel #[email protected].
3139

3240
Coding Style
3341
============
@@ -38,12 +46,10 @@ Most of the style hints in the Lisp FAQ apply.
3846

3947
When porting code we prefer code which factors dependencies into a set
4048
of interface functions and constants and includes implementations of
41-
the interface for the different systems. Patches which require
42-
conditional compilation (like all the old
43-
#T+HPUX or #T-X86 tests in the sources inherited from CMUCL) might be
44-
accepted if they're simple, in hopes of factoring out the differences
45-
more cleanly later, but even if accepted, such code may not be
46-
maintained for very long.
49+
the interface for the different systems.
50+
51+
Reader conditionals are frowed upon. Sometimes they're the least
52+
of all evils, but think thrice.
4753

4854
grammatical fussiness:
4955
Phrases are not capitalized.
@@ -56,6 +62,7 @@ grammatical fussiness:
5662
;;; solving a system.
5763
(defvar *max-n-transformations* 10)
5864
Lisp in comments is capitalized.
65+
Symbol names are capitalized.
5966

6067
usage fussiness:
6168
Function documentation can be a description of what the function
@@ -87,6 +94,8 @@ usage fussiness:
8794
;;; When you call this function on X, you get back the first
8895
;;; prime number greater than or equal to X.
8996
(defun primify (x) ..)
97+
Documentation for public functions belongs in a docstring.
98+
Documentation for internal functions belongs mostly in a comment.
9099

91100
In general, if you can express it in the code instead of the comments,
92101
do so. E.g. the old CMUCL code has many comments above functions foo
@@ -107,20 +116,18 @@ which are not good examples to follow:
107116
instead of factoring the dependencies into interfaces and providing
108117
implementations of the interface for different architectures;
109118
* in conditional compilation, using a common subexpression over and
110-
over again, e.g. #+(OR GENGC GENCGC), when the important thing is
111-
that GENGC and GENCGC are (currently) the GCs which support scavenger
112-
hooks. If you have to do that, define a SCAVHOOK feature,
113-
write #+SCAVHOOK in many places, and arrange for the SCAVHOOK feature
114-
to be set once and only once in terms of GENGC and GENCGC. (That way
115-
future maintainers won't curse you.)
119+
over again, e.g. #+(OR X86 X86-64), when the important thing is
120+
that the platform supports single-instruction CAS. If you have to
121+
do something like that, define a new FOO feature, write #+FOO in
122+
many places, and arrange for the FOO feature to be set once and
123+
only once -- probably in make-config.sh. (That way future
124+
maintainers won't curse you.)
116125
* putting the defined symbol, and information about whether it's
117126
exported or not, into the comments around the definition of the symbol;
118127
* naming anything DO-FOO if it isn't an iteration macro
119-
* exposing a lot of high-level functionality not in the ANSI standard
120-
to the user (as discussed above)
121128
* not using a consistent abbreviation style in global names (e.g.
122129
naming some things DEFINE-FOO and other things DEF-BAR, with
123-
no rule to determine whether the abbreviation is used)
130+
no rule to determine whether the abbreviation is used).
124131
* using lots of single-colon package prefixes (distracting and hard
125132
to read, and obstacles to reaching package nirvana where
126133
package dependencies are a directed acyclic graph) or even
@@ -130,6 +137,6 @@ which are not good examples to follow:
130137
(DEFUN CL:CADDDR (..) ..) as reminders that they're required by
131138
ANSI and can't be deleted no matter how obscure and useless some
132139
of them might look.:-)
133-
Most of these are common in the code inherited from CMUCL. We've
140+
Many of these are common in the code inherited from CMUCL. We've
134141
eliminated them in some places, but there's a *lot* of code inherited
135142
from CMUCL..

0 commit comments

Comments
 (0)