bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23486: 25.0.93; Modules: features missing from make_function


From: Philipp Stephani
Subject: bug#23486: 25.0.93; Modules: features missing from make_function
Date: Sun, 11 Sep 2016 14:13:43 +0000



Philipp Stephani <p.stephani2@gmail.com> schrieb am Mo., 9. Mai 2016 um 18:39 Uhr:

emacs_env::make_function lacks the following features supported by
`defun':

1. Functions with both optional and rest arguments.
2. Specification of parameter names.
3. Integration with `help-function-arglist'.
4. Specification of interactive forms.
5. Specification of declare forms.
6. Docstrings containing null or non-Unicode characters.

(6) is probably rather unimportant.  (5) is probably not implementable
(would require wrapping `defun', not `lambda').  (1)–(4) are more severe
and quite limit the usefulness of make_function right now; for a
truly generic `defun'-like construct one currently has to eval a `defun'
form wrapping another function.

To solve (1)–(3), I'd propose replacing the "arity" arguments with a
true arglist specification.  This could either be at the C level, e.g.

    ptrdiff_t num_mandatory_args, char** mandatory_arg_names,
    ptrdiff_t num_optional_args, char** optional_arg_names,
    char* rest_arg_name

or by requiring to pass a Lisp argument list.

I've attached a patch for fixing (1)-(4) and (6). 

Attachment: 0001-Introduce-new-module-function-make_function_ext.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]