summaryrefslogtreecommitdiff
path: root/libguile/pairs.h
Commit message (Expand)AuthorAgeFilesLines
* inline scm_cons, scm_car, scm_cdr...* libguile/pairs.h (scm_cons, scm_car, scm_cdr): Define these as inline functions. (scm_is_pair): Move here from inline.h. * libguile/pairs.c: Remove definitions here, and define gsubrs. * libguile/inline.h: Remove scm_is_pair implementation. * libguile/inline.c: Include pairs.h to residualize inlines from pairs.h. Andy Wingo2012-05-171-4/+62
* remove "discouraged" infrastructure...* libguile/discouraged.h: Remove. * libguile/deprecated.c (scm_internal_select, scm_thread_sleep) (scm_thread_usleep): Deprecate formerly discouraged names. * libguile/eq.h (SCM_EQ_P): * libguile/pairs.h (SCM_NULLP, SCM_NNULLP, SCM_CONSP, SCM_NCONSP): * libguile/boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_BOOL): (SCM_NEGATE_BOOL, SCM_BOOL_NOT): Undiscourage these names, because I'm not sure deprecating them will do any good. * libguile.h: * libguile/gen-scmconfig.c: * libguile/numbers.c: * libguile/init.c: * libguile/Makefile.am: * configure.ac: Remove bits that referenced discouraged.h, and dealt with the "discouraging" system. Andy Wingo2010-08-081-1/+9
* change remaining %nil -> #nil...* doc/ref/vm.texi: * libguile/boolean.h: * libguile/pairs.h: * module/language/elisp/README: * test-suite/tests/elisp-compiler.test: * test-suite/tests/load.test: Change remaining mentions of %nil to #nil. Andy Wingo2010-04-091-3/+4
* remove libguile/lang.h, deprecate %nil (in favor of #nil)...* libguile/Makefile.am: * libguile/init.c: * libguile/lang.c: * libguile/lang.h: Remove lang.c and lang.h. * libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here. * module/ice-9/deprecated.scm (%nil): %nil definition moved here. * libguile/alist.c: * libguile/async.c: * libguile/backtrace.c: * libguile/boolean.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/list.c: * libguile/load.c: * libguile/options.c: * libguile/posix.c: * libguile/print.c: * libguile/promises.c: * libguile/sort.c: * libguile/throw.c: * libguile/trees.c: * libguile/vectors.c: * libguile/vm.c: * libguile/weaks.c: * srfi/srfi-1.c: <libguile/lang.h> references removed. Andy Wingo2010-04-091-0/+6
* lisp nil always enabled...* configure.ac: Remove --disable-elisp option. Lisp nil is always enabled. * libguile/boolean.h: * libguile/gen-scmconfig.c: * libguile/gen-scmconfig.h.in: * libguile/init.c: * libguile/lang.c: * libguile/lang.h: * libguile/pairs.h: * libguile/private-options.h: * libguile/read.c: Remove conditionals for disabling elisp. Andy Wingo2010-04-091-6/+2
* nil is null, whee...* libguile/pairs.h (scm_is_null): Nil is also null. * libguile/vm-i-scheme.c (not, not-not, null?, not-null?): * libguile/vm-i-system.c (br-if-null, br-if-not-null): Remove some more nil special cases. Andy Wingo2010-03-301-2/+2
* remove cxrs...* libguile/pairs.h: * libguile/pairs.c: Previously scm_cdadr et al were implemented as #defines that called scm_i_chase_pairs, and the Scheme-exposed functions themselves were cxr subrs, which got special help in the interpreter. Since now the special help is unnecessary (because the compiler inlines and expands calls to car, cdadr, etc), the complexity is a loss. So just implement cdadr etc using normal functions. There's an advantage too, in that the compiler can unroll the cxring, reducing branches. * libguile/tags.h (scm_tc7_cxr): Remove this tag. (scm_tcs_subrs): Now there's only one kind of subr, yay! * libguile/debug.c (scm_procedure_name) * libguile/evalext.c (scm_self_evaluating_p) * libguile/gc.c (scm_i_tag_name) * libguile/goops.c (scm_class_of) * libguile/hash.c (scm_hasher) * libguile/print.c (iprin1) * libguile/procprop.c (scm_i_procedure_arity) * libguile/procs.c (scm_procedure_p, scm_subr_p) (scm_make_procedure_with_setter) * libguile/vm.c (apply_foreign): Remove cxr cases. Replace uses of scm_tcs_subrs with scm_tc7_gsubr. Andy Wingo2009-12-041-61/+28
* the cube of lisp booleans (#f nil () #t)... * Renumbers the IFLAG constants. * Adds several macros related to boolean type tests, null tests, and boolean-truth testing (including lisp-style boolean-truth tests). * Adds compile-time checks to verify the necessary IFLAG numbering properties needed for the checks to work properly. * Changes some existing code to use the new optimized macros, without changing the semantics of the code at all (except that scm_is_bool is changed from a function to a macro). I added the following macros, whose names explicitly state how %nil should be handled. See the comments in the patch for more information about these. scm_is_false_assume_not_lisp_nil scm_is_true_assume_not_lisp_nil scm_is_false_and_not_lisp_nil scm_is_true_or_lisp_nil scm_is_false_or_lisp_nil scm_is_true_and_not_lisp_nil scm_is_lisp_false scm_is_lisp_true scm_is_null_assume_not_lisp_nil scm_is_null_and_not_lisp_nil scm_is_null_or_lisp_nil scm_is_bool_and_not_lisp_nil scm_is_bool_or_lisp_nil The following already-existing macros are defined as aliases, such that their semantics is unchanged (although scm_is_bool used to be a function and is now a macro). scm_is_null --> scm_is_null_and_not_lisp_nil scm_is_false --> scm_is_false_and_not_lisp_nil scm_is_true --> scm_is_true_or_lisp_nil scm_is_bool --> scm_is_bool_and_not_lisp_nil (I still believe that these should be changed to versions that handle %nil properly, but await approval on that point, so these patches do not make those changes) Also, if the preprocessor macro SCM_ENABLE_ELISP is not true (this macro already existed and was used in lang.h), all overheads associated with %nil handling are eliminated from the above macros. * libguile/tags.h (SCM_BOOL_F, SCM_BOOL_T, SCM_UNSPECIFIED) (SCM_UNDEFINED, SCM_UNBOUND, SCM_ELISP_NIL): Renumber, so that a number of important distinctions (false versus true, end-of-list, etc) can be made by masking a single bit. Also define a number of build-time tests to assert that this condition holds. * libguile/boolean.h (scm_is_false_and_not_nil, scm_is_true_or_nil) (scm_is_false_assume_not_nil, scm_is_true_assume_not_nil): (scm_is_false_or_nil, scm_is_true_and_not_nil) (scm_is_bool_or_nil, scm_is_bool_and_not_nil): New exciting macros to test certain boolean/end-of-list properties. (scm_is_false, scm_is_true): Use a restrictive definition, where only SCM_BOOL_F is false. Should probably change in the future. (scm_is_bool): Incompatible change: changed to be a macro. Was a function before. Probably should allow nil as a boolean, but that will be for a later patch. (scm_is_lisp_false, scm_is_lisp_true): New macros, implementing the standard Lisp boolean predicates, where '() is actually false. * libguile/eval.i.c (CEVAL): Fix a number of false-or-nil and similar tests to use the new macros. * libguile/lang.h (SCM_NULL_OR_NIL_P): Use scm_is_null_or_nil. * libguile/pairs.c: Add a compile-time check that null and nil differ by only one bit. * libguile/pairs.h (scm_is_null_and_not_nil, scm_is_null_assume_not_nil) (scm_is_null_or_nil): New exciting macros! (scm_is_null): Just be scm_is_null_and_not_nil, for now. * libguile/print.c: Adapt to the reordering, and print suitably nasty things for the not-to-be-used values. Mark H Weaver2009-10-271-2/+27
* Change Guile license to LGPLv3+...(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* ) Neil Jerram2009-06-171-6/+7
* Add `SCM_INTERNAL' macro, use it.Ludovic Courtès2008-05-311-1/+1
* Fix "mixed linkage" errors in `inline.h'.Ludovic Courtès2008-03-021-3/+1
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
* * discouraged.h, tags.h (SCM_CONSP, SCM_NCONSP): Moved to...discouraged.h. Replaced all uses with scm_is_pair. (SCM_I_CONSP): New name for SCM_CONSP. * pairs.h, pairs.c (scm_is_pair, scm_is_null, scm_car, scm_cdr, scm_i_chase_pairs, SCM_I_A_PAT, SCM_I_D_PAT, etc, scm_caar, scm_cadr, etc): New. (SCM_NULLP, SCM_NNULLP): Moved to discouraged.h. Replaced all uses with scm_is_null. Marius Vollmer2004-09-221-6/+6
* (scm_car, scm_cdr, scm_i_chase_pairs, SCM_I_A_PAT, SCM_I_D_PAT, etc,...scm_caar, scm_cadr, etc): New. Marius Vollmer2004-09-221-0/+67
* * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into...deprecated.h. Replaced all uses with scm_is_eq. Marius Vollmer2004-07-271-1/+1
* * sort.c, pairs.h: Removed unnecessary includes.Dirk Herrmann2003-04-231-1/+0
* Changed license terms to the plain LGPL thru-out.Marius Vollmer2003-04-051-35/+11
* Prefixed each each exported symbol with SCM_API.Marius Vollmer2001-11-021-7/+7
* * Renamed header macros to the SCM_<filename>_H format.Dirk Herrmann2001-08-311-4/+4
* * Use SCM_CONSP, not SCM_ECONSP.Dirk Herrmann2001-07-301-1/+1
* Remove "face-lift" comment.Thien-Thi Nguyen2001-07-091-2/+0
* * Various minor improvements, for example signedness fixes.Dirk Herrmann2001-06-231-1/+1
* * Introduce SCM_UNUSED and mark unused function parameters....* Introduce SCM_DEBUG_PAIR_ACCESSES. * Extend the possibilities of SCM_DEBUG_CELL_ACCESSES. Dirk Herrmann2001-06-071-8/+19
* * New macro SCM_TRUE_P....* Use SCM_EQ_P to compare SCM values. Dirk Herrmann2000-03-291-2/+2
* * SCM_C[AD]R and SCM_SETC[AD]R use SCM_{SET_}?OBJECT now....* Moved SCM_GCCDR from pairs.h to tags.h. Dirk Herrmann2000-03-271-5/+5
* Moved some cell related definitions from tags.h and pairs.h to gc.h.Dirk Herrmann2000-03-261-165/+1
* Added a set of low level macros for accessing cell entries.Dirk Herrmann2000-03-241-12/+33
* * *.[hc]: add Emacs magic at the end of file, to ensure GNU... indentation style. Michael Livshin2000-03-191-0/+6
* * gc.c, gc.h, pairs.h, init.c: Implementation of a new way of...allocating heap. The basic idea is to trigger GC every Nth allocated cell and grow heap when free list runs out. The scheme has been extended so that GC isn't triggered until all remaining cells are used. The implementation is also prepared for development in the direction of POSIX threads. * gc.c (SCM_EXPHEAP): In order to grow by a factor of 1.5, SCM_EXPHEAP should return half of the heap size. Mikael Djurfeldt2000-03-151-0/+30
* * pairs.h (SCM_NEWCELL, SCM_NEWCELL2): Use new style freelists.Mikael Djurfeldt2000-03-141-8/+8
* * pairs.h (SCM_NEWCELL2): double-cell variants of SCM_NEWCELL....(SCM_CELL_WORD, SCM_CELL_WORDLOC, SCM_SET_CELL_WORD): primitive multi-cell access macros (used by the ones below). (SCM_CELL_WORD[0-3], SCM_SET_CELL_WORD[0-3]): multi-cell access macros. Mikael Djurfeldt2000-03-141-14/+45
* *** empty log message ***Mikael Djurfeldt2000-03-121-7/+7
* * async.c, boolean.h, debug.c, dynl.c, dynwind.c, eval.c, eval.h,... feature.h, filesys.h, fluids.h, fports.c, fports.h, gc.c, gc.h, hash.c, keywords.h, macros.c, numbers.c, numbers.h, objects.c, objects.h, options.c, pairs.h, ports.c, ports.h, print.c, procs.h, ramap.c, read.c, smob.c, smob.h, srcprop.h, stacks.c, stacks.h, strports.c, struct.c, struct.h, tag.c, tags.h, throw.c, unif.c, unif.h, variable.h, vectors.h, weaks.c, weaks.h (SCM_SCM, SCM_BITS, SCM_CARBITS): Renamed from SCM_ASSCM, SCM_ASWORD, SCM_CARW). Mikael Djurfeldt2000-03-121-7/+7
* * pairs.h (SCM_SETAND_CAR, SCM_SETAND_CDR, SCM_SETOR_CAR,...SCM_SETOR_CDR): Corrected SCM_ASSCM/WORD fixes. Mikael Djurfeldt2000-03-111-5/+9
* *.[ch]: make a distinction between SCM as a generic...name for a Scheme object (now a void*), and SCM as 32 bit word for storing tags and immediates (now a long int). Introduced SCM_ASWORD and SCM_ASSCM for conversion. Fixed various dubious code in the process: arbiter.c (use macros), unif.c (scm_array_p), Greg J. Badros2000-03-091-7/+7
* * list.c: Moved append docs to append! Thanks Dirk Hermann. Also,...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! Greg J. Badros2000-03-021-6/+6
* * gc.c (scm_debug_newcell): Added SCM_SETCAR of the newly...allocated cell. * pairs.h: Added a comment about the need for the SCM_SETCAR in SCM_NEWCELL macro. Greg J. Badros2000-01-031-0/+5
* * *.c: Pervasive software-engineering-motivated rewrite of...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. Greg J. Badros1999-12-121-0/+5
* Fix my last commit -- DEBUG_FREELIST renamed to GUILE_DEBUG_FREELISTGreg J. Badros1999-09-281-1/+1
* * stacks.c: Avoid compiler warning re: unitialized var....* scmconfig.h.in: Added DEBUG_FREELIST * pairs.h: Fix macro that was not do-while(0) sandwiched. * gc.h, gc.c: Added scm_gc_set_debug_check_freelist_x, scm_map_free_list Greg J. Badros1999-09-271-3/+3
* * pairs.h (SCM_NEWCELL): When DEBUG_FREELIST is defined, don't...take the address of _into; it might be a register. Just have scm_debug_newcell return the new cell. * gc.c (scm_debug_newcell): Just return the new cell, instead of taking the address of a place to store it as an argument. * gc.h (scm_debug_newcell): Change declaration. (Thanks to Greg Harvey.) Jim Blandy1998-12-051-1/+1
* * Lots of files: New address for FSF.Jim Blandy1997-05-261-3/+3
* * gc.c (which_seg, scm_map_free_list, scm_newcell_count,...scm_check_freelist, scm_debug_newcell): New functions and variables, for debugging freelist problems. * pairs.h (SCM_NEWCELL): New debugging version added. * gc.h (scm_debug_newcell): Added extern declaration, used by debugging version of SCM_NEWCELL. Jim Blandy1996-11-101-0/+4
* * pairs.h, eval.c, eval.h, feature.c, gc.c, list.c, load.c,...ramap.c, symbols.c: Added new selectors SCM_CARLOC and SCM_CDRLOC for obtaining the address of a car or cdr field. Motivation: &SCM_CXR make assumptions about the internal structure of the SCM_CXR selectors. * pairs.h, eval.c, gc.c, init.c, ioext.c, ports.c, ports.h, srcprop.h, tags.h, throw.c, unif.c: Added new selectors SCM_SETAND_CAR, SCM_SETAND_CDR, SCM_SETOR_CAR and SCM_SETOR_CDR. Motivation: Safer use. Some other macros are defined in terms of these operations. If these are defined using the SCM_SETCXR (<e1>, SCM_CXR (<e1>) <op> <e2>) pattern a complex <e1> will lead to inefficiency and an <e1> with side-effects could potentially break. Also, these particular operations are heavily utilized in the garbage collector. In unoptimized code there will be a measurable speedup. * alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c, eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c, ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h, pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c, procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h, strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c, vports.c: Cleaned up use of pairs: Don't make any special assumptions about the internal structure of selectors and mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>), SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc. (Among other things, this change makes it easier to build Guile with certain compilers which have problems with casted lvalues.) Mikael Djurfeldt1996-10-201-2/+10
* * __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,...arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h, chars.c, chars.h, continuations.c, continuations.h, debug.c, debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c, eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c, filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c, gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h, hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h, kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c, markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h, objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h, ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c, procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h, root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c, simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h, stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h, strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h, struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c, unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c, version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to declare functions with prototypes. (Patch thanks to Marius Vollmer.) Jim Blandy1996-10-141-17/+8
* Distinguish #f and ()....* __scm.h: #undef SICP. * pairs.h (SCM_EOL): Delete this definition, equating it with SCM_BOOL_F. * tags.h (SCM_EOL): Give it a new definition here; I think I found the value it used to have. Doc fixes, too. Jim Blandy1996-10-031-1/+0
* * alist.h, append.h, arbiters.h, async.h, boolean.h, chars.h,...continuations.h, debug.h, dynwind.h, error.h, eval.h, fdsocket.h, feature.h, filesys.h, fports.h, gc.h, gdbint.h, genio.h, gsubr.h, hash.h, init.h, ioext.h, kw.h, list.h, markers.h, marksweep.h, mbstrings.h, numbers.h, objprop.h, options.h, pairs.h, ports.h, posix.h, print.h, procprop.h, procs.h, ramap.h, read.h, root.h, sequences.h, smob.h, socket.h, srcprop.h, stackchk.h, stime.h, strings.h, strop.h, strorder.h, strports.h, struct.h, symbols.h, tag.h, throw.h, unif.h, variable.h, vectors.h, version.h, vports.h, weaks.h: #include "libguile/__scm.h", not <libguile/__scm.h>. This allows 'gcc -MM' to determine which dependencies are within libguile properly. Jim Blandy1996-09-051-1/+1
* Don't install the unwashed masses of Guile header files in the...main #include path; put most of them in a subdirectory called 'libguile'. This avoids naming conflicts between Guile header files and system header files (of which there were a few). * Makefile.in (pkgincludedir): Deleted. (innerincludedir): New variable; this and $(includedir) are enough. (INCLUDE_CFLAGS): Search for headers in "-I$(srcdir)/..". (installed_h_files): Divide this up. Now this variable lists those header files which should go into $(includedir) (i.e. appear directly in the #include path), and ... (inner_h_files): ... this new variable says which files appear in a subdirectory, and are referred to as <libguile/mumble.h>. (h_files): List them both. (install): Create innerincludedir, not pkgincludedir. Put the installed_h_files and inner_h_files in their proper places. (uninstall): Corresponding changes. * alist.h, append.h, arbiters.h, async.h, boolean.h, chars.h, continuations.h, debug.h, dynwind.h, error.h, eval.h, fdsocket.h, feature.h, fports.h, gc.h, genio.h, gsubr.h, hash.h, init.h, ioext.h, kw.h, libguile.h, list.h, markers.h, marksweep.h, mbstrings.h, numbers.h, options.h, pairs.h, ports.h, posix.h, print.h, procprop.h, procs.h, ramap.h, read.h, root.h, sequences.h, smob.h, socket.h, srcprop.h, stackchk.h, stime.h, strings.h, strop.h, strorder.h, strports.h, struct.h, symbols.h, tag.h, throw.h, unif.h, variable.h, vectors.h, version.h, vports.h, weaks.h: Find __scm.h in its new location. * __scm.h: Find scmconfig.h and tags.h in their new locations (they're both "inner" files). Jim Blandy1996-09-041-1/+1
* maintainer changed: was lord, now jimb; first importJim Blandy1996-07-251-0/+170