added append docs from R4RS.
* strings.c: Docstring typo fix, + eliminate unneeded IMP tests.
Thanks Dirk Hermann!
* chars.h: Provide SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR and
deprecate SCM_ICHRP, SCM_ICHR, SCM_MAKICHR. Thanks Dirk Hermann!
* *.h, *.c: Use SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR throughout.
Drop use of SCM_P for function prototypes... assume an ANSI C
compiler. Thanks Dirk Hermann!
SCM_VALIDATE_LONG_COPY
* numbers.c: Use SCM_VALIDATE_ULONG_COPY, instead of
SCM_VALIDATE_INUM_COPY to let bigger numbers be used. Rename a
couple of formal arguments (and fix their uses) to make arguments
match the documentation.
SCM_OUT_OF_RANGE use SCM_MAKINUM, not scm_long2num. Added
SCM_COERCE_ROSTRING macro. Added SCM_VALIDATE_NONEMPTYLIST
macro. Fix SCM_VALIDATE_STRINGORSUBSTR macro to not use SLOPPY
variants.
* ports.c (scm_port_closed_p): Validate that the arg is a PORT,
then return whether it's an open port (was validating that it was
an open port -- this was a bug I introduced back in December, but
my careful reading of diffs caught it).
* numbers.c: Recombine the two conditional-compilation paths for
all the log* primitives -- they were split based on #ifndef
scm_long2num; factored out a SCM_LOGOP_RETURN macro, and fixed
some bugs and inconsistencies in the two sets of implementations.
(scm_lognot) Fixed *atrocious* re-use of a SCM as an integer!
* ioext.c: Use SCM_ASSERT_RANGE in a couple places, and
SCM_VALIDATE_INUM_COPY once where it should've been used.
* fluids.c (scm_internal_with_fluids): Use
SCM_VALIDATE_LIST_COPYLEN.
* filesys.c: Use SCM_NUM2LONG instead of SCM_VALIDATE_INUM_COPY;
this is questionable as it relaxes type safety, but other changes
were useful and all SCM_NUM2LONG's should probably be
revisited. Use SCM_OUT_OF_RANGE, SCM_WRONG_TYPE_ARG.
* evalext.c: line-break change on 1 line.
* eval.c (nconc2last): Takes a non-empty list as its first
argument, not just a list.
* dynl.c: Use new SCM_COERCE_ROSTRING macro.
strop.c: Use SCM_VALIDATE_ICHR, SCM_VALIDATE_ICHR_COPY instead of
SCM_VALIDATE_CHAR, SCM_VALIDATE_CHAR_COPY. Change made for
consistency with the other macros dealing with immediate
characters. (Similar to INT -> INUM change a week or so ago).
scm_lookupcar1: throw an error with key 'unbound-variable instead
of 'misc-error when an unbound variable is encountered.
* filesys.c (scm_mkdir, scm_rmdir, scm_getcwd, scm_select,
scm_symlink, scm_readlink, scm_lstat),
posix.c (scm_setpgid, scm_setsid, scm_ctermid, scm_tcgetpgrp,
scm_tcsetpgrp, scm_uname, scm_setlocale, scm_mknod, scm_nice,
scm_sync),
simpos.c (scm_system),
stime.c (scm_times, scm_strptime):
move the HAVE_XXX feature tests out of the procedure bodies.
don't use SCM_SYSMISSING.
scm_validate.h (SCM_SYSMISSING): removed.
error.h, error.c (scm_sysmissing): comment that this is deprecated.
see ChangeLog entry for 1999-12-28.
report the position of the argument.
* error.h, error.c (scm_out_of_range_pos): Added this function to
take extra "pos" argument, the position number of the errant
argument.
* debug.c: Use SCM_OUT_OF_RANGE instead of scm_out_of_range.
* snarf.h: Use SCM_HERE and SCM_INIT as names, not SCM_NOTSNARF
and SCM_SNARFING. Also put the %%% in the SCM_INIT since Mikael
prefers that and I'm reasonably indifferent.
posix.c: Eliminated a bunch of SCM_NIMP(..)s that are now
redundant with the safer macros. Patch from Dirk Hermann applied
by hand. Thanks Dirk!
* scm_validate.h: Added SCM_VALIDATE_VECTOR_OR_DVECTOR for some
uses in random.c.
* ramap.c: whitespace change.
SCM_SLOPPY_CONSP and SCM_SLOPPY_NCONSP. (SCM_CONSP) Define this
in terms of SCM_SLOPPY_NCONSP instead of repeating the
expression.
* symbols.h (SCM_SLOPPY_SUBSTRP, SCM_SUBSTRP): Added former, and
define latter in terms of sloppy variant.
* strings.h (SCM_SLOPPY_STRINGP, SCM_STRINGP): Added former, and
define latter in terms of sloppy variant.
* scm_validate.h (SCM_MAKE_VALIDATE): Added this macro to factor
out the commonality of the various basic SCM_VALIDATE_foop
macros. Use SCM_MAKE_VALIDATE macro where possible. Fix
SCM_VALIDATE_INT_COPY to not use scm_num2ulong -- that does
coercion to an integer which is more advanced than desired and
SCM_NUM2ULONG provides that functionality. Use SCM_ASSERT_RANGE
appropriately for the various _MIN, _MAX, _RANGE macros. Drop
some superfluous "SCM_NIMP &&" where possible. Eliminate obsoleted
SCM_VALIDATE_NIMCONS (SCM_VALIDATE_CONS now does the NIMP test as
part of its SCM_CONSP test).
* socket.c, ports.c, pairs.c, list.c, lang.c, async.c: Use
SCM_VALIDATE_CONS, not obsoleted SCM_VALIDATE_NIMCONS.
* scm_validate.h: Added SCM_VALIDATE_THREAD.
* *.c: Remove SCM_NIMP(X) when it is an extraneous pre-test given
that SCM_FOOP macros all now include SCM_NIMP in their expansion.
This simplifies lots of code, making it far more readable.
SCM_VALIDATE macros; the SCM_VALIDATE macros should be checked
for argument mismatches (along with the FUNC_NAME macro checking)
by a static tool that runs directly over the .c files.
* snarf.h: Handle SCM_REGISTER_PROC better when snarfing. The
docstring is still missing from the .doc file; it just gives the
name of the C function that gets called instead.
* guile-doc-snarf.awk: Be sure to touch the output files to help
make out. Also handle SCM_REGISTER_PROC better, and change the
output format slightly.
prototypes.
* eval.c: Make scm_m_mody's 3rd argument be a const char *, not a
char *. ANSI prototypes caught this.
* strorder.c: Use GUILE_PROC1 for the couple SCM_PROC1 expansions
that I missed.
* scm_validate.h: Use SCM_BOOLP for validating bools. Do not
expand macros if SCM_DOCSTRING_SNARF.
function headers and argument checking. Switched SCM_PROC,
SCM_PROC1 macros to be GUILE_PROC, GUILE_PROC1 (may change names
later, but was useful to keep old versions around while migrate)
that has docstrings and argument lists embedded in the GUILE_PROC
macro invocations that expand into a function header. Use lots of
new SCM_VALIDATE_* macros to simplify error checking and reduce
tons of redundancy. This is very similar to what I did for Scwm.
Note that none of the extraction of the docstrings, nor software
engineering checks of Scwm is yet added to Guile. I'll work on
that tomorrow, I expect.
* Makefile.am: Added scm_validate.h to modinclude_HEADERS.
* chars.c: Added docstrings for the primitives defined in here.
* snarf.h: Added GUILE_PROC, GUILE_PROC1. Added
SCM_REGISTER_PROC to be like old SCM_PROC, though old SCM_PROC
still remains for now. Changed naming convention for the s_foo
string name of the primitive to be s_scm_foo for ease of use with
the macro.
* scm_validate.h: Lots of new SCM_VALIDATE macros to simplify
argument checking through guile. Maybe some of these should be
folded into the header file for the types they check, but for now
it was easiest to just stick them all in one place.