From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Mon, 28 Sep 2015 18:12:13 +0200 Message-ID: References: <55DE75FD.8020308@cs.ucla.edu> <55F5DD8C.70506@dancol.org> <55F62C16.4000105@dancol.org> <55F64F04.9030002@dancol.org> <55F6E43E.9030502@dancol.org> <55F70C4E.8030805@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1443487198 8469 80.91.229.3 (29 Sep 2015 00:39:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Sep 2015 00:39:58 +0000 (UTC) Cc: Daniel Colascione , Emacs development discussions , Paul Eggert , Stefan Monnier , Tom Tromey , Stephen Leake To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 29 02:39:53 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZgixS-0001v8-Of for ged-emacs-devel@m.gmane.org; Tue, 29 Sep 2015 02:39:50 +0200 Original-Received: from localhost ([::1]:43046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgixS-0002Tq-1w for ged-emacs-devel@m.gmane.org; Mon, 28 Sep 2015 20:39:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgb2I-0001Bq-63 for emacs-devel@gnu.org; Mon, 28 Sep 2015 12:12:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zgb2E-0005o0-2T for emacs-devel@gnu.org; Mon, 28 Sep 2015 12:12:18 -0400 Original-Received: from mail-ig0-x22a.google.com ([2607:f8b0:4001:c05::22a]:32794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgb2D-0005nr-US for emacs-devel@gnu.org; Mon, 28 Sep 2015 12:12:14 -0400 Original-Received: by igbkq10 with SMTP id kq10so59325568igb.0 for ; Mon, 28 Sep 2015 09:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=O6Drwgzsty3q5hfGgJpk9Zyy2AU10slpPlOAy1UziXI=; b=olrmYrjCC02QtP/dh6cGX4Q0xG5rUIX+ZY+A+II5nFFSi4Vz/3Q/mJktZlROpWEfs6 YGTlHt+09CfBRXnkFbOAGlBtXkcl5VosL8jr3AYcHSE0C+HIArCua7YwR0mil1b3Wt45 03JDQR7kUqRFeq5WNR3p/w52iqdj3h6qJX0pkGcm/GWWYf597yzliGdDX84fjwkgyd1C nOYiChMAYfaqHyBkaMcpNgevjii6/t5gE/q+Av25PGcUQ+Xo18jeX2HaZjXt+0pVww+v 6vm/KPNi0W64TB8aEeIKdIaakDXPH20NMKJ+kcqMGZeejXNreNM3wOkfh+QoCffU3jyp St1w== X-Received: by 10.50.17.9 with SMTP id k9mr7673965igd.97.1443456733426; Mon, 28 Sep 2015 09:12:13 -0700 (PDT) Original-Received: by 10.36.146.193 with HTTP; Mon, 28 Sep 2015 09:12:13 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: l_Z29xBF7uFL9gxwTAT8-O80eHE X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:190450 Archived-At: On Mon, Sep 28, 2015 at 5:42 PM, Philipp Stephani wrote: > What is the use case for this? Is the "user_ptr" functionality really > needed? Most libraries creates opaque pointers type you re-use for each calls. See some libarchive samples for example [1] Imagine porting libarchive to emacs as a module. You would use a struct archive pointer stored as a user pointer in an Emacs value. And the new lisp functions would be very similar to the libarchive API i.e. taking the struct archive handle as a parameter. We might not have deteminist finalizer but we could come up with a lisp macro similar to Python 'with' keyword [2] that would set up an unwind-protect that calls the finalizer. 1: https://github.com/libarchive/libarchive/wiki/Examples#List_contents_of_Archive_stored_in_File 2: http://effbot.org/zone/python-with-statement.htm