From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#23486: 25.0.93; Modules: features missing from make_function Date: Sun, 11 Sep 2016 10:57:18 -0400 Message-ID: <87inu21o35.fsf@users.sourceforge.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1473606343 27683 195.159.176.226 (11 Sep 2016 15:05:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2016 15:05:43 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 23486@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 11 17:05:39 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bj6KA-0006dI-1S for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 17:05:38 +0200 Original-Received: from localhost ([::1]:37955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj6K7-0004mA-Nt for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 11:05:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj6Ct-0007Rx-H4 for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 10:58:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bj6Co-0004oB-2i for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 10:58:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj6Cn-0004o7-VT for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 10:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bj6Cn-0000MY-P9 for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 10:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2016 14:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23486 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23486-submit@debbugs.gnu.org id=B23486.14736058261330 (code B ref 23486); Sun, 11 Sep 2016 14:58:01 +0000 Original-Received: (at 23486) by debbugs.gnu.org; 11 Sep 2016 14:57:06 +0000 Original-Received: from localhost ([127.0.0.1]:56542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bj6Bt-0000LO-QS for submit@debbugs.gnu.org; Sun, 11 Sep 2016 10:57:05 -0400 Original-Received: from mail-oi0-f45.google.com ([209.85.218.45]:33725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bj6Br-0000Ku-LR for 23486@debbugs.gnu.org; Sun, 11 Sep 2016 10:57:03 -0400 Original-Received: by mail-oi0-f45.google.com with SMTP id y2so255348431oie.0 for <23486@debbugs.gnu.org>; Sun, 11 Sep 2016 07:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=0bagMmrFtiOodiNkdyutbbcFDK7/4fNBIQ3Tq4W4zSE=; b=E8fOo/+vDX0k4Pp/k8RUrlkpxvjf6aDkehmS2x2O3WdZBzM7GWqZIGkivAS4xXj5oa G1xBf/CZMvSml1UhhnLkFfKyOl3Ig9JtC6Wy6gS1AOYJ1LD4+YHeDe8WEnZhm/t4H2d5 f1gr5NcyOwRqlqCrqopVYb+pM8VfI+iVWxZx87oG2wAKX6AQ5YpgV6b7jumxVLMRFz3P 5Wn6NnhqqDXSTZ3E1gOJ/t1qfjOzGrH4/U+1vk6mzCrSZCndM7EkHPb0yfhuhmDLA+Zv vVBYZE0oMAI4ZZGInwhoXZqz+xBSnFh6PQ1YgfHNtAWJpEAcbTfAfDXRi1cWapbYcXLS TYjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=0bagMmrFtiOodiNkdyutbbcFDK7/4fNBIQ3Tq4W4zSE=; b=Rrxv642hQmhpZkHcFayDDSQDBJDT5u3FmTjCwH0czh1DoWX0DsXuZM83xCPBeGNr0Y IYRd06/y34c8Vn88GuUiwu8gvTIi9dvIaBTBNh0OWDsr5SqJ+IO3Hkzz2idI7BVWlyZp H4jxMIy8/79esJbZkhSpmqWYy+rfOehf+92G2MpNyc7BC1LGqep94osWTz329hwIl4FE W9TTw7kOaTqaj5t6Z72edd8sNEmNnpEJuEgHu909PunFAOiNUr2sHWRqK/3pzVGJOS6y 2ODKvN0Jkt8GSWN+VDVzlLNnUCRagCxF4MV8u7WsjGxeajbiy62Qik+2as913rDldFvF KSZg== X-Gm-Message-State: AE9vXwOu8CS9L+UDX+vj85QjxkTeoXkkc7qpWkpfuyPT8oh7VoGpKWNSAfBj/Bj8AqgDKA== X-Received: by 10.202.92.197 with SMTP id q188mr18968399oib.79.1473605817937; Sun, 11 Sep 2016 07:56:57 -0700 (PDT) Original-Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id w71sm7545282ith.2.2016.09.11.07.56.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Sep 2016 07:56:57 -0700 (PDT) In-Reply-To: (Philipp Stephani's message of "Mon, 09 May 2016 18:37:58 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:123171 Archived-At: Philipp Stephani writes: > 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)=E2=80=93(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. Shouldn't modules be providing a DEFUN-like construct instead? That is, I thought the idea of modules was to enable writing primitive subroutines. > > To solve (1)=E2=80=93(3), I'd propose replacing the "arity" arguments wit= h 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. > > To solve (4) I'd propose to pass another value for the interactive form, > probably as emacs_value* (to support non-interactive functions). > > As an alternative, if people feel this would require too many > parameters, I'd propose reverting the change that adds the documentation > string. A docstring without arglist is not very useful. We could also > remove the arity parameters and have the C function check the arity > itself. I think adding "(fn ARG1 ARG2...)" to the docstring would solve (1)-(3). What's lacking is a way to add this automagically like DEFUN does. And getting the parameters in C variables like DEFUN would also be nice.