On Fri, Oct 25, 2019 at 1:27 PM wanderley.guimar...@gmail.com <
wanderley.guimar...@gmail.com> wrote:
> On Fri, Oct 25, 2019 at 9:28 AM Alexis King wrote:
>
>> Unlike eq? on symbols, eq?’s behavior on quoted lists is unspecified …
>> Is there a reason you would like the answer to be #t?
>
> Not s
On Fri, Oct 25, 2019 at 9:28 AM Alexis King wrote:
> Unlike eq? on symbols, eq?’s behavior on quoted lists is unspecified, so I
> do not think there is a significantly deeper reason than “that isn’t what
> the current implementation chooses to do.” Whether the answer is #t or #f
> could change to
Den fre. 25. okt. 2019 kl. 16.35 skrev wanderley.guimar...@gmail.com <
wanderley.guimar...@gmail.com>:
> Why (eq? (quote a) (quote a)) is #t but (eq? (quote (a)) (quote (a)))
> is #f? I would expect that if (quote (a)) was a mutable pair but it
> is not since (quote (a)) returns #f. It seems tha
> On Oct 25, 2019, at 11:34, David Thrane Christiansen
> wrote:
>
> I'm not sure why Guile returns #t for this. If pairs are mutable there, then
> it could lead to aliasing problems.
The Scheme standard has historically left the behavior of mutation on quoted
values unspecified to permit prec
Hello,
eq? decides object identity, or pointer equality. Symbols are interned,
which means that there's a table mapping symbol names to underlying
objects, such that using the name twice results in the same allocated
symbol object being returned.
Pairs are not interned. Each time a new pair is co
Typo: Meant (let ([l (quote (a))]) (eq? l l))
~slg
‐‐‐ Original Message ‐‐‐
On Friday, October 25, 2019 12:28 PM, Sage Gerard wrote:
> By https://docs.racket-lang.org/reference/symbols.html, Two interned symbols
> are eq? to each other.
>
> But in the other example, you are comparing
Unlike eq? on symbols, eq?’s behavior on quoted lists is unspecified, so I do
not think there is a significantly deeper reason than “that isn’t what the
current implementation chooses to do.” Whether the answer is #t or #f could
change tomorrow, on a different VM, on a different architecture, or
By https://docs.racket-lang.org/reference/symbols.html, Two interned symbols
are eq? to each other.
But in the other example, you are comparing two lists each containing a single
symbol. A new list is created in each expression, and eq? is comparing the
object references and not the content. Fo
Why (eq? (quote a) (quote a)) is #t but (eq? (quote (a)) (quote (a)))
is #f? I would expect that if (quote (a)) was a mutable pair but it
is not since (quote (a)) returns #f. It seems that guile returns #t
as I was expecting.
--
You received this message because you are subscribed to the Google
9 matches
Mail list logo