[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#8415: 23.3.50; Extensible Emacs Registers
From: |
Leo |
Subject: |
bug#8415: 23.3.50; Extensible Emacs Registers |
Date: |
Thu, 07 Apr 2011 11:13:49 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (Mac OS X 10.6.7) |
On 2011-04-06 23:38 +0800, Stefan Monnier wrote:
> I think that's a better approach, yes (tho I'd pass the register object
> to the functions, so instead of:
>
> (let* ((object (register-get register))
> (val (if (register-p object)
> (register-info object)
> object))
> (jump (and (register-p object)
> (register-jump-func object))))
> (cond
> (jump (funcall jump val))
>
> you just have
>
> (let* ((object (register-get register))
> (jump (and (register-p object)
> (register-jump-func object))))
> (cond
> (jump (funcall jump object))
>
> or
>
> (let* ((object (register-get register)))
> (cond
> ((register-p object) (funcall (or (register-jump-func object)
> (error "Don't know how to jump"))
> object))
I am lost here. VAL is needed in the rest of the function, the old code.
So you can't just omit it.
>> 1. all existing register-creating commands need to use the new
>> implementation, so the patch won't be any smaller.
>
> That's for subsequent patches.
The intention is to have a clean uniform extensible internal
representation of registers so subsequent patches are completely trivial
which I opted to omit for now so that people can focus on more important
changes. Somehow that didn't work out well.
>> 2. needs explicitly creating a register-value struct i.e.
>> (register-set ?a (register-value-make ....)).
>
> I see that as a feature.
If register-value-make is not used, 'typecase polymorphism' has to be
used. If we were to eliminate 'typecase polymorphism',
register-value-make is required.
For me, (register-make ...) is just simpler. One of the reasons that the
first patch I posted to emacs-devel evolved to the one I submitted in
this bug report.
It just has selectors and three public function register-make,
register-find, register-map. The rest of code can just build on top of
them.
Leo
- bug#8415: 23.3.50; Extensible Emacs Registers, (continued)
- bug#8415: 23.3.50; Extensible Emacs Registers, Leo, 2011/04/04
- bug#8415: 23.3.50; Extensible Emacs Registers, Stefan Monnier, 2011/04/04
- bug#8415: 23.3.50; Extensible Emacs Registers, Daniel Colascione, 2011/04/04
- bug#8415: 23.3.50; Extensible Emacs Registers, Stefan Monnier, 2011/04/04
- bug#8415: 23.3.50; Extensible Emacs Registers, Daniel Colascione, 2011/04/04
- bug#8415: 23.3.50; Extensible Emacs Registers, Stefan Monnier, 2011/04/04
- bug#8415: 23.3.50; Extensible Emacs Registers, Leo, 2011/04/05
- bug#8415: 23.3.50; Extensible Emacs Registers, Stefan Monnier, 2011/04/05
- bug#8415: 23.3.50; Extensible Emacs Registers, Leo, 2011/04/06
- bug#8415: 23.3.50; Extensible Emacs Registers, Stefan Monnier, 2011/04/06
- bug#8415: 23.3.50; Extensible Emacs Registers,
Leo <=
- bug#8415: 23.3.50; Extensible Emacs Registers, Stefan Monnier, 2011/04/08