emacs-devel
[Top][All Lists]
Advanced

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

Re: What's missing in ELisp that makes people want to use cl-lib?


From: Gerd Möllmann
Subject: Re: What's missing in ELisp that makes people want to use cl-lib?
Date: Fri, 17 Nov 2023 15:45:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
> A bit strange is that cl--generic-next-function seems to be called
> recursively in the process, which I think could create another such
> hash-table. Or I'm reading that simply wrong, as I mentioned I just
> wanted to see if cl-generic is so different, so I didn't spend much time
> on this.

Perhaps someone could verify if I'm reading this wrong?

Start in cl--generic-get-dispatcher again:

      (funcall
       cl--generic-compiler
       `(lambda (generic dispatches-left methods)
          (let ((method-cache (make-hash-table :test #'eql)))
            (lambda (,@fixedargs &rest args)
              (let ,bindings
                (apply (with-memoization
                           (gethash ,tag-exp method-cache)
                         (cl--generic-cache-miss
                          generic ',dispatch-arg dispatches-left methods
                          ,(if (cdr typescodes)
                               `(append ,@typescodes) (car typescodes))))
                       ,@fixedargs args)))))))))

The hash table is the cache, and so on, as before.

We have a cache miss, so -> cl--generic-cache-miss ->
cl--generic-make-next-function -> cl--generic-get-dispatcher, and we
procuce a function like the above, with a a method-cache of its own?

I suspect that I'm taking a wrong turn here, somewhere.



reply via email to

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