emacs-devel
[Top][All Lists]
Advanced

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

Re: Dynamic loading progress


From: Aurélien Aptel
Subject: Re: Dynamic loading progress
Date: Mon, 28 Sep 2015 18:12:13 +0200

On Mon, Sep 28, 2015 at 5:42 PM, Philipp Stephani <address@hidden> 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



reply via email to

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