[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a property "definition-type" would help find macro-defined tests
From: |
Stephen Gildea |
Subject: |
Re: a property "definition-type" would help find macro-defined tests |
Date: |
Mon, 13 Jan 2025 13:34:01 -0800 |
Eshel Yaron <me@eshelyaron.com> wrote:
> a symbol in ELisp can name multiple things of different types, the same
> symbol can have definitions as a function, variable, face, feature, etc.
> It doesn't make sense to talk about "the definition type" of a symbol,
> because it can have multiple types.
This is quite true. Many symbols have multiple objects
attached to them. But not these symbols.
The symbols that need help from 'definition-type' generally
have only one definition. They tend to be internal symbols
defined by tests, and they tend to have parameterized names
like "formatz-%012:::z-hhmm" or "syntax-br-comments-c-f60".
The design of 'definition-type' affects the complexity and
readability of both the find-function implementation and all
macros that use the property.
(Admittedly the find-function-search-for-symbol complexity is
a minor point, because the price is paid only once.)
I think it is worth aiming primarily to reduce the burden on
all the macro-writers. We want to make it simple to maintain
the integrity of the property, both in understanding how it
works and in actually writing correct code.
This form, for 'definition-type':
(put 'my-test-name 'definition-type 'my-test-finding-regexp)
is shorter and easier to understand and write than the form
proposed for 'find-definition-alist':
(setf (alist-get 'ert-deftest (get 'my-test-name 'find-definition-alist))
'my-test-finding-regexp)
So, despite its limitations, the simpler design of
'definition-type' seems preferable.
< Stephen
- Re: a property "definition-type" would help find macro-defined tests, (continued)
- Re: a property "definition-type" would help find macro-defined tests, Stephen Gildea, 2025/01/08
- Re: a property "definition-type" would help find macro-defined tests, Eli Zaretskii, 2025/01/09
- Re: a property "definition-type" would help find macro-defined tests, Stephen Gildea, 2025/01/09
- Re: a property "definition-type" would help find macro-defined tests, Eli Zaretskii, 2025/01/10
- Re: a property "definition-type" would help find macro-defined tests, Stephen Gildea, 2025/01/11
- Re: a property "definition-type" would help find macro-defined tests, Eli Zaretskii, 2025/01/12
- Re: a property "definition-type" would help find macro-defined tests, Stephen Gildea, 2025/01/12
- Re: a property "definition-type" would help find macro-defined tests, Eli Zaretskii, 2025/01/12
- Re: a property "definition-type" would help find macro-defined tests, Stephen Gildea, 2025/01/12
- Re: a property "definition-type" would help find macro-defined tests, Eshel Yaron, 2025/01/13
- Re: a property "definition-type" would help find macro-defined tests,
Stephen Gildea <=
- Re: a property "definition-type" would help find macro-defined tests, Eshel Yaron, 2025/01/14
- Re: a property "definition-type" would help find macro-defined tests, Stephen Gildea, 2025/01/14
- Re: a property "definition-type" would help find macro-defined tests, Eshel Yaron, 2025/01/15
- Re: a property "definition-type" would help find macro-defined tests, Stephen Gildea, 2025/01/15
- Re: a property "definition-type" would help find macro-defined tests, Eli Zaretskii, 2025/01/16
- Re: a property "definition-type" would help find macro-defined tests, Stephen Gildea, 2025/01/16
- Re: a property "definition-type" would help find macro-defined tests, Stephen Gildea, 2025/01/16
- Re: a property "definition-type" would help find macro-defined tests, Eli Zaretskii, 2025/01/17
- Re: a property "definition-type" would help find macro-defined tests, Stephen Gildea, 2025/01/22
- Re: a property "definition-type" would help find macro-defined tests, Eli Zaretskii, 2025/01/22