summaryrefslogtreecommitdiff
path: root/libguile/print.c
AgeCommit message (Collapse)AuthorFilesLines
2005-03-02See ChangeLog from 2005-03-02.Marius Vollmer1-14/+14
2005-01-24Reverted changed from 2005/01/24 19:14:54, which was a commit to theMarius Vollmer1-9/+9
wrong branch. Sorry.
2005-01-24Threading changes.Marius Vollmer1-9/+9
2005-01-07(scm_print_state, SCM_PRINT_STATE_LAYOUT):Marius Vollmer1-11/+11
Removed ref_stack field. (PSTATE_STACK_REF, PSTATE_STACK_SET): New, for accessing the stack of a print state. Use them everywhere instead of ref_stack.
2005-01-02Use new vector elements API or simple vector API, as appropriate.Marius Vollmer1-11/+12
Removed SCM_HAVE_ARRAYS ifdefery. Replaced all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2004-11-09Do no longer handle scm_tc7_bvect bitvectors.Marius Vollmer1-5/+0
2004-11-02Do no longer handle old-style uniform vectors.Marius Vollmer1-9/+0
2004-10-27* print.c (iprin1): Removed code for scm_tc7_byvect.Marius Vollmer1-1/+0
* objects.c (scm_class_of): Likewise. * gc-mark.c (scm_gc_mark_dependencies): Likewise. * gc-card.c (scm_i_sweep_card): Likewise. * evalext.c (scm_self_evaluating_p): Likewise. * eq.c (scm_equal_p): Likewise.
2004-10-22* variable.c, threads.c, struct.c, stackchk.c, smob.c, root.c,Marius Vollmer1-4/+4
print.c, ports.c, mallocs.c, hooks.c, hashtab.c, fports.c, guardians.c, filesys.c, coop-pthreads.c, continuations.c: Use scm_uintprint to print unsigned integers, raw heap words, and adresses, using a cast to scm_t_bits to turn pointers into integers.
2004-10-22(scm_uintprint): New, for printing scm_t_uintmax values.Marius Vollmer1-1/+8
(scm_intprint): Argument type changed to scm_t_intmax.
2004-09-29(SCM_PRINT_HIGHLIGHT_PREFIX,Marius Vollmer1-4/+13
SCM_PRINT_HIGHLIGHT_SUFFIX): New printer options. (scm_iprin1): Use them instead of the previoulsy hardcoded strings. (scm_init_print): Initialize them.
2004-09-23* print.h (scm_print_state): Added highlight_objects.Marius Vollmer1-0/+18
* print.c (make_print_state, scm_free_print_state): Initialize it to SCM_EOL. (scm_iprin1): Wrap output in '{...}' when object is contained in highlight_objects.
2004-09-22*** empty log message ***Marius Vollmer1-10/+10
2004-08-19* strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,Marius Vollmer1-19/+24
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH. Updated all uses. (scm_i_make_string, scm_c_make_string): New, to replace scm_allocate_string. Updated all uses. (SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS, SCM_STRING_LENGTH): Deprecated. (scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string, scm_str2string, scm_makfrom0str, scm_makfrom0str_opt): Discouraged. Replaced all uses with scm_from_locale_string or similar, as appropriate. (scm_c_string_length, scm_c_string_ref, scm_c_string_set_x, scm_c_substring, scm_c_substring_shared, scm_c_substring_copy, scm_substring_shared, scm_substring_copy): New. * symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC, SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS, SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol, scm_str2symbol, scm_mem2uninterned_symbol): Discouraged. (SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str): Deprecated. (SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS, SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed. (scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln): New, to replace scm_str2symbol and scm_mem2symbol, respectively. Updated all uses. (scm_gensym): Generate only the number suffix in the buffer, just string-append the prefix.
2004-08-12* socket.c, rw.c, deprecated.h, validate.hMarius Vollmer1-5/+6
(SCM_VALIDATE_STRING_COPY): Deprecated. Replaced all uses with SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or scm_to_locale_string, etc. (SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated. Replaced as above, plus scm_i_get_substring_spec. * regex-posix.c, read.c, random.c, ramap.c, print.c, numbers.c, hash.c, gc.c, gc-card.c, convert.i.c, backtrace.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, unif.c, ports.c: Use SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_STRING_LENGTH instead of SCM_STRING_CHARS, SCM_STRING_UCHARS, and SCM_STRING_LENGTH, respectively. Also, replaced scm_return_first with more explicit scm_remember_upto_here_1, etc, or introduced them in the first place.
2004-07-27* tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it intoMarius Vollmer1-10/+10
deprecated.h. Replaced all uses with scm_is_eq.
2004-07-23* deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,Marius Vollmer1-1/+1
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated versions to deprecated.h and deprecated.c. Changed all uses to either use the SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
2004-07-06* deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,Marius Vollmer1-9/+9
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h". Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively.
2004-06-27 * backtrace.c (display_expression, display_frame): CallDirk Herrmann1-1/+1
scm_i_unmemoize_expr for unmemoizing a memoized object holding a single memoized expression. * debug.c (memoized_print): Don't try to unmemoize the memoized object, since we can't know whether it holds a single expression or a body. (scm_mem_to_proc): Removed check for lambda expression, since it was moot anyway. Whoever uses these functions for debugging purposes should know what they do: Creating invalid memoized code will cause crashes, independent of whether this check is present or not. (scm_proc_to_mem): Take the closure's code as it is and don't append a SCM_IM_LAMBDA isym. To allow easier debugging, the memoized code should not be modified. * debug.[ch] (scm_unmemoize, scm_i_unmemoize_expr): Removed scm_unmemoize from public use, but made scm_i_unmemoize_expr available as a guile internal function instead. However, scm_i_unmemoize_expr will only work on memoized objects that hold a single memoized expression. It won't work with bodies. * debug.c (scm_procedure_source), macros.c (macro_print), print.c (scm_iprin1): Call scm_i_unmemocopy_body for unmemoizing a body, i. e. a list of expressions. * eval.c (unmemoize_exprs): Drop internal body markers from the output during unmemoization. * eval.[ch] (scm_unmemocopy, scm_i_unmemocopy_expr, scm_i_unmemocopy_body): Removed scm_unmemocopy from public use, but made scm_i_unmemocopy_expr and scm_i_unmemocopy_body available as guile internal functions instead. scm_i_unmemoize_expr will only work on a single memoized expression, while scm_i_unmemocopy_body will only work on bodies.
2004-04-22 Hide the implementation of ilocs and isyms in eval.c.Dirk Herrmann1-46/+3
* deprecated.h (SCM_IFRINC, SCM_ICDR, SCM_IFRAME, SCM_IDIST, SCM_ICDRP), eval.c (SCM_IFRINC, SCM_ICDR, SCM_IFRAME, SCM_IDIST, SCM_ICDRP), eval.h (SCM_ICDR, SCM_IFRINC, SCM_IFRAME, SCM_IDIST, SCM_ICDRP): Deprecated and added to deprecated.h. Moved from eval.h to eval.c. * deprecated.c (scm_isymnames), deprecated.h (scm_isymnames, SCM_ISYMNUM, SCM_ISYMCHARS), eval.c (SCM_ISYMNUM, isymnames, scm_unmemocopy, CEVAL), print.c (scm_isymnames), tags.h (SCM_ISYMNUM, scm_isymnames, SCM_ISYMCHARS): Deprecated scm_isymnames, SCM_ISYMNUM and SCM_ISYMCHARS and added to deprecated.[hc]. Moved scm_isymnames from print.c to eval.c and renamed to isymnames. Moved SCM_ISYMNUM from tags.h to eval.c and renamed to ISYMNUM. * eval.c (scm_i_print_iloc, scm_i_print_isym), eval.h (scm_i_print_iloc, scm_i_print_isym), print.c (scm_iprin1): Extracted printing of ilocs and isyms to guile internal functions scm_i_print_iloc, scm_i_print_isym of eval.c.
2004-01-11(scm_print_symbol_name): Handle #{`foo}#, #{,foo}#, #{.}#, and allMarius Vollmer1-18/+8
numeric strings specially. Thanks to Paul Jarc!
2003-11-30(scm_iprin1): use \xNN hexadecimal sequences when writing controlMarius Vollmer1-10/+19
characters in strings.
2003-11-18* print.c (scm_iprin1): Handle fractions.Marius Vollmer1-0/+3
* objects.h (scm_class_fraction): New. * objects.c (scm_class_fraction): New. (scm_class_of): Handle fractions. * hash.c (scm_hasher): Handle fractions. * numbers.c: New code for handling fraction all over the place. (scm_odd_p, scm_even_p): Handle inexact integers. (scm_rational_p): New function, same as scm_real_p. (scm_round_number, scm_truncate_number, scm_ceiling, scm_floor): New exact functions that replace the inexact 'dsubr' implementations. (scm_numerator, scm_denominator): New. * numbers.h (SCM_NUMP): Recognize fractions. (SCM_FRACTIONP, SCM_SLOPPY_FRACTIONP, SCM_FRACTION_NUMERATOR, SCM_FRACTION_DENOMINATOR, SCM_FRACTION_SET_NUMERATOR, SCM_FRACTION_SET_DENOMINATOR, SCM_FRACTION_REDUCED_BIT, SCM_FRACTION_REDUCED_SET, SCM_FRACTION_REDUCED_CLEAR, SCM_FRACTION_REDUCED): New. (scm_floor, scm_ceiling, scm_truncate_number, scm_round_number): New prototypes. (scm_make_ratio, scm_rationalize, scm_numerator, scm_denominator, scm_rational_p): New prototypes. (scm_i_dbl2num, scm_i_fraction2double, scm_i_fraction_equalp, scm_i_print_fraction): New prototypes. * goops.c (create_standard_classes): Create "<fraction>" class. * gc-mark.c (scm_gc_mark_dependencies): Handle fractions. * gc-card.c (scm_i_sweep_card): Include scm_tc16_fraction as a case in the switch, but do nothing for now. * eval.c (SCM_CEVAL, SCM_APPLY, call_dsubr_1): Convert fractions to doubles when calling 'dsubr' functions. * eq.c (scm_eqv_p, scm_equal_p): Handle fractions.
2003-10-11 * libguile/tags.h (SCM_IM_ELSE, SCM_IM_ARROW): New memoizer codes.Dirk Herrmann1-0/+2
* libguile/print.c (scm_isymnames): Add names for the new memoizer codes. * libguile/eval.c (s_missing_clauses, s_bad_case_clause, s_extra_case_clause, s_bad_case_labels, s_duplicate_case_label, literal_p): New static identifiers. (scm_m_case): Use ASSERT_SYNTAX to signal syntax errors. Be more specific about the kind of error that was detected. Check for duplicate case labels. Handle bound 'else. Avoid unnecessary consing when creating the memoized code. (scm_m_case, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize the syntactic keyword 'else. * test-suite/tests/syntax.test (exception:bad-expression, exception:missing-clauses, exception:bad-case-clause, exception:extra-case-clause, exception:bad-case-labels): New. Added some tests and adapted tests for 'case' to the new way of error reporting.
2003-09-18 This set of patches introduces a new tc7 code scm_tc7_number forDirk Herrmann1-0/+13
numbers. Bignums, reals and complex numbers are turned from smobs into subtypes of scm_tc7_number. * tags.h (scm_tc7_number): New. * eq.c (scm_equal_p), eval.c (SCM_CEVAL), evalext.c (scm_self_evaluating_p), gc-card.c (scm_i_sweep_card), gc-mark.c (scm_gc_mark_dependencies), goops.c (create_smob_classes), hash.c (scm_hasher), numbers.c, numbers.h (SCM_NUMP), objects.c (scm_class_of), print.c (scm_iprin1), smob.c (scm_smob_prehistory): Don't handle bignums, reals and complex numbers as subtypes of scm_tc7_smob any more. * numbers.h, tags.h (scm_tc16_big, scm_tc16_real, scm_tc16_complex): Moved definitions from tags.h to numbers.h.
2003-09-16 This set of patches eliminates the dependency between theDirk Herrmann1-24/+35
implementation of evaluator specific memoization codes and special constants like #f, '() etc. ('flags'), which are not evaluator specific. The goal is to remove definitions of evaluator memoization codes completely from the public interface. This will make it possible to experiment more freely with optimizations of guile's internal representation of memoized code. * objects.c (scm_class_of): Eliminate dependency on SCM_ISYMNUM. * print.c (iflagnames): New array, holding the printed names of guile's special constants ('flags'). (scm_isymnames): Now holds only the printed names of the memoization codes. (scm_iprin1): Separate the handling of memoization codes and guile's special constants. * tags.h (scm_tc9_flag, SCM_ITAG9, SCM_MAKE_ITAG9, SCM_ITAG9_DATA, SCM_IFLAGNUM): new (scm_tc8_char, scm_tc8_iloc, SCM_BOOL_F, SCM_BOOL_T, SCM_UNDEFINED, SCM_EOF_VAL, SCM_EOL, SCM_UNSPECIFIED, SCM_UNBOUND, SCM_ELISP_NIL, SCM_IM_DISPATCH, SCM_IM_SLOT_REF, SCM_IM_SLOT_SET_X, SCM_IM_DELAY, SCM_IM_FUTURE, SCM_IM_CALL_WITH_VALUES, SCM_IM_NIL_COND, SCM_IM_BIND): Changed values. (SCM_IFLAGP): SCM_IFLAGP now only tests for flags. (SCM_IFLAGP, SCM_MAKIFLAG, SCM_IFLAGNUM): Generalized to use the tc9 macros and scm_tc9_flag.
2003-09-14 * tags.h: Reduced the number of short instructions from 14 to 13.Dirk Herrmann1-4/+0
The typecode of the former 14th short instruction is now used to represent long instructions. Changed some comments to reflect this fact. (SCM_MAKISYM): ISYMs get a new tc7 code, namely the one that was previously used by SCM_IM_DEFINE. (SCM_IM_DEFINE): Turned into a long instruction. * eval.c (unmemocopy, SCM_CEVAL): Treat SCM_IM_DEFINE as a long instruction. * eval.c (SCM_CEVAL): Since characters and iflags have now a tc7 code that is separate from all instructions, one level of dispatch for long instructions can be eliminated. * print.c (scm_isymnames): Removed some commented code.
2003-07-27(scm_print_symbol_name): handle more weird characters by escaping theMarius Vollmer1-21/+33
symbol name properly. Thanks to Paul Jarc!
2003-05-12* backtrace.c (scm_display_error_message): Introduced fancyMikael Djurfeldt1-34/+50
printing with max level 7 and length 10. (Purpose: avoid printing gigantic objects in error messages.) * print.c, print.h (scm_i_port_with_print_state): New function. * print.c (scm_iprin1, scm_printer_apply, scm_port_with_print_state): Use scm_i_port_with_print_state. (scm_simple_format): Modified not to destroy print states. (print_state_mutex): New mutex. (scm_make_print_state, scm_free_print_state, scm_prin1): Lock/unlock print_state_mutex.
2003-04-05* hashtab.c (rehash_after_gc): Clear to_rehash list beforeMikael Djurfeldt1-1/+4
processing it in order to avoid an infinite loop. * print.c (scm_prin1): Remember old state of pstate->writingp.
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-36/+12
2003-03-27* print.c: fix various preprocessor usages of new publicRob Browning1-1/+1
symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc.
2003-03-25* print.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.Rob Browning1-2/+2
Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
2002-12-15* __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.Mikael Djurfeldt1-0/+1
Simply lock a thread C API recursive mutex. (SCM_NONREC_CRITICAL_SECTION_START, SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START, SCM_REC_CRITICAL_SECTION_END): Removed. * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with direct calls to scm_rec_mutex_lock / unlock around the three calls to scm_m_expand_body. * eval.c, eval.h (promise_free): New function. (scm_force): Rewritten; Now thread-safe; Removed SCM_DEFER/ALLOW_INTS. * pthread-threads.h: Added partially implemented plugin interface for recursive mutexes. These are, for now, only intended to be used internally within the Guile implementation. * pthread-threads.c: New file. * threads.c: Conditionally #include "pthread-threads.c". * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be thread-safe; * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX, SCM_GLOBAL_REC_MUTEX): New macros. * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section macros---use mutexes instead. * tags.h (SCM_IM_FUTURE): New tag. * eval.c (scm_m_future): New primitive macro. (SCM_CEVAL): Support futures. (unmemocopy): Support unmemoization of futures. * print.c (scm_isymnames): Name of future isym.
2002-08-19(scm_iprin1): Print primitives generics always as "primitive-generic"Marius Vollmer1-2/+2
even when they have no primitive methods yet.
2002-08-04new gcHan-Wen Nienhuys1-1/+1
2002-07-202002-07-20 Han-Wen <hanwen@cs.uu.nl>Han-Wen Nienhuys1-12/+11
* *.c: add space after commas everywhere. * *.c: use SCM_VECTOR_SET everywhere, where a vector is written. Document cases where SCM_WRITABLE_VELTS() is used. * vectors.h (SCM_VELTS): prepare for write barrier, and let SCM_VELTS() return a const pointer (SCM_VECTOR_SET): add macro. * autogen.sh (mscripts): find and check version number of autoconf. Complain if 2.53 is not found.
2002-06-17(scm_simple_format): Print missing part of format before ~% control.Marius Vollmer1-0/+1
Thanks to Daniel Skarda!
2002-03-14Retire inclusion guard macro SCM_MAGIC_SNARFER.Thien-Thi Nguyen1-2/+0
2002-02-03(scm_iprin1): Print uninterned symbols unreadably.Marius Vollmer1-4/+17
2002-01-22* First batch of libguile changes for Elisp support.Neil Jerram1-9/+10
* Fixed a few typos. * Minor rationalization of macros relating to source breakpoints.
2001-11-25Replaced SCM_NEWCELL and SCM_NEWCELL2 with scm_alloc_cell andMarius Vollmer1-3/+1
scm_alloc_double_cell, respectively.
2001-11-16* Adding C function declarations from the SCM interface to theNeil Jerram1-1/+2
reference manual documentation.
2001-11-02* print.c (scm_iprin1): Mark print state as revealed whenMikael Djurfeldt1-0/+1
dispatching to generic write or display.
2001-10-11* print.c (scm_print_state_vtable, print_state_pool):Dirk Herrmann1-29/+28
Initialize. These variables are now registered as gc roots. (scm_current_pstate): Update documentation. (scm_current_pstate, scm_make_print_state, scm_free_print_state, scm_prin1, scm_init_print): print_state_pool is registered as a gc root and thus does not need to be protected by a surrounding pair any more. (make_print_state): The car of print_state_pool no longer holds the scm_print_state_vtable. (scm_current_pstate, scm_make_print_state, print_circref, scm_iprin1, scm_prin1, scm_iprlist): Prefer !SCM_<foo> over SCM_N<foo>. (scm_prin1): When building lists, prefer scm_list_<n> over scm_cons[2]?. (scm_iprlist): Removed a redundant SCM_IMP test. (scm_simple_format): Use SCM_EQ_P to compare SCM values.
2001-08-31* Removed lots of deprecated stuff.Dirk Herrmann1-2/+1
2001-07-26* tags.h: Update tag system docs.Marius Vollmer1-38/+26
(scm_tc3_cons_gloc): Renamed to scm_tc3_struct. Changed all uses. (scm_tcs_cons_gloc): Renamed to scm_tcs_struct. Changed all uses. (SCM_ECONSP, SCM_NECONSP): Removed. Changed all uses to SCM_CONSP or SCM_NCONSP, respectively. * struct.c, struct.h, srcprop.c, procs.c, procprop.c, print.c, objects.c. modules.c, goops.c, eval.c, debug.c: Changed all uses of scm_tc3_cond_gloc and scm_tcs_cons_gloc. See above. * print.c (scm_iprin1): Remove printing of glocs. Do not try to tell glocs from structs. * gc.c (scm_gc_mark, scm_gc_sweep): Remove handling of glocs. * eval.c (scm_m_atbind): Make a list of variables, not glocs. (scm_ceval, scm_deval): For SCM_IM_BIND, fiddle with variables instead of with glocs. (EVALCAR): Do not test for glocs. (scm_lookupcar, scm_lookupcar1): Do not handle glocs in race condition. (scm_unmemocar): Do not handle glocs. (scm_m_atfop): Memoize as a variable, not as a gloc. (scm_eval_args, scm_deval_args): Do not handle glocs. (scm_ceval, scm_deval): Likewise. * eval.h (SCM_XEVALCAR): Do not test for glocs. (SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL, SCM_GLOC_VAL_LOC): Removed. * debug.h, debug.c (scm_make_gloc, scm_gloc_p): Removed. * dynwind.c (scm_swap_bindings): Likewise. (scm_dowinds): Updated to recognize lists of variables instead of lists of glocs. * __scm.h (SCM_CAUTIOS, SCM_RECKLESS): Update comments.
2001-07-25* tags.h (scm_tc7_variable): New.Marius Vollmer1-0/+3
* gc.c (scm_gc_mark): Handle scm_tc7_variable objects. * print.c (scm_iprin1): Likewise.
2001-07-22* tags.h (SCM_UNBOUND): Make it the 34th isym/iflag, the 33th slot isMarius Vollmer1-1/+2
taken by the new SCM_IM_CALL_WITH_VALUES. * print.c (scm_isymnames): Update table accordingly.
2001-07-09Remove "face-lift" comment.Thien-Thi Nguyen1-2/+0