Enviroment inquiry: inquiring about that too John Cowan (17 May 2013 18:11 UTC)
Re: Enviroment inquiry: inquiring about that too David Banks (18 May 2013 17:50 UTC)
Re: Enviroment inquiry: inquiring about that too John Cowan (18 May 2013 20:25 UTC)

Re: Enviroment inquiry: inquiring about that too John Cowan 18 May 2013 20:24 UTC

David Banks scripsit:

> Looks good.  I think it might be worth giving non-normative examples
> of output for the various procedures.  This shouldn't be construed as
> providing some kind of canonical list of OS types (for instance), but
> it's not a lot of use if Rhinoceros Scheme returns "Windows" as a
> result of (os-type) and Diplodocus Scheme returns "win32".   Even just
> specifying "windows", "linux", "macosx" as potentially valid results
> for OS-TYPE will improve the usefulness of the SRFI a lot.  i.e.
> there's still scope for implementors to break this convention, but if
> they don't need to then so much the better.

If you want to know if you are on Windows, you should either say

(cond-expand
  (windows <code-for-windows>)
  (else <code-for-non-windows>))

or if you need to know at run time, (memq 'windows (features)).  These are
already part of R7RS-small.  Conditionalizing on the result of (os-type)
is therefore unnecessary, and it is free to return whatever result makes
sense to the implementor, whether "Windows" or "Win32" or "Microsoftâ„¢
Windowsâ„¢".

> Providing example output would also increase the usefulness of the
> SRFI as a reference for users, for instance I currently have no idea
> what a likely result of (c-memory-model) would look like (except that
> it can be #f).

See Appendix B of R7RS-small.  Semi-standard features
corresponding to this are ilp32, lp64, and ilp64.  See
<http://www.unix.org/version2/whatsnew/lp64_wp.html> for explanations,
though the terms apply to Windows too.

> http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/uname.cc?rev=1.30.10.1&content-type=text/x-cvsweb-markup&cvsroot=src

Thanks.

--
John Cowan  http://ccil.org/~cowan    xxxxxx@ccil.org
There are books that are at once excellent and boring.  Those that at
once leap to the mind are Thoreau's Walden, Emerson's Essays, George
Eliot's Adam Bede, and Landor's Dialogues.  --Somerset Maugham