inspect-properties -- return an abstract inspector object?
Zhu Zihao 16 Aug 2026 16:58 UTC
Hi, Artyom.
In your SRFI-279, you specify that 'inspect-properties' return a
non-dotted alist which contains all available properties.
However, I wonder whether it will work or not in practice. In your SRFI,
you also specify many "conversion properties" such as list->vector,
list->string, etc. Computing these properties will be very expansive --
an N-length list will require O(n) time to compute its 'list->vector'.
What's worse, these properties will be computed unconditionally even
user don't them!
Therefore, I suggest that (inspect-properties OBJ) return an abstract
"inspector" object that holds a reference to OBJ for inspection and
provides the following API:
(inspector-properties INSPECTOR): Return all available properties of
INSPECTOR.
(inspector-get-property INSPECTOR PROP): Return the value of PROP of
INSPECTOR.
The key point of this change is that the value of the property
corresponding to PROP is calculated only when the user calls
inspector-get-property on their expected property. And user can also use
inspector-properties to query the available properties (which may be
used to implement inspect-describe).
What do you think.
--
Retrieve my PGP public key:
执行下列命令以获取我的 PGP 公有密钥:
gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC
Zihao / 閱卜錄