[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SRFI-4's `scm_take_TAGvector ()'
From: |
Ludovic Courtès |
Subject: |
SRFI-4's `scm_take_TAGvector ()' |
Date: |
Wed, 17 Aug 2005 16:16:59 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Hi,
While the name of the `scm_take_TAGvector ()' function is pretty good at
suggesting that it will take control over the data pointed to by the
first argument, I find the prototype of these functions quite
misleading. IMO, instead of:
SCM scm_take_u8vector (const scm_t_uint8 *data, size_t len);
this should be:
SCM scm_take_u8vector (scm_t_uint8 *data, size_t len);
Removing the `const' qualifier provides additional semantic information
to the compiler that could help detect misuses of these functions. For
example, a warning would be issued for a call like:
scm_take_u8vector ("hello", 6);
What do you think?
Thanks,
Ludovic.
- SRFI-4's `scm_take_TAGvector ()',
Ludovic Courtès <=