[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hash consing (was: Re: sqlite3)
From: |
Philipp |
Subject: |
Re: Hash consing (was: Re: sqlite3) |
Date: |
Sat, 18 Dec 2021 14:46:07 +0100 |
> Am 18.12.2021 um 10:35 schrieb Po Lu <luangruo@yahoo.com>:
>
> LdBeth <andpuke@foxmail.com> writes:
>
>> It seems no one has yet pointed out "preserving EQness" is actually
>> hash-consing[1], a technique has been developed in Lisp and now well
>> known in Functional Programming communities.
>>
>> It has main features that:
>>
>> 1. Keeps only one copy of (structurally) EQUAL objects and therefore
>> 2. reduce storage usage
>> 3. reduce the time needed to do a EQUAL comparsion to EQ.
>> 4. useful for function memoization
>>
>> It is definitely useful, but I think we could make it into a separated
>> package, probably.
>
> I wonder how hash consing would make sense in a language like Emacs Lisp
> that has `rplaca' and `rplacd'.
>
> Perhaps we would need some kind of immutable cons data type.
>
We already have that: for example, the result of evaluating the form '(1 . 2)
is an immutable cons cell. The immutability isn't enforced, though: passing
such a cons cell to `rplaca' will cause undefined behavior, but typically not
signal an error.
- Re: sqlite3, (continued)
- Re: sqlite3, Richard Stallman, 2021/12/16
- Re: sqlite3, Lars Ingebrigtsen, 2021/12/17
- Re: sqlite3, Richard Stallman, 2021/12/17
- Re: sqlite3, Lars Ingebrigtsen, 2021/12/18
- Re: sqlite3, Qiantan Hong, 2021/12/18
- Re: sqlite3, LdBeth, 2021/12/18
- Re: sqlite3, Qiantan Hong, 2021/12/18
- Re: sqlite3, Tomas Hlavaty, 2021/12/18
- Hash consing (was: Re: sqlite3), Po Lu, 2021/12/18
- Re: sqlite3, LdBeth, 2021/12/18
- Re: Hash consing (was: Re: sqlite3),
Philipp <=
- RE: [External] : Re: Hash consing (was: Re: sqlite3), Drew Adams, 2021/12/18
- RE: [External] : Re: Hash consing (was: Re: sqlite3), Tomas Hlavaty, 2021/12/18
- RE: [External] : Re: Hash consing (was: Re: sqlite3), Drew Adams, 2021/12/18
- Re: sqlite3, Richard Stallman, 2021/12/16
- RE: sqlite3, Drew Adams, 2021/12/14
- Re: sqlite3, Qiantan Hong, 2021/12/14
- RE: sqlite3, Drew Adams, 2021/12/14
- EQ-ness, Richard Stallman, 2021/12/16
- RE: [External] : EQ-ness, Drew Adams, 2021/12/17
- Re: [External] : EQ-ness, Richard Stallman, 2021/12/18