January 16, 2010 10:36:47 PM
dherring
The website (and tarballs?) should collect common portability gotchas.
A few to start with:
- Don't use #+nil; there are reasonable ways to get :nil in *features*. Use #-(and) or #+(or) instead.
- Encode source files in ASCII or UTF-8 (i.e. not Latin-1).
- Don't use a LOOP variable-clause after a main-clause (e.g. FOR after WHILE); it isn't portable (e.g. ECL).
- Use TYPE in compound declarations. Example: (declare (type (array * (2)) x)) not (declare ((array * (2)) x))
- Be sensitive of implementations where 'x is lowercase and 'X is uppercase. Use symbols instead of strings.
- The third argument to DEFINE-MODIFY-MACRO is a symbol, not a lambda expression.
A few to start with:
- Don't use #+nil; there are reasonable ways to get :nil in *features*. Use #-(and) or #+(or) instead.
- Encode source files in ASCII or UTF-8 (i.e. not Latin-1).
- Don't use a LOOP variable-clause after a main-clause (e.g. FOR after WHILE); it isn't portable (e.g. ECL).
- Use TYPE in compound declarations. Example: (declare (type (array * (2)) x)) not (declare ((array * (2)) x))
- Be sensitive of implementations where 'x is lowercase and 'X is uppercase. Use symbols instead of strings.
- The third argument to DEFINE-MODIFY-MACRO is a symbol, not a lambda expression.
February 26, 2010 09:01:43 PM
dherring
New note: don't forget to (:use) in a defpackage that should import nothing. If not specified, an implementation-specific default can be imported (often including nonstandard stuff). Re-occuring issue; just hit ASDF.
April 8, 2010 12:48:05 AM
dherring
not all numeric types can be specialized in generic functions
Syndicate