guile-devel
[Top][All Lists]
Advanced

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

restricting functions to only accept string parameters


From: Dirk Herrmann
Subject: restricting functions to only accept string parameters
Date: Fri, 27 Oct 2000 18:44:18 +0200 (MEST)

Hello everybody.

I'd like to get your OK for a couple of changes I'd like to commit.  The
problem with these is, that they will make certain function accept strings
only - in contrast to accepting strings and symbols, as they do now.  For
some of these functions this can be seen as a bug fix:  string->number for
example should never have worked on symbols, and someone relying on this
bug could also have relied on (+ 1 1) --> 3 if the number system ever had
shown such a behaviour :-)  However, there are other functions which also
up to now have accepted strings and symbols.

The changelog is below, I can, if approved, immediately commit the
changes.  The basic intention, btw, is to prepare guile such that
providing alternative implementations for strings, symbols and other types
will become easier, such that we can for example much easier switch guile
to a string/symbol implementation where substrings are shared implicitly
using a copy-on-write strategy.

The list of functions that would be involved:

        * dynl.c (scm_dynamic_link, scm_dynamic_func, scm_dynamic_call,
        scm_dynamic_args_call), filesys.c (scm_chown, scm_chmod,
        scm_open_fdes, scm_stat, scm_link, scm_rename, scm_delete_file,
        scm_mkdir, scm_rmdir, scm_opendir, scm_chdir, scm_symlink,
        scm_readlink, scm_lstat, scm_copy_file), fports.c (scm_open_file),
        ioext.c (scm_read_delimited_x, scm_fdopen), load.c
        (scm_primitive_load, scm_parse_path, scm_search_path,
        scm_sys_search_load_path, scm_primitive_load_path), net_db.c
        (scm_inet_aton, scm_gethost, scm_getnet, scm_getproto,
        scm_getserv), numbers.c (scm_string_to_number), ports.c
        (scm_truncate_file, scm_sys_make_void_port), posix.c
        (scm_getpwuid, scm_getgrgid, scm_execl, scm_execlp,
        environ_list_to_c, scm_execle, scm_utime, scm_access,
        scm_setlocale, scm_mknod), regex-posix.c (scm_make_regexp),
        simpos.c (scm_system, scm_getenv), socket.c (scm_fill_sockaddr,
        scm_send, scm_sendto), stime.c (scm_strftime, scm_strptime),
        strop.c (scm_i_index, scm_string_null_p, scm_string_to_list),
        strports.c (scm_mkstrport), symbols.c
        (scm_string_to_obarray_symbol), vports.c (scm_make_soft_port):
        Don't accept symbols as input parameters.  Use SCM_STRING_LENGTH
        instead of SCM_ROLENGTH.

        * error (scm_error_scm):  Don't accept symbols as input parameters
        for function name and message.  Fix substring handling bug.

        * symbols.h (SCM_LENGTH, SCM_ROLENGTH, SCM_SUBSTRP,
        SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, SCM_COERCE_SUBSTR):
        Deprecated.

        * unif.h (SCM_HUGE_LENGTH):  Deprecated.

        * validate.h (SCM_VALIDATE_ROSTRING, SCM_VALIDATE_ROSTRING_COPY,
        SCM_VALIDATE_NULLORROSTRING_COPY):  Deprecated.

So, please, tell me whether this change is allright, or for which
functions you think that symbols as input parameters would make sense.

Best regards
Dirk




reply via email to

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