[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: different procedures for different functions

This page is part of the web mail archives of SRFI 98 from before July 7th, 2015. The new archives for SRFI 98 contain all messages, not just those from before July 7th, 2015.



higepon wrote at 07/06/2008 05:51 AM:
How about following names?
(getenv) and (environ)

     or

(getenv) and (environ->alist)	

The difficulty I'm having with good names for these procedures is that "environment" and "variable" both have special meaning in Scheme, and indeed are central to it.

And, as a general language rather than a Unix scripting language, I would argue that Posix environment variables are not important enough that should claim the identifier "environ".

One reasonable concession to the scripting people, in my opinion, would be to use "getenv" for the function of getting a particular environment variable, and to have a more long-winded name for getting an alist of all environment variables.

The extreme would be something like:

   get-host-process-environment-variable-value
   get-alist-of-host-process-environment-variable-names-and-values

Referring to Posix would disambiguate "environment", so we could do:

   posix-environment-value
   posix-environment-map

   posix-value
   posix-environment

Or, as long as we're saying "posix", we can just use the Posix names (I'm not sure all these are strictly Posix):

   posix-getenv
   posix-environ
   posix-putenv
   posix-setenv
   posix-unsetenv

Some Scheme implementations or libraries might provide the full fleet of Posix identifiers without qualifying their names with "posix-" or "posix:", for use by people using Scheme for Unix systems programming or shell scripting. However, for the default names that we'd like Scheme implementations and programmers to use, I think that names that don't stomp on the term "environment" (nor "variable" nor "value") would be best.

--
http://www.neilvandyke.org/