[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trying to write a scheme function
From: |
Jean Abou Samra |
Subject: |
Re: Trying to write a scheme function |
Date: |
Fri, 4 Nov 2022 09:35:10 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 |
Hi Valentin,
Just a small correction:
Le 04/11/2022 à 09:02, Valentin Petzel a écrit :
For checking equality we have three basic functions: eq?, eqv? and equal?. eq?
checks if we reference the same object, but fails for numbers and strings.
eqv? does the same, but with numbers and strings it compares the values.
You mean characters (not strings).
Also note that eq? is not even guaranteed to fail on numbers and
characters -- it's unspecified. For example, with Guile 2.2:
scheme@(guile-user)> (eq? (expt 2 10) (expt 2 10))
$1 = #t
scheme@(guile-user)> (eq? (expt 2 100) (expt 2 100))
$2 = #f
Cheers,
Jean
OpenPGP_signature
Description: OpenPGP digital signature