guile-devel
[Top][All Lists]
Advanced

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

More functions accepting strings and symbols


From: Dirk Herrmann
Subject: More functions accepting strings and symbols
Date: Wed, 11 Oct 2000 19:29:29 +0200 (MEST)

Hello.

Due to the (mis?)use of SCM_ROSTRINGP and SCM_VALIDATE_ROSTRING, the
following functions accept symbol arguments as well as strings:

system, getenv, inet-aton, gethost, getnet, getproto, getserv,
scm_i_index, string-null?, string->list, make-regexp, open-file, getpw,
getgr, execl, execlp, execle, environ, utime, access?, setlocale, mknod,
string=?, string-ci=?, string<?, string-ci<?, make-soft-port,
primitive-load, parse-path, search-path, %search-load-path,
primitive-load-path, chown, chmod, open-fdes, stat, link, rename-file,
delete-file, mkdir, rmdir, opendir, chdir, symlink, readlink, lstat,
copy-file, scm_mkstrport, dynamic-call, dynamic-args-call,
%read-delimited!, fdopen, string->obarray-symbol, strftime, strptime,
string->number, connect, bind, send, sendto, truncate-file,
%make-void-port, scm_display_error_message, display_expression,
display_error_body.

For some of these it is just obvious that only either strings or symbols
should be accepted as input.  For many others the corresponding comments
just talk of 'string' arguments and don't mention the possibility to also
pass symbols.

Up to now this has not been a big deal, since strings and symbols were
represented similarly.  However, as I am currently trying to make accesses
to different types more explicit in the code (by for example splitting
SCM_LENGTH into SCM_STRING_LENGTH, SCM_SYMBOL_LENGTH and so on), it
becomes obvious that there are some functions which are not very explicit
about their inputs.  I suggest to restrict the accepted input parameter
types to strings in most of the cases.

Best regards
Dirk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]