[Top][All Lists]

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

Re: [Emacs-diffs] trunk r116995: cl-lib defstruct introspection

From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r116995: cl-lib defstruct introspection
Date: Mon, 21 Apr 2014 22:03:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> Can it? I tried it in vc-dir and got a completely unrelated ChangeLog hunk.

Yes, there's a long-standing problem in vc-dir, such that it only works
well if you mark the files you're going to commit (basically the
changelog-copying feature needs the list of files that will be committed
and vc-dir doesn't provide it unless you manually mark each file).

Patch welcome.

>>>> I'm curious: when/where did you bump against a need for that?
>>> I have a few private macros that lexically bind structure slots,
>> Which part makes it impossible/impractical to use standard accessors for
>> that?
> :conc-name, for starters. Also, :read-only, although you could argue
> that you shouldn't go around mutating read-only slots anyway.

I guess I don't know what you mean by "lexically bind structure slots".
Can you give an example?

> Better to just define additional interfaces for optional functionality.
> The interface approach seems decently light and extensible, and the
> implementation complexity is low.

An object system based on interfaces sounds fine (tho I'm not sure if
it'll really end up simpler).  But note that every closure is made of
2 arrays, so a struct of 4 closures will really be made of 9 arrays, and
usually the only thing closed-over will be "the additional data"
(i.e. the attributes usually stored in "self"), so if we could handle
this object (the "self") specially we'd avoid all 4 closures.


reply via email to

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