Man Linux: Main Page and Category List

NAME

          s9e - Extended Scheme Interpreter

USAGE

          s9e [-h?] [-gnqv] [-m size[m]] [-f program] [-d image] [-i]
              [-- argument ...]

DESCRIPTION

          Scheme  9  from  Empty  Space  is an interpreter for a broad
          subset of R4RS Scheme. The s9e command starts  the  extended
          interpreter. The extended interpreter defines some functions
          that are not defined in the Scheme Reports,  but  may  prove
          useful in ‘‘real-world’’ programming.

EXTENDED PRIMITIVE FUNCTIONS


          Do  not  use  these  primitives directly. Use the user-level
          procedures outlined in the next section instead.

          Procedures  typically  indicate  failure  by  returning  #f.
          Procedures that would not otherwise return a more meaningful
          value return #t in case of success. When a procedure  fails,
          the  resulting Unix error number can be retrieved by calling
          unix:errno (or errno).

          (unix:chdir string) ==> boolean
              Change the current working directory to string.
          (unix:chmod string integer) ==> boolean
              Change the access bits of the file string  to  the  mode
              integer.
          (unix:chown string integer1 integer2) ==> boolean
              Change  the  ownership  for  the  file string to user ID
              integer1 and the group ID integer2.
          (unix:command-line) ==> list of string
              Return the command line arguments passed  to  s9e  after
              the "--" argument.
          (unix:errno) ==> integer
              Return  the  Unix  error  code  set by the most recently
              failed call to a unix extension procedure.
          (unix:exit integer) ==> undefined
              Terminate the s9e process and return integer as an  exit
              code to the calling process.
          (unix:flush output-port) ==> boolean
              Flush the given output port.
          (unix:getcwd) ==> string
              Return the current working directory.
          (unix:getenv string) ==> string
              Return the value of the environment variable string.  If
              the variable is undefined, return #f.
          (unix:getgid) ==> integer
              Return the group ID of the s9e process.
          (unix:getgrnam string) ==> alist
              Return the group record for the group name string.   The
              returned association list has the following members:
              ((name . string)    ; group name
               (gid  . integer))  ; group ID
          (unix:getgrgid integer) ==> alist
              Return  the  group record for the group ID integer.  See
              unix:getgrnam for the structure of the return value.
          (unix:getpwent) ==> list
              Return a list of all users of the system.
          (unix:getpwnam string) ==> alist
              Return the password record for  the  user  name  string.
              The returned association list has the following members:
              ((name  . string)   ; user name
               (uid   . integer)  ; user ID
               (gid   . integer)  ; group ID
               (gecos . string)   ; real name
               (home  . string)   ; home directory
               (shell . string))  ; default shell
          (unix:getpwuid integer) ==> alist
              Return the password record for the user ID integer.  See
              unix:getpwnam for the structure of the return value.
          (unix:getuid) ==> integer
              Return the user ID of the s9e process.
          (unix:link string1 string2) ==> boolean
              Create  a  (hard)  link  string2 that refers to the same
              file as string1.
          (unix:lock string) ==> boolean
              Create a lock file named ‘‘string.lock’’.  If  the  file
              already  exists  when the function is called, return #f,
              else return #t.  Unix:lock uses mkdir()  to  create  the
              lock file, which is atomic on virtually all systems.
          (unix:mkdir string integer) ==> boolean
              Create directory string with mode integer.
          (unix:readdir string) ==> string
              Return  a  list  of  all  file  names  contained  in the
              directory string.  When the  given  directory  does  not
              exist, return #f.
          (unix:readlink string) ==> string
              Return the destination of the symbolic link string.
          (unix:rmdir string) ==> boolean
              Remove directory string.
          (unix:spawn string) ==> (input-port output-port)
              Spawn  an  inferior  process running the command string.
              Return a list of two file descriptors  where  the  first
              one  can  be  used to read the output of the command and
              the second one to send input to the command. The command
              will be executed using
              execl("/bin/sh", "/bin/sh", "-c", string, NULL);
          (unix:stat string) ==> alist
              Return the file status of the file string.  The returned
              association list has the following members:
              ((name  . string)    ; file name
               (size  . integer)   ; size in bytes
               (uid   . integer)   ; UID of owner
               (gid   . integer)   ; GID of owner
               (mode  . integer)   ; access bits
               (ctime . integer)   ; inode change time
               (atime . integer)   ; access time
               (mtime . integer)   ; modification time
               (dev   . integer)   ; device ID of containing device
               (ino   . integer)   ; inode number
               (nlink . integer))  ; number of (hard) links
          (unix:symlink string1 string2) ==> boolean
              Create a symbolic link string2 that points to  the  path
              string1.
          (unix:system string) ==> boolean
              Run  the  command  string and return its exit status (#t
              for success and #f for failure).
          (unix:time) ==> integer
              Returns the number of seconds since the Unix epoch.
          (unix:unlink string) ==> boolean
              Remove the file name string.
          (unix:unlock string) ==> unspecific
              Remove the file ‘‘string.lock’’. If the files  does  not
              exist, do nothing.
          (unix:utimes string) ==> boolean
              Set  the access and modification time of the file string
              to the current time.

USER-LEVEL FUNCTIONS


          Use these instead of the above primitives.

          (chdir string) ==> boolean
              See unix:chdir.

          (chmod string1 integer|string2) ==> boolean
              Change the mode  of  the  file  string1  to  integer  or
              string2.   When  an  integer  mode is specified, use its
              numeric value. A string mode must  either  represent  an
              octal mode or have the format

              user+bits or user-bits

              where  user  is  any  combination  of  the  letters  ugo
              (denoting user, group, and  others),  and  bits  is  any
              combinations  of  the letters rwx (denoting read, write,
              and execute permission, respectively). The letter a  may
              be used to abbreviate ugo.  For example,

              (chmod "a+rw" "file")

              will  add  read  and  write  permission to file. Using a
              minus sign instead of a plus sign will remove the  given
              permissions.

          (chown string integer1|string1|#f integer2|string2|#f)
          ==> boolean
              Change  the owning user of the file string to string1 or
              integer1 and the owning group of the file to string2  or
              integer2.   Numeric  values  will be interpreted as user
              IDs and strings  will  be  interpreted  as  user  names.
              Replacing either the user or the group part with #f will
              leave that part unchanged. For instance,

              (chown #f "wheel" "file")

              will change the group of file to wheel,  but  leave  its
              user unchanged.
          (command-line) ==> list of string
              See unix:command-line.

          (errno) ==> integer
              See unix:errno.

          (exit integer) ==>
              See   unix:exit.   However,  the  argument  of  exit  is
              optional and a return value of 0 is the default.

          (flush output-port) ==> boolean
              See unix:flush.

          (format-time string time-list) ==> string | #f
              Format   a   time   specification   as    returned    by
              unix-time->time  according to the description in string.
              This a poor man’s  Common  LISP  format-style  procedure
              intended for making time lists more readable. It returns
              #f if time-list is not a proper time list or  string  is
              erroneous (i.e.: contains a wrong format descriptor).

              The following format descriptors are supported:
              ~w   day of week (Mon, Tue, ...)
              ~y   year
              ~:m  number of month
              ~@m  month name (Jan, Feb, ...)
              ~h   hour
              ~m   minute
              ~s   second
              ~~   literal ~

              When  a single digit appears between a ~ and the rest of
              a format descriptor, this digit will be interpreted as a
              length  and  the resulting string will be padded to this
              length with zeros.

              Example:
              (format-time "~w ~4y-~@m-~2d ~2h:~2m:~2s"
                           ’(1 2009 3 9 8 53 20))
                ==> "Tue 2009-Apr-09 08:53:20"

          (getcwd) ==> string
              See unix:getcwd.

          (getenv string) ==> string
              See unix:getenv.

          (getgid) ==> integer
              See unix:getgid.

          (getgrnam string) ==> alist
              See unix:getgrnam.

          (getgrgid integer) ==> alist
              See unix:getgrgid.
          (getpwent) ==> list
              See unix:getpwent.

          (getpwnam string) ==> alist
              See unix:getpwnam.

          (getpwuid integer) ==> alist
              See unix:getpwuid.

          (getuid) ==> integer
              See unix:getuid.

          (group-name string|integer) ==> string
              Return the group name for the group string or the  group
              ID integer.  (Yes, getting a group name for a group name
              is an identity operation.)

          (group-gid string|integer) ==> string
              Return the group ID for the group string or the group ID
              integer.   (Yes, getting a group ID for a group ID is an
              identity operation.)

          (link string1 string2) ==> boolean
              See unix:link.

          (lock string) ==> boolean
              See unix:lock.

          (mkdir string integer) ==> boolean
              See unix:mkdir.

          (readdir string) ==> list
              See unix:readdir.

          (readlink string) ==> string
              See unix:readlink.

          (rmdir string) ==> boolean
              See unix:rmdir.

          (spawn string) ==> (input-port output-port)
              See unix:spawn.

          (stat string) ==> alist
              See unix:stat.

          (stat-name string) ==> string
              Return the file name of the file string.

          (stat-size string) ==> integer
              Return the size of the file string.

          (stat-uid string) ==> integer
              Return the UID of the owner of the file string.

          (stat-gid string) ==> integer
              Return the GID of the owning group of the file string.
          (stat-mode string) ==> integer
              Return the permission bits of the file string.

          (stat-ctime string) ==> integer
              Return the inode change time of the file string.

          (stat-atime string) ==> integer
              Return the access time of the file string.

          (stat-mtime string) ==> integer
              Return the modification time of the file string.

          (stat-dev string) ==> integer
              Return the device ID of the device  on  which  the  file
              string resides.

          (stat-ino string) ==> integer
              Return the inode number of the file string.

          (stat-nlink  string) ==> integer
              Return the link count of the file string.

          (symlink string1 string2) ==> boolean
              See unix:symlink.

          (system string) ==> boolean
              See unix:system.

          (time) ==> integer
              See unix:time.

          (time->unix-time time-list) ==> integer | #f
              Convert  a  time list as described in unix-time->time to
              the number of seconds since the Unix epoch. Return #f if
              time-list is not a proper time list.

          (unix-time->time integer) ==> time-list
              Convert the number of seconds since the Unix epoch given
              as the integer argument to a more useful representation:

              (weekday  ; 0..6 where 0 = Monday
               year     ; 1970..2038
               month    ; 1..12
               day      ; 1..31, depends on month
               hour     ; 0..23
               minute   ; 0..60
               second)  ; 0..60

          (unlink string) ==> boolean
              See unix:unlink.

          (unlock string) ==> unspecific
              See unix:unlock.

          (user-name integer|string) ==> string
              Return  the user name for the user string or the user ID
              integer.  (Yes, getting a user name for a user  name  is
              an identity operation.)

          (user-uid integer|string) ==> integer
              Return  the  user  ID for the user string or the user ID
              integer.  (Yes, getting a user ID for a user  ID  is  an
              identity operation.)

          (user-gid integer|string) ==> integer
              Return  the  group ID for the user string or the user ID
              integer.

          (user-gecos integer|string) ==> string
              Return the GECOS information (full name)  for  the  user
              string or the user ID integer.

          (user-home integer|string) ==> string
              Return  the  home  directory  for the user string or the
              user ID integer.

          (user-shell integer|string) ==> string
              Return the login shell for the user string or  the  user
              ID integer.

          (utimes string) ==> boolean
              See unix:utimes.

SEE ALSO

          s9(1)

AUTHOR

          Nils M Holm <nmh@t3x.org>