Andy Wingo <wi...@pobox.com> skribis: > On Sat 21 Jun 2014 23:49, l...@gnu.org (Ludovic Courtès) writes: > >> The ‘getrlimit’ and ‘setrlimit’ procedures are not documented in the >> manual. They’re supposed to be passed a symbol or a number: >> >> (getrlimit 'nofile) == (getrlimit 7) ≍ getrlimit (RLIMIT_NOFILE, &lim) >> >> For most other POSIX functions with a similar interface, we instead >> define Scheme variables with the same name as in C (like >> ‘RLIMIT_NOFILE’) and these are then passed directly to the procedure. >> >> Here’s a proposal: define RLIMIT_* Scheme variables, document >> ‘getrlimit’ and ‘setrlimit’ to accept those, and emit a deprecation >> warning when the symbol is used. >> >> WDYT? > > Do you think the usual Guile strategy is a good one? I find that all > the constants in the default namespace are a bit distracting. They do > allow discovery of (some of the) available enumerated values, but they > don't limit the enumerated values in any way. You still have to check > in the implementation that the value given is a valid value. Dunno.
I think in an ideal world we’d use real enumerated value constructs instead of defining all these variables. But I think that (1) there’s value in exposing the raw syscall API, and (2) “it’s too late to change.” So here I would value consistency over elegance. > Andy, who apparently only processes mail during solstice weeks :P :-) Thanks! Ludo’.