From: Marius Vollmer <mvo@zagadka.de>
Subject: Re: equal? on arrays
Date: Tue, 30 May 2006 00:15:05 +0300 [thread overview]
Message-ID: <877j44jzxi.fsf@zagadka.de> (raw)
In-Reply-To: <87r74mytcu.fsf@zip.com.au> (Kevin Ryde's message of "Wed, 29 Mar 2006 11:42:09 +1100")
Kevin Ryde <user42@zip.com.au> writes:
> Marius Vollmer <mvo@zagadka.de> writes:
>>
>> It should clearly be possible to use equal? with all kinds of arrays.
>> If this isn't the case, we would need to fix.
>
> Eg, picking out a diagonal with a shared array:
>
> (equal? (make-shared-array #2((a b c) (d e f) (g h i))
> (lambda (i) (list i i))
> '(0 2))
> #(a e i))
> => #f
>
> but with array-equal? it's #t.
>
> It was this way in guile 1.6 too, but never really documented under
> equal?, unless you know or thought a shared array is not really an
> array.
The problem is that #(a e i) is a vector (scm_tc7_vector) while
make-shared-array returns a smob.
In Guile 1.6, you could not use vector-ref with a one-dimensional
array smob (but you could use array-ref with a vector). Thus, you
could say that a one-dimensional array is not a vector and can not be
equal to it. It also prints differently.
In Guile 1.8, you can use vector-ref with a one-dimensional array
smob, and they print identical. Thus, they should be equal? now.
I'll fix this.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
prev parent reply other threads:[~2006-05-29 21:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-07 20:57 equal? on arrays Kevin Ryde
2006-03-25 19:47 ` Marius Vollmer
2006-03-29 0:42 ` Kevin Ryde
2006-05-29 21:15 ` Marius Vollmer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877j44jzxi.fsf@zagadka.de \
--to=mvo@zagadka.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).