1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
//! # PSPP in Rust
//!
//! PSPP is a program for statistical analysis of sampled data. It is
//! a free replacement for the proprietary program SPSS.
//!
//! This is an experimental rewrite of PSPP in Rust. It includes both programs
//! directly useful to users and a library that can be used by other software.
//! The goal of the rewrite is to ensure that PSPP can be as robust as possible,
//! while remaining fast and portable.
//!
//! This new version is very incomplete--in fact, only a subset of the
//! `pspp-convert` utility is really ready for use.
//!
//! ## Installing PSPP
//!
//! To install PSPP in Rust from source, [install Rust], version 1.88 or later.
//! Then, either:
//!
//! - Use the following command to download PSPP source code from `crates.io`
//! and build and install it:
//!
//! ```text
//! cargo install pspp
//! ```
//!
//! - Clone a local copy of this repository and build and install it from there,
//! with: can instead `cd` into `rust/pspp` in the source tree and run:
//!
//! ```text
//! git clone git://git.sv.gnu.org/pspp
//! cd pspp/rust/pspp
//! cargo install --path .
//! ```
//!
//! The above commands also work for upgrades.
//!
//! [install Rust]: https://www.rust-lang.org/tools/install
//!
//! ### Uninstalling
//!
//! To uninstall PSPP, run:
//!
//! ```text
//! cargo uninstall pspp
//! ```
//!
//! ## Running PSPP
//!
//! After installing PSPP using one of the methods above, run it with:
//!
//! ```text
//! pspp
//! ```
//!
//! For help, use `pspp --help`. The only really useful PSPP commands
//! currently are `convert` and `show`. Help for individual commands is
//! available with `pspp <command> --help`.
//!
//! ## Reading the manual
//!
//! The PSPP manual may be [read online].
//!
//! To build the manual, install [mdBook] using its [instructions] then, from
//! the root of a checked-out copy of this repository, build the manual with:
//!
//! ```text
//! (cd rust/doc && mdbook build)
//! ```
//!
//! This will output the manual as HTML under `rust/doc/book/html`.
//!
//! [read online]: https://pspp.benpfaff.org/manual
//! [mdBook]: https://rust-lang.github.io/mdBook/
//! [instructions]: https://rust-lang.github.io/mdBook/guide/installation.html
//!
//! ## Reporting bugs
//!
//! As this is an experiment, please don't have high expectations (yet).
//! However, questions and comments about using PSPP may be sent to
//! <pspp-users@gnu.org>. Please email bug reports to <bug-gnu-pspp@gnu.org> or
//! file them online at [Savannah]. Please indicate that you are referring to
//! the Rust rewrite.
//!
//! [Savannah]: https://savannah.gnu.org/bugs/?group=pspp
//!
//! # License
//!
//! Copyright © 2025 Free Software Foundation, Inc.
//!
//! This program is free software: you can redistribute it and/or modify it under
//! the terms of the [GNU General Public License] as published by the Free Software
//! Foundation, either version 3 of the License, or (at your option) any later
//! version.
//!
//! This program is distributed in the hope that it will be useful, but WITHOUT
//! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
//! FOR A PARTICULAR PURPOSE. See the [GNU General Public License] for more
//! details.
//!
//! [GNU General Public License]: http://www.gnu.org/licenses/
use Range;
/// This is [slice::element_offset] copied out from the standard library so that
/// we can use it while it is still experimental.
pub
/// This is [slice::subslice_range] copied out from the standard library so that
/// we can use it while it is still experimental.
pub
/// This is [slice::range] copied out from the standard library so that we can
/// use it while it is still experimental.
pub
/// This is [slice::try_range] copied out from the standard library so that we
/// can use it while it is still experimental.
pub