SPEC.md - clic - Clic is an command line interactive client for gopher written in Common LISP
HTML git clone git://bitreich.org/clic/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/clic/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
SPEC.md (2474B)
---
1 TRIVIAL-FEATURES
2 ================
3
4 This is a first *draft* of a description of what symbols should be
5 present in `CL:*FEATURES*` for various platforms. A possible future
6 direction of this documentation might be a CDR document, if it turns
7 out to be a good idea. (Making the language of this document much
8 more precise will be necessary then.)
9
10 We will start by limiting ourselves to OS, CPU and endianness features
11 on Windows and POSIX platforms.
12
13 There are various possible implementation strategies ranging from null
14 implementations (when the host Lisp already pushes the wanted feature)
15 to using FFI (e.g. calling uname() to grab system information.
16
17
18 Specification
19 -------------
20
21 ### ENDIANNESS
22
23 Either `:LITTLE-ENDIAN` or `:BIG-ENDIAN` should present in
24 `\*FEATURES\*`. For the time being, we will not concern ourselves
25 with other orderings, switchable endianness, etc.
26
27
28 ### OPERATING SYSTEM
29
30 On Windows, `:WINDOWS` should be present in `*FEATURES*`.
31
32 On POSIX systems, the "sysname" information from uname(3) should be
33 used to push the appropriate symbol to `*FEATURES*` by upcasing that
34 string (or downcasing for the "modern" lisps) and interning it in the
35 keyword package.
36
37 Examples:
38
39 - `:DARWIN`
40 - `:LINUX`
41 - `:NETBSD`
42 - `:OPENBSD`
43 - `:FREEBSD`
44
45 For convenience, `:UNIX` should be pushed when running on
46 POSIX/UNIX-like operating system (that doesn't include Windows) and
47 `:BSD` should be present when running on BSD-based systems (that
48 includes Darwin)
49
50 [add `:MACH` too?]
51
52
53 ### CPU
54
55 These features should be mutually exclusive:
56
57 - `:X86`
58 - `:X86-64`
59 - `:PPC`
60 - `:PPC64`
61 - `:MIPS`
62 - `:ALPHA`
63 - `:SPARC`
64 - `:SPARC64`
65 - `:HPPA`
66 - `:HPPA64`
67
68 [add more ...]
69
70 [note: it's debatable whether `:X86` shouldn't also be exported on
71 x86-64, and `:PPC` on ppc64. SBCL doesn't. Other ways
72 to handle, for example, the x86/x86-64 case would be to export
73 something like `:PC386` in both cases or have an additional `:X86-32`. Or
74 finally, have just `:X86`, `:PPC`, etc, and add `:32-BIT-CPU` and
75 `:64-BIT-CPU` features.]
76
77 ### Register Size
78 These features denote the size of a register on the CPU and are mutually exclusive.
79
80 - `:64-bit`
81 - `:32-bit`
82
83
84 Unreferenced References
85 -----------------------
86
87 * [CLHS: Variable \*FEATURES\*][1]
88 * [Maintaining Portable Lisp Programs][2], by Christophe Rhodes
89
90
91 [1]: http://www.lispworks.com/documentation/HyperSpec/Body/v_featur.htm
92 [2]: http://www-jcsu.jesus.cam.ac.uk/~csr21/papers/features.pdf