GNU bug report logs -
#8415
23.3.50; Extensible Emacs Registers
Previous Next
Reported by: Leo <sdl.web <at> gmail.com>
Date: Sun, 3 Apr 2011 12:30:03 UTC
Severity: wishlist
Tags: patch
Found in version 23.3.50
Fixed in version 24.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #49 received at submit <at> debbugs.gnu.org (full text, mbox):
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
This bug report was last modified 13 years and 323 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.