1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
Commit graph

84 commits

Author SHA1 Message Date
Andy Wingo
69990c4532 Deprecate libguile/validate.h
* libguile/validate.h: Replace contents with a #warning.
2018-06-18 10:50:23 +02:00
Andy Wingo
6f294ecc75 Devolve more validate macros
* libguile.h: Add chooks.h.
* libguile/Makefile.am: Add chooks.h and chooks.c.
* libguile/chooks.c:
* libguile/chooks.h: New files, for the C implementation of hooks.
  Broken out to avoid cycles in gc.h includes.
* libguile/gc.h:
* libguile/gc.c (scm_i_gc_admin_mutex, scm_i_sweep_mutex): Remove unused
  mutexes.  Include chooks instead of hooks in the main header.
* libguile/deprecated.h (scm_gc_running_p): Deprecate this macro always
  defined to 0.
  (SCM_VALIDATE_VECTOR_OR_DVECTOR): Deprecate this weird one too.
* libguile/array-map.c: Add procs.h include.
* libguile/threads.h:
* libguile/vm.c:
* libguile/r6rs-ports.c: Add smob.h include.
* libguile/atomic.h (SCM_VALIDATE_ATOMIC_BOX): Devolve.
* libguile/deprecation.c (scm_c_issue_deprecation_warning): Remove use
  of scm_gc_running_p.
* libguile/error.c (scm_error_scm): Remove use of scm_gc_running_p.
* libguile/filesys.h (SCM_VALIDATE_DIR)
* libguile/fluids.h (SCM_VALIDATE_FLUID)
* libguile/fports.h (SCM_VALIDATE_FPORT, SCM_VALIDATE_OPFPORT)
* libguile/generalized-arrays.h (SCM_VALIDATE_ARRAY)
* libguile/hooks.h (SCM_VALIDATE_HOOK)
* libguile/keywords.h (SCM_VALIDATE_KEYWORD)
* libguile/ports.h (SCM_VALIDATE_PORT, SCM_VALIDATE_INPUT_PORT)
  (SCM_VALIDATE_OUTPUT_PORT, SCM_VALIDATE_OPINPORT)
  (SCM_VALIDATE_OPENPORT, SCM_VALIDATE_OPPORT, SCM_VALIDATE_OPOUTPORT)
* libguile/procs.h (SCM_VALIDATE_PROC)
* libguile/random.h (SCM_VALIDATE_RSTATE)
* libguile/regex-posix.h (SCM_VALIDATE_RGXP)
* libguile/stacks.h (SCM_VALIDATE_STACK, SCM_VALIDATE_FRAME)
* libguile/strports.h (SCM_VALIDATE_OPOUTSTRPORT)
* libguile/struct.h (SCM_VALIDATE_STRUCT SCM_VALIDATE_VTABLE)
* libguile/symbols.h (SCM_VALIDATE_SYMBOL)
* libguile/variable.h (SCM_VALIDATE_VARIABLE)
* libguile/vectors.h (SCM_VALIDATE_VECTOR SCM_VALIDATE_VECTOR_LEN):
  Devolve.
* libguile/validate.h: It's empty now!

hooks squish
2018-06-18 10:50:17 +02:00
Andy Wingo
8a6f46ee96 More validate.h devolution
* libguile/validate.h:
* libguile/alist.h (SCM_VALIDATE_ALISTCELL, SCM_VALIDATE_ALISTCELL_COPYSCM)
* libguile/bytevectors.h (SCM_VALIDATE_BYTEVECTOR)
* libguile/chars.h (SCM_VALIDATE_CHAR, SCM_VALIDATE_CHAR_COPY):
* libguile/print.h (SCM_VALIDATE_OPORT_VALUE, SCM_VALIDATE_PRINTSTATE):
* libguile/procs.h (SCM_VALIDATE_THUNK)
* libguile/smob.h (SCM_VALIDATE_SMOB)
* libguile/strings.h (SCM_VALIDATE_STRING): Devolve these macros from
  validate.h.
2018-06-18 09:44:35 +02:00
Andy Wingo
be18b50773 Move pair, null, nil, and boolean validators out of validate.h
* libguile/validate.h:
* libguile/boolean.h (SCM_VALIDATE_BOOL, SCM_VALIDATE_BOOL_COPY):
* libguile/pairs.h (SCM_VALIDATE_NULL, SCM_VALIDATE_NULL_OR_NIL):
  (SCM_VALIDATE_CONS, SCM_VALIDATE_MUTABLE_PAIR)
  (SCM_VALIDATE_NULLORCONS): Move these macros.
2018-06-17 22:49:59 +02:00
Andy Wingo
eb5e1b8d5f Remove public SCM_VALIDATE_NIM
* libguile/random.c (scm_random): Remove needless use of
  SCM_VALIDATE_NIM.
* libguile/srcprop.c (SCM_VALIDATE_NIM): Move definition here, as this
  file is its only use.
* libguile/validate.h (SCM_VALIDATE_NIM): Remove.  This was public but
  unlikely to be used in the wild.
2018-06-17 22:42:20 +02:00
Andy Wingo
82d5662887 Move list validators to list.h
* libguile/validate.h:
* libguile/list.h (SCM_VALIDATE_REST_ARGUMENT, SCM_VALIDATE_LIST)
  SCM_VALIDATE_NONEMPTYLIST, SCM_VALIDATE_LIST_COPYLEN)
  SCM_VALIDATE_NONEMPTYLIST_COPYLEN): Move here from validate.h.
2018-06-17 22:39:32 +02:00
Andy Wingo
cd292b3bd9 Remove unused macros
* libguile/validate.h (SCM_MUST_MALLOC_TYPE, SCM_MUST_MALLOC_TYPE_NUM)
  (SCM_MUST_MALLOC): Remove unused macros.  scm_must_malloc was removed
  in Guile 2.0.
2018-06-17 22:35:03 +02:00
Andy Wingo
bdd66fdd24 Move more number validators to numbers.h.
* libguile/validate.h:
* libguile/numbers.h (SCM_OUT_OF_RANGE, SCM_ASSERT_RANGE)
  SCM_VALIDATE_REAL, SCM_VALIDATE_NUMBER, SCM_VALIDATE_USHORT_COPY)
  SCM_VALIDATE_SHORT_COPY, SCM_VALIDATE_UINT_COPY)
  SCM_VALIDATE_INT_COPY, SCM_VALIDATE_ULONG_COPY)
  SCM_VALIDATE_LONG_COPY, SCM_VALIDATE_SIZE_COPY)
  SCM_VALIDATE_FLOAT_COPY, SCM_VALIDATE_DOUBLE_COPY)
  SCM_VALIDATE_DOUBLE_DEF_COPY): Move here, from validate.h.
2018-06-17 22:32:08 +02:00
Andy Wingo
d10c3aa3cd Move number validators to numbers.h.
* libguile/validate.h:
* libguile/numbers.h (SCM_NUM2SIZE, SCM_NUM2SIZE_DEF, SCM_NUM2PTRDIFF)
  SCM_NUM2PTRDIFF_DEF, SCM_NUM2SHORT, SCM_NUM2SHORT_DEF, SCM_NUM2USHORT)
  SCM_NUM2USHORT_DEF, SCM_NUM2INT, SCM_NUM2INT_DEF, SCM_NUM2UINT)
  SCM_NUM2UINT_DEF, SCM_NUM2ULONG, SCM_NUM2ULONG_DEF, SCM_NUM2LONG)
  SCM_NUM2LONG_DEF, SCM_NUM2LONG_LONG, SCM_NUM2LONG_LONG_DEF)
  SCM_NUM2ULONG_LONG, SCM_NUM2ULONG_LONG_DEF, SCM_NUM2FLOAT)
  SCM_NUM2DOUBLE): Move these here, from validate.h.
2018-06-17 22:28:13 +02:00
Andy Wingo
87896eb3e6 Move core validate macros to error.h
* libguile/error.h (SCM_MAKE_VALIDATE, (SCM_I_MAKE_VALIDATE_MSG2)
  (SCM_MAKE_VALIDATE_MSG, SCM_SYSERROR, SCM_MEMORY_ERROR)
  (SCM_SYSERROR_MSG, SCM_MISC_ERROR, SCM_WRONG_NUM_ARGS)
  (SCM_WRONG_TYPE_ARG): Move here, from validate.h.
* libguile/validate.h: Include error.h.
2018-06-17 22:24:12 +02:00
Andy Wingo
6e573a0885 Attempt to mutate residualized literal pair throws exception
* libguile/validate.h (SCM_VALIDATE_MUTABLE_PAIR):
* libguile/pairs.h (scm_is_mutable_pair): New internal definitions.
* libguile/pairs.c (scm_set_car_x, scm_set_cdr_x): Validate mutable
  pairs.
* libguile/alist.c (scm_assq_set_x, scm_assv_set_x, scm_assoc_set_x):
* libguile/list.c (scm_reverse_x, scm_list_set_x, scm_list_cdr_set_x):
* libguile/srcprop.c (scm_make_srcprops):
* libguile/srfi-1.c (scm_srfi1_append_reverse_x)
  (scm_srfi1_delete_duplicates_x):
* libguile/symbols.c (scm_symbol_fset_x, scm_symbol_pset_x):
* libguile/sort.c (scm_merge_list_x): Use scm_set_car_x / scm_set_cdr_x
  instead of the macros, so as to check for mutable pairs.
  (SCM_VALIDATE_MUTABLE_LIST): New internal helper macro.
  (scm_sort_x, scm_stable_sort_x, scm_sort_list_x): Use
  SCM_VALIDATE_MUTABLE_LIST.
* libguile/vm-engine.c (VM_VALIDATE_MUTABLE_PAIR): New definition.
  (set-car!, set-cdr!): Use VM_VALIDATE_MUTABLE_PAIR.  Fix error message
  for set-cdr!.
2017-04-18 21:27:45 +02:00
Andy Wingo
3425290a7b Add atomic boxes
* doc/ref/api-scheduling.texi (Atomics): New manual section.
* libguile.h: Include atomic.h.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Add atomic.
* libguile/atomic.c:
* libguile/atomic.h: New files.
* libguile/atomics-internal.h (scm_atomic_set_scm, scm_atomic_ref_scm)
  (scm_atomic_swap_scm, scm_atomic_compare_and_swap_scm): New
  facilities.
* libguile/goops.c (class_atomic_box, scm_sys_goops_early_init): Add
  support for <atomic-box>.  Remove duplicate <keyword> fetch.
* libguile/init.c (scm_i_init_guile): Call scm_register_atomic_box.
* libguile/print.c (iprin1): Add atomic box case.
* libguile/tags.h (scm_tc7_atomic_box): New tag.
* libguile/validate.h (SCM_VALIDATE_ATOMIC_BOX): New macro.
* module/Makefile.am (SOURCES): Add ice-9/atomic.scm.
* module/ice-9/atomic.scm: New file.
* module/oop/goops.scm (<atomic-box>): New var.
2016-09-06 11:16:53 +02:00
Andy Wingo
086bbcc874 Merge commit 'fdd319e9bd' 2015-01-22 13:04:34 +01:00
Mark H Weaver
fdd319e9bd Add SCM_VALIDATE_SIZE_COPY and SCM_NUM2SIZE.
* libguile/validate.h (SCM_VALIDATE_SIZE_COPY, SCM_NUM2SIZE): New
  macros.
2014-11-12 00:19:10 -05:00
Daniel Llorens
d747313100 Change uses of scm_is_simple_vector to scm_is_vector
* libguile/filesys.c, libguile/random.c, libguile/stime.c, libguile/trees.c,
  libguile/validate.h: use scm_is_vector instead of scm_is_simple_vector.
* libguile/sort.c (scm_sort_x, scm_sort, scm_stable_sort_x)
  (scm_stable_sort): Remove scm_is_vector check; scm_is_array is
  sufficient.
* test-suite/tests/arrays.test: Fix header.
* test-suite/tests/random.test: New coverage test covering
  random:normal-vector!.
* test-suite/Makefile.am: Include random.test in make check.
2014-02-08 18:26:49 +01:00
Andy Wingo
0720f70ed7 Memoized expressions are pairs, not SMOBs
* libguile/memoize.c (MAKMEMO): Memoized objects are pairs now, not
  SMOBs.  This lets eval.scm destructure them more efficiently.
  (scm_print_memoized, scm_memoized_p, scm_memoized_expression_typecode)
  (scm_memoized_expression_data): Remove these interfaces.
  (unmemoize, scm_memoize_variable_access_x): Remove SMOB type checks.
  (scm_init_memoize): Remove SMOB type definition.

* libguile/memoize.h (scm_tc16_memoized, SCM_MEMOIZED_P)
  (scm_memoized_expression_typecode, scm_memoized_expression_data)
  (scm_memoized_p): Remove declarations.

* libguile/validate.h (SCM_VALIDATE_MEMOIZED): Remove declaration.

* libguile/eval.c (eval): Remove memoized type check, and inline the
  inum unpacking.

* module/ice-9/eval.scm (memoized-expression-case): Use car and cdr to
  destructure memoized expressions.  A big win!
2013-10-27 09:52:39 +01:00
Mark H Weaver
fd57bbf5ac Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/validate.h
2012-11-05 15:57:03 -05:00
Ludovic Courtès
93825c9f06 Have SCM_NUM2FLOAT' and SCM_NUM2DOUBLE' use `scm_to_double'.
* libguile/validate.h (SCM_NUM2FLOAT, SCM_NUM2DOUBLE): Use
  `scm_to_double' instead of the deprecated functions.  Reported by
  Aleix Conchillo Flaqué <aconchillo@gmail.com>.
2012-11-05 19:16:09 +01:00
Andy Wingo
8c5bb72920 add SCM_HEAP_OBJECT_P
* libguile/tags.h (SCM_HEAP_OBJECT_P): New macro, an alias for
  SCM_NIMP.

* libguile/arrays.c:
* libguile/debug.c:
* libguile/foreign.c:
* libguile/gdbint.c:
* libguile/guardians.c:
* libguile/list.c:
* libguile/modules.c:
* libguile/options.c:
* libguile/smob.c:
* libguile/validate.h:
* libguile/weak-set.c:
* libguile/weak-table.c:
* libguile/weak-vector.c: Use it instead of SCM_NIMP or !SCM_IMP.
2011-10-24 18:55:43 +02:00
Andy Wingo
0e163c06f2 SCM_VALIDATE_SMOB uses SCM_SMOB_PREDICATE
* libguile/validate.h (SCM_VALIDATE_SMOB): Change to use
  SCM_SMOB_PREDICATE instead of SCM_TYP16_PREDICATE.
2009-12-08 23:13:20 +01:00
Andy Wingo
314b87163e eval.c closures are now applicable smobs, not tc3s
* libguile/debug.c (scm_procedure_name): Remove a SCM_CLOSUREP case and
  some dead code.
  (scm_procedure_module): Remove. This was introduced a few months ago
  for the hygienic expander, but now it is no longer needed, as the
  expander keeps track of this information itself.

* libguile/debug.h: Remove scm_procedure_module.

* libguile/eval.c: Instead of using tc3 closures, define a "boot
  closure" applicable smob type, and represent closures with that. The
  advantage is that after eval.scm is compiled, boot closures take up no
  address space (besides a smob number) in the runtime, and require no
  special cases in procedure dispatch.

* libguile/eval.h: Remove the internal functions scm_i_call_closure_0
  and scm_closure_apply, and the public function scm_closure.

* libguile/gc.c (scm_storage_prehistory): No tc3_closure displacement
  registration.
  (scm_i_tag_name): Remove closure case, and a dead cclo case.

* libguile/vm.c (apply_foreign):
* libguile/print.c (iprin1):
* libguile/procs.c (scm_procedure_p, scm_procedure_documentation);
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/goops.c (scm_class_of): Remove tc3_closure/tcs_closure cases.
* libguile/hash.c (scm_hasher):

* libguile/hooks.c (scm_add_hook_x): Use new scm_i_procedure_arity.

* libguile/macros.c (macro_print): Print all macros using the same code.
  (scm_macro_transformer): Return any procedure, not just programs.

* libguile/procprop.h:
* libguile/procprop.c (scm_i_procedure_arity): Instead of returning a
  list that the caller has to parse, have the same prototype as
  scm_i_program_arity. An incompatible change, but it's an internal
  function anyway.
  (scm_procedure_properties, scm_set_procedure_properties)
  (scm_procedure_property, scm_set_procedure_property): Remove closure
  cases, and use scm_i_program_arity for arity.

* libguile/procs.h (SCM_CLOSUREP, SCM_CLOSCAR, SCM_CODE)
  (SCM_CLOSURE_NUM_REQUIRED_ARGS, SCM_CLOSURE_HAS_REST_ARGS)
  (SCM_CLOSURE_BODY, SCM_PROCPROPS, SCM_SETPROCPROPS, SCM_ENV)
  (SCM_TOP_LEVEL): Remove these macros that pertain to boot closures
  only. Only eval.c should know abut boot closures.
* libguile/procs.c (scm_closure_p): Remove this function. There is a
  simple stub in deprecated.scm now.
  (scm_thunk_p): Use scm_i_program_arity.
* libguile/tags.h (scm_tc3_closure): Remove. Yay, another tc3 to play
  with!
  (scm_tcs_closures): Remove.

* libguile/validate.h (SCM_VALIDATE_CLOSURE): Remove.

* module/ice-9/deprecated.scm (closure?): Add stub.

* module/ice-9/documentation.scm (object-documentation)
* module/ice-9/session.scm (help-doc, arity)
* module/oop/goops.scm (compute-getters-n-setters)
* module/oop/goops/describe.scm (describe)
* module/system/repl/describe.scm (display-object, display-type):
  Remove calls to closure?.
2009-12-04 19:20:11 +01:00
Andy Wingo
b7742c6b71 new evaluator, y'all
* libguile/eval.c: So, ladies & gents, a new evaluator. It's similar to
  the old one, in that we memoize and then evaluate, but in this
  incarnation, memoization of an expression happens before evaluation,
  not lazily as the expression is evaluated. This makes the evaluation
  itself much cleaner, in addition to being threadsafe. In addition,
  since this C evaluator will in the future just serve to bootstrap the
  Scheme evaluator, we don't have to pay much concern for debugging
  conveniences. So the environment is just a list of values, and the
  memoizer pre-computes where it's going to find each individual value
  in the environment.

  Interface changes are commented below, with eval.h.

  (scm_evaluator_traps): No need to reset the debug mode after rnning te
  traps thing. But really, the whole traps system needs some love.

* libguile/memoize.h:
* libguile/memoize.c: New memoizer, which runs before evaluation,
  checking all syntax before evaluation begins. Significantly, no
  debugging information is left for lexical variables, which is not so
  great for interactive debugging; perhaps we should change this to have
  a var list in the future as per the classic interpreters. But it's
  quite fast, and the resulting code is quite good. Also note that it
  doesn't produce ilocs, memoized code is a smob whose type is in the
  first word of the smob itself.

* libguile/eval.h (scm_sym_and, scm_sym_begin, scm_sym_case)
  (scm_sym_cond, scm_sym_define, scm_sym_do, scm_sym_if, scm_sym_lambda)
  (scm_sym_let, scm_sym_letstar, scm_sym_letrec, scm_sym_quote)
  (scm_sym_quasiquote, scm_sym_unquote, scm_sym_uq_splicing, scm_sym_at)
  (scm_sym_atat, scm_sym_atapply, scm_sym_atcall_cc)
  (scm_sym_at_call_with_values, scm_sym_delay, scm_sym_eval_when)
  (scm_sym_arrow, scm_sym_else, scm_sym_apply, scm_sym_set_x)
  (scm_sym_args): Remove public declaration of these symbols.
  (scm_ilookup, scm_lookupcar, scm_eval_car, scm_eval_body)
  (scm_eval_args, scm_i_eval_x, scm_i_eval): Remove public declaration
  of these functions.
  (scm_ceval, scm_deval, scm_ceval_ptr): Remove declarations of these
  deprecated functions.
  (scm_i_print_iloc, scm_i_print_isym, scm_i_unmemocopy_expr)
  (scm_i_unmemocopy_body): Remove declarations of these internal
  functions.
  (scm_primitive_eval_x, scm_eval_x): Redefine as macros for their less
  destructive siblings.

* libguile/Makefile.am: Add memoize.[ch] to the build.

* libguile/debug.h (scm_debug_mode_p, scm_check_entry_p)
  (scm_check_apply_p, scm_check_exit_p, scm_check_memoize_p)
  (scm_debug_eframe_size): Remove these vars that were tied to the old
  evaluator's execution model.
  (SCM_RESET_DEBUG_MODE): Remove, no more need for this.
  (SCM_MEMOIZEDP, SCM_MEMOIZED_EXP, SCM_MEMOIZED_ENV): Remove macros
  referring to old memoized code representation.
  (scm_local_eval, scm_procedure_environment, scm_memoized_environment)
  (scm_make_memoized, scm_memoized_p): Remove functions operating on old
  memoized code representation.
  (scm_memcons, scm_mem_to_proc, scm_proc_to_mem): Remove debug-only
  code for old evaluator.

* libguile/debug.c: Remove code to correspond with debug.h removals.
  (scm_debug_options): No need to set the debug mode or frame limit
  here, as we don't have C stack limits any more. Perhaps this is a bug,
  but as long as we can compile eval.scm, we should be fine.

* libguile/init.c (scm_i_init_guile): Init memoize.c.

* libguile/modules.c (scm_top_level_env, scm_env_top_level)
  (scm_env_module, scm_system_module_env_p): Remove these functions.

* libguile/print.c (iprin1): No more need to handle isyms. Adapt to new
  form of interpreted procedures.

* libguile/procprop.c (scm_i_procedure_arity): Adapt to new form of
  interpreted procedures.

* libguile/procs.c (scm_thunk_p): Adapt to new form of interpreted
  procedures.
* libguile/procs.h (SCM_CLOSURE_FORMALS): Removed, this exists no more.
  (SCM_CLOSURE_NUM_REQUIRED_ARGS, SCM_CLOSURE_HAS_REST_ARGS): New
  accessors.

* libguile/srcprop.c (scm_source_properties, scm_source_property)
  (scm_set_source_property_x): Remove special cases for memoized code.

* libguile/stacks.c (read_frame): Remove a source-property case for
  interpreted code.
  (NEXT_FRAME): Remove a case that I don't fully understand, that seems
  to be designed to skip over apply frames. Will be obsolete in the
  futures.
  (read_frames): Default source value for interpreted frames to #f.
  (narrow_stack): Don't pay attention to the system_module thing.

* libguile/tags.h: Remove isyms and ilocs. Whee!

* libguile/validate.h (SCM_VALIDATE_MEMOIZED): Fix to use the new
  MEMOIZED_P formulation.

* module/ice-9/psyntax-pp.scm (do, quasiquote, case): Adapt for these no
  longer being primitive macros.
* module/ice-9/boot-9.scm: Whitespace change, but just a poke to force a
  rebuild due to and/or/cond/... not being primitives any more.

* module/ice-9/deprecated.scm (unmemoize-expr): Deprecate, it's
  unmemoize-expression now.

* test-suite/tests/eval.test ("define set procedure-name"): XFAIL a
  couple of tests here; I don't know what to do about them. I reckon the
  expander should ensure that defined values are named.

* test-suite/tests/chars.test ("basic char handling"): Fix expected
  exception when trying to apply a char.
2009-12-01 21:00:26 +01:00
Andy Wingo
092d7704be SCM_VALIDATE_VTABLE tweak
* libguile/validate.h (SCM_VALIDATE_VTABLE): Simply call
  scm_struct_vtable_p.
2009-11-15 20:28:12 +01:00
Ludovic Courtès
807e5a6641 Use a TC7 tag instead of a SMOB for bytevectors.
* libguile/bytevectors.c (scm_tc16_bytevector): Remove.
  (SCM_BYTEVECTOR_SET_LENGTH, SCM_BYTEVECTOR_SET_CONTENTS,
  SCM_BYTEVECTOR_SET_INLINE, SCM_BYTEVECTOR_SET_ELEMENT_TYPE,
  make_bytevector_from_buffer, scm_is_bytevector,
  scm_bootstrap_bytevectors): Adjust to the SMOB->tc7 change.
  (scm_i_print_bytevector): New, formerly `print_bytevector ()'.
  (bytevector_equal_p): Remove.

* libguile/bytevectors.h (SCM_BYTEVECTOR_LENGTH,
  SCM_BYTEVECTOR_CONTENTS, SCM_BYTEVECTOR_P): Adjust to SMOB->tc7
  change.
  (SCM_BYTEVECTOR_FLAGS, SCM_SET_BYTEVECTOR_FLAGS): New macros.
  (scm_tc16_bytevector): Remove declaration.
  (scm_i_print_bytevector): New declaration.

* libguile/eq.c (scm_equal_p): Handle `scm_tc7_bytevector'.

* libguile/evalext.c (scm_self_evaluating_p): Likewise.

* libguile/print.c (iprin1): Likewise.

* libguile/tags.h (scm_tc7_bytevector): New.
  (scm_tc7_unused_8): Remove.

* libguile/validate.h (SCM_VALIDATE_BYTEVECTOR): Adjust.

* test-suite/tests/bytevectors.test ("Datum
  Syntax")["self-evaluating?"]: New test.
2009-08-30 20:12:09 +02:00
Neil Jerram
53befeb700 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/*
)
2009-06-17 00:22:09 +01:00
Ludovic Courtès
1ee2c72eaf Import R6RS bytevectors and I/O ports from Guile-R6RS-Libs 0.2.
* README: Document dependency on GNU libunistring.

* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
  `benchmark/bytevectors.bm'.

* configure.in: Make sure we have libunistring; update $LIBS.

* libguile.h: Include "bytevectors.h" and "r6rs-ports.h".

* libguile/Makefile.am (libguile_la_SOURCES): Add `bytevectors.c' and
  `r6rs-ports.c'
  (DOT_X_FILES): Add `bytevectors.x' and `r6rs-ports.x'.
  (DOT_DOC_FILES): Add `bytevectors.doc' and `r6rs-ports.doc'.
  (noinst_HEADERS): Add `ieee-754.h'.
  (modinclude_HEADERS): Add `bytevectors.h' and `r6rs-ports.h'

* libguile/validate.h (SCM_VALIDATE_BYTEVECTOR): New macro.

* module/Makefile.am (SOURCES): Add $(RNRS_SOURCES).
  (RNRS_SOURCES): New variable.

* test-suite/Makefile.am (SCM_TESTS): Add `bytevectors.test' and
  `r6rs-ports.test'.
2009-05-28 23:12:01 +02:00
Andy Wingo
9082ff2d90 avoid deprecated functions in SCM_VALIDATE_VECTOR_LEN
* libguile/validate.h (SCM_VALIDATE_VECTOR_LEN): Don't use deprecated
  functions.
2009-02-17 15:58:24 +01:00
Ludovic Courtès
9cc37597af Changes from arch/CVS synchronization 2007-12-08 16:00:56 +00:00
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
9de87eea47 See ChangeLog from 2005-03-02. 2005-03-02 20:42:01 +00:00
Marius Vollmer
f60539dba4 (SCM_VALIDATE_VECTOR, SCM_VALIDATE_VECTOR_OR_DVECTOR): use
scm_is_simple_vector instead of SCM_VECTORP.
2005-01-02 20:46:03 +00:00
Marius Vollmer
df47dca314 (SCM_VALIDATE_VECTOR_OR_DVECTOR): Accept f64vectors instead of the
old-style dvectors.
2004-11-02 19:46:29 +00:00
Marius Vollmer
d2e53ed6f8 *** empty log message *** 2004-09-22 17:41:37 +00:00
Marius Vollmer
cc95e00ac6 * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
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-19 17:19:44 +00:00
Marius Vollmer
6f14f578d2 * strings.h, strings.c (scm_i_get_substring_spec): New.
* socket.c, rw.c, deprecated.h, validate.h
(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.
2004-08-12 17:43:41 +00:00
Marius Vollmer
b9bd8526f0 * numbers.h, numbers.c, discouraged.h, discouraged.c (scm_short2num,
scm_ushort2num, scm_int2num, scm_uint2num, scm_long2num,
scm_ulong2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
scm_num2ushort, scm_num2int, scm_num2uint, scm_num2long,
scm_num2ulong, scm_num2size, scm_num2ptrdiff, scm_long_long2num,
scm_ulong_long2num, scm_num2long_long, scm_num2ulong_long):
Discouraged by moving to discouraged.h and discouraged.c and
reimplementing in terms of scm_from_* and scm_to_*.  Changed all uses
to the new scm_from_* and scm_to_* functions.
2004-08-02 16:14:04 +00:00
Marius Vollmer
bc36d0502b * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into
deprecated.h.  Replaced all uses with scm_is_eq.
2004-07-27 15:41:49 +00:00
Marius Vollmer
8805b77dd0 (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY, SCM_VALIDATE_BIGINT,
SCM_VALIDATE_INUM_MIN, SCM_VALIDATE_INUM_MIN_COPY,
SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF,
SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE,
SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the
fixnum/bignum distinction visible.  Changed all uses to scm_to_size_t
or similar.
2004-07-10 13:47:02 +00:00
Marius Vollmer
93ccaef0c6 * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
SCM_I_MAKINUM and changed all uses.
2004-07-08 15:58:11 +00:00
Marius Vollmer
7888309be8 * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
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-07-06 10:59:25 +00:00
Marius Vollmer
73be1d9e8e Changed license terms to the plain LGPL thru-out. 2003-04-05 19:15:35 +00:00
Marius Vollmer
1d798a004a (SCM_VALIDATE_THREAD): Moved to threads.h. 2002-12-02 01:00:50 +00:00
Marius Vollmer
6182ceacb4 (SCM_MAKE_VALIDATE_MSG): New. Use it instead of SCM_MAKE_VALIDATE in
lots of places to gove better error messages.  Thanks to Bill
Schottstaedt!
2002-10-20 22:59:01 +00:00
Han-Wen Nienhuys
34d19ef643 2002-07-20 Han-Wen <hanwen@cs.uu.nl>
* *.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-07-20 14:08:34 +00:00
Neil Jerram
c96d76b88d * First batch of libguile changes for Elisp support.
* Fixed a few typos.
* Minor rationalization of macros relating to source breakpoints.
2002-01-22 23:31:39 +00:00
Mikael Djurfeldt
68665a9708 * validate.h (SCM_VALIDATE_DOUBLE_DEF_COPY): New macro. 2001-10-12 08:55:05 +00:00
Mikael Djurfeldt
581ded70a3 * validate.h (SCM_NUM2FLOAT, SCM_NUM2DOUBLE,
SCM_VALIDATE_FLOAT_COPY, SCM_VALIDATE_DOUBLE_COPY): New
macros. (The NUM names might soon change.)

* numbers.h: Added missing declarations.
2001-09-23 21:25:26 +00:00
Dirk Herrmann
b29058ffee * Remove deprecated macros and typenames.
* Rename header macros to SCM_<filename>_H.
* Prefer !SCM_<foo> over SCM_N<foo>.
2001-08-31 11:17:06 +00:00
Thien-Thi Nguyen
d098d810cf (SCM_VALIDATE_USHORT_COPY, SCM_VALIDATE_SHORT_COPY,
SCM_VALIDATE_UINT_COPY, SCM_VALIDATE_INT_COPY): New macros.
Thanks to Chris Cramer.
2001-08-25 18:22:50 +00:00