From aa149bc9e46f79e626a2e3dd36e83fa706bf79bb Mon Sep 17 00:00:00 2001 From: tomo Date: Wed, 21 Jun 2006 15:34:23 +0000 Subject: [PATCH] (Fconcord_define_object): New function. (syms_of_concord): Add new builtin function `concord-define-object'. --- src/concord.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/concord.c b/src/concord.c index 81c6469..f8b37c8 100644 --- a/src/concord.c +++ b/src/concord.c @@ -779,6 +779,31 @@ Return the spec of OBJECT. return concord_object_spec_closure->spec; } +DEFUN ("concord-define-object", Fconcord_define_object, 2, 3, 0, /* +Define an object of which spec is a set of features SPEC. +*/ + (spec, genre, ds)) +{ + Lisp_Object id = Fcdr (Fassq (Q_id, spec)); + Lisp_Object obj; + + if (!NILP (id)) + { + Lisp_Object rest = spec; + Lisp_Object cell; + + obj = Fconcord_make_object (genre, id, ds); + while (!NILP (rest)) + { + cell = Fcar (rest); + Fconcord_object_put (obj, Fcar (cell), Fcdr (cell)); + rest = Fcdr (rest); + } + return obj; + } + return Qnil; +} + struct closure_for_each_object { Lisp_Object function; @@ -990,6 +1015,7 @@ syms_of_concord (void) DEFSUBR (Fconcord_decode_object); DEFSUBR (Fconcord_object_get); DEFSUBR (Fconcord_object_put); + DEFSUBR (Fconcord_define_object); DEFSUBR (Fconcord_object_spec); DEFSUBR (Fconcord_foreach_object_in_feature); } -- 1.7.10.4