[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Colorize objects by method dispatch type
From: |
Michael Heerdegen |
Subject: |
Re: Colorize objects by method dispatch type |
Date: |
Fri, 03 Apr 2020 01:46:04 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Also it's not clear to me exactly which part of `type-of` you don't like.
`type-of' should be ok in most cases, but I'm looking for an alternative
for cases where e.g. `type-of' just says `cons' whereby the objects are
actually very different things that are identified with a tag as first
element or so. It's just that these are not represented with "official"
classes defined with defstruct. If the code in question doesn't use
methods but just a `cond' to distinguish I'm lost anyway but if it uses
methods than I could use the signature of the chosen method (for a
specified generic name) for hashing, or the signature of the most
specific method implementation. Then the color would only change if the
hierarchy of implementations changes, and in that case a changed color
would be acceptable.
Michael.