[uim-commit] r2080 - in branches/r5rs/sigscheme: . doc
yamaken at freedesktop.org
yamaken at freedesktop.org
Tue Nov 8 04:52:05 PST 2005
Author: yamaken
Date: 2005-11-08 04:52:01 -0800 (Tue, 08 Nov 2005)
New Revision: 2080
Added:
branches/r5rs/sigscheme/doc/
branches/r5rs/sigscheme/doc/style
Log:
* sigscheme/doc
- New directory
* sigscheme/doc/style
- New file
- Describe "Macro definition"
Added: branches/r5rs/sigscheme/doc/style
===================================================================
--- branches/r5rs/sigscheme/doc/style 2005-11-08 11:05:33 UTC (rev 2079)
+++ branches/r5rs/sigscheme/doc/style 2005-11-08 12:52:01 UTC (rev 2080)
@@ -0,0 +1,22 @@
+Coding style
+
+* Macro definition
+
+ Any argument should be wrapped into () or [] if no exceptional reason exist,
+ to prevent unintended operator associations.
+
+ #define SCM_CONS_SET_CAR(a, car) (SCM_CAR(a) = (car))
+
+ And ultra-cowardively, passing an argument to another function or macro is
+ should also be wrapped as follows.
+
+ #define SCM_CONS(kar, kdr) (Scm_NewCons((kar), (kdr)))
+
+ This is intended to endure unconditional safety against rare-cases such as
+ follows.
+
+ #define FOO assert(), get_foo()
+ #define MAKE_LIST2(x, y) make_list(x, y)
+
+ MAKE_LIST2(FOO, SCM_FALSE);
+ /* => make_list(assert(), get_foo(), SCM_FALSE) */
More information about the uim-commit
mailing list