Newsgroups: comp.lang.tcl
From: "Donal K. Fellows" <donal.k.fell...@manchester.ac.uk>
Date: Tue, 02 Nov 2004 11:11:29 +0000
Local: Tues, Nov 2 2004 6:11 am
Subject: Re: Comparison of whole lists
Donald Arseneau wrote: Good question. I don't have a good answer though. Instead, I'd start by > Is there an efficient command for testing equality of whole lists? focussing on the issue of what equality of lists actually means. After all, you want to have the right type of equality, yes? :^) > I have been using [string equal] which, despite the shimmering, And it seems you're taking the same sort of approach that I do. :^) > is much faster than element-by-element comparison in a [foreach] > loop. Also, [string equal] is inappropriate for lists of numbers. > I could really go for a comparison that compares each element If you have lists of strings, it might be fastest to do one of these: Otherwise you have to do an element-wise comparison. For example, here's For general numeric values, that's probably optimal. (And no, this isn't Donal. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||