From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Re: Oddities with dynamic modules Date: Fri, 12 Oct 2018 10:29:17 -0400 Message-ID: References: <83y3b4wdw9.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1539354513 24965 195.159.176.226 (12 Oct 2018 14:28:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2018 14:28:33 +0000 (UTC) Cc: Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 12 16:28:28 2018 Return-path: Envelope-to: ged-emacs-devel@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 1gAyQW-0006OS-Mc for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2018 16:28:28 +0200 Original-Received: from localhost ([::1]:40985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAySc-0005DP-Ql for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2018 10:30:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAyS0-0005D9-II for emacs-devel@gnu.org; Fri, 12 Oct 2018 10:30:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAyRz-0001My-Pt for emacs-devel@gnu.org; Fri, 12 Oct 2018 10:30:00 -0400 Original-Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]:37876) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gAyRy-0001K0-Ay; Fri, 12 Oct 2018 10:29:58 -0400 Original-Received: by mail-lj1-x22a.google.com with SMTP id 63-v6so11569833ljs.4; Fri, 12 Oct 2018 07:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e0mAlUfgdrgLVA9H9TKwrchdUEw7bX5NKczDMN6GrA4=; b=cZfr29bBi4d0RiTEmDva7hq9GolYZn53cVXHx3ZKzRcjh2GHyj8pTtXbeKBJ5i33rO u9bdwyllT8hT7ssfKegMZf2N0pfeTD3zBETHDnsZWTry3EYAkxr+QCnlcO5eis+wP/NA j1Oist4Yctorho9+xDFqPHQoJniHQQ762zLx35hsZctmErGol1NRiK6ltK4M5xXKwZRg aRP7YDS66odYoGyctSTbd587XWH8aiz7nNquWIM61/Cd73gipD7iltNWz4SDzH16vpli +KumyyLEiRH8bYhqLhmjamhYwGx3qg+GKXMB5Aw15DIWiicY2eOS7GlmnhjMxIIzXkrX QCLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e0mAlUfgdrgLVA9H9TKwrchdUEw7bX5NKczDMN6GrA4=; b=atd9NCgsqA6sCzQBQuqPeLufXwuxfx7jPzoIkDr2pkaJswp9qJw6TrGwSHfdPAG/Zm aA/PCcZFNMinDOyiu+1pylzSGUl+e4nS/pERhob5duzrAijbKLV8CLAGu/W8Sf/3l5sw hwZwtBcoNsVvg6j3afD16b2Y+i0YI+UpMzQcxyJyDDDyTcsMn5+p/oCAIiTsMdUSy/la CtZ6csfVVV1c+L9leCRRW9dZ0OQH13nLrn7KjYfqziT3rGdzJaEpIOvrLjMhpnoKUem7 AQJ318R1g+TR0S9XHvGcEsM+2R+/8h1BVl5wA84nJU7S4CrjSP69Qlo8hUXLSFwK0fD8 yL7Q== X-Gm-Message-State: ABuFfog78cqRyQvvc4nYChtyXLGg2FpW5NBXsb3cT2lIX3u8Y7ZttTjx NC1WThClcRA2gR3JnCeNFPrfV7j4m00Ftwu2hmuL1djs X-Google-Smtp-Source: ACcGV635obdr/l3bbmIOiRbSeHrrl73CPwi7pULFZQZhmXkXhwzMJmTvGjrFYE3gsyzPqwiAW9ou1AwdORkLNt6rdWA= X-Received: by 2002:a2e:45d:: with SMTP id 90-v6mr4291188lje.34.1539354596346; Fri, 12 Oct 2018 07:29:56 -0700 (PDT) In-Reply-To: <83y3b4wdw9.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230350 Archived-At: On Thu, Oct 11, 2018 at 2:14 PM Eli Zaretskii wrote: > > Having written the documentation of the module API, Thanks for writing up all that documentation! https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-26&id=ce8b4584a3c69e5c4abad8a0a9c3781ce8c0c1f8 I am not in the capacity to comment on most of your questions as I am using the Modules feature to get around my lack of C knowledge :) > . Why aren't there API functions to _create_ lists and vectors? > > . Using 'funcall' is unnecessarily cumbersome, because the function > to be called is passed as an 'emacs_value'. Why don't we have a > variant that just accepts a name of a Lisp-callable function as a C > string? +1 I needed to create some sugar syntax in Nim (which compiles to C) to get around that limitation: proc MakeList*(env: ptr emacs_env; listArray: openArray[emacs_value]): emacs_value = ## Return an Emacs-Lisp ``list``. Funcall(env, "list", listArray) proc MakeCons*(env: ptr emacs_env; consCar, consCdr: emacs_value): emacs_value = ## Return an Emacs-Lisp ``cons``. Funcall(env, "cons", [consCar, consCdr]) It would be nice to have API for list (and cons). > . Why does 'intern' only handle pure ASCII symbol names? It's not > like supporting non-ASCII names is hard. > > . I could understand why equality predicates are not provided in the > API, but I don't understand why we do provide 'eq' there. Is it > that much more important than the other predicates? I had the same question too. I find equal more useful than eq.