summaryrefslogtreecommitdiff
path: root/libguile/scm_validate.h
AgeCommit message (Collapse)AuthorFilesLines
2000-03-03* validate.h, scm_validate.h: Added the former, as a renamedGreg J. Badros1-291/+0
version of the latter with SCM_ASSERT_TYPE used in SCM_MAKE_VALIDATE (instead of just SCM_ASSERT)
2000-03-03* error.h, error.c: Added `scm_wrong_type_arg_msg' to supportGreg J. Badros1-1/+1
displaying the expected type. Use SCM_LISTn in a couple places instead of scm_cons-ing by hand. * __scm.h: Added SCM_ASSERT_TYPE macro. * validate.h, scm_validate.h: Added the former, as a renamed version of the latter with SCM_ASSERT_TYPE used in SCM_MAKE_VALIDATE (instead of just SCM_ASSERT) * Makefile.am: Rename scm_validate.h to validate.h. * *.c, *.h: Include validate.h, not scm_validate.h (old name's prefix was superfluous).
2000-03-02* list.c: Moved append docs to append! Thanks Dirk Hermann. Also,Greg J. Badros1-5/+5
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!
2000-01-17* scm_validate.h: Added SCM_VALIDATE_ULONG_COPY,Greg J. Badros1-1/+7
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.
2000-01-14* scm_validate.h (SCM_NUM2LONG_DEF): Fix this macro to just useGreg J. Badros1-2/+2
def, not SCM_MAKINUM(def); thanks Janis Bzerins!
2000-01-12* scm_validate.h: Added SCM_NUM2LONG_DEF macro. MakeGreg J. Badros1-4/+12
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.
2000-01-11* scm_validate.h, chars.c, ports.c, print.c, read.c, strings.c,Greg J. Badros1-3/+3
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).
2000-01-09 * eval.c: define scm_unbound_variable_key ('unbound-variable).Gary Houston1-4/+1
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.
2000-01-09* scm_validate.h (SCM_VALIDATE_BOOL_COPY): Fix typo.Greg J. Badros1-2/+2
2000-01-07* scm_validate.h (SCM_OUT_OF_RANGE): Use scm_out_of_range_pos toGreg J. Badros1-2/+2
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.
2000-01-06scm_validate.h: Remove some redundant NIMP tests.Greg J. Badros1-3/+3
2000-01-06scm_validate.h: Remove some redundant NIMP tests.Greg J. Badros1-3/+3
2000-01-05* *.[ch]: Replace SCM_VALIDATE_INT w/ SCM_VALIDATE_INUM forGreg J. Badros1-9/+9
better consistency with the names of other SCM_VALIDATE_ macros and better conformance to guile naming policy.
2000-01-05* unif.c, symbols.c, strings.c, stacks.c, random.c, print.c,Greg J. Badros1-1/+6
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.
1999-12-19* tags.h (SCM_CONSP, SCM_NCONSP): Define these in terms ofGreg J. Badros1-99/+61
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.
1999-12-16* coop-threads.c: Remove K&R function headers.Greg J. Badros1-1/+4
* 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.
1999-12-13* scm_validate.h: Drop the SCM_DOCSTRING_SNARF for turning offGreg J. Badros1-5/+1
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.
1999-12-12* *.c: Finish replacing K&R style prototypes with ANSI CGreg J. Badros1-6/+12
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.
1999-12-12* boolean.h: Added SCM_BOOL, SCM_NEGATE_BOOL, SCM_BOOLP to here,Greg J. Badros1-5/+2
from scm_validate.h. * scm_validate.h: Moved above out into boolean.h, fix typo in SCM_VALIDATE_NIM macro.
1999-12-12* *.c, scm_validate.h: Use SCM_VALIDATE_NIM, not SCM_VALIDATE_NIMPGreg J. Badros1-2/+8
(none of the other validate macros have the trailing P).
1999-12-12* scm_validate.h: Added the FSF copyright to the top.Greg J. Badros1-4/+42
* strings.c: Use SCM_ASSERT_RANGE in a couple of places instead of SCM_ASSERT w/ SCM_OUT_OF_RANGE.
1999-12-12* *.c: Pervasive software-engineering-motivated rewrite ofGreg J. Badros1-0/+267
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.