From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.user Subject: Re: Uniq list in Guile Date: Sat, 26 Oct 2013 11:16:15 +0100 Message-ID: <87vc0kbamo.fsf@Kagami.home> References: <87d2mspkt3.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1382782595 19681 80.91.229.3 (26 Oct 2013 10:16:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Oct 2013 10:16:35 +0000 (UTC) Cc: guile-user To: Dmitry Bogatov Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Oct 26 12:16:40 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Va0v9-0006V3-GE for guile-user@m.gmane.org; Sat, 26 Oct 2013 12:16:39 +0200 Original-Received: from localhost ([::1]:34162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va0v9-00062j-2o for guile-user@m.gmane.org; Sat, 26 Oct 2013 06:16:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va0ux-00061d-Ch for guile-user@gnu.org; Sat, 26 Oct 2013 06:16:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Va0ut-0002Q1-E2 for guile-user@gnu.org; Sat, 26 Oct 2013 06:16:27 -0400 Original-Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:33532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va0ut-0002Pv-6a; Sat, 26 Oct 2013 06:16:23 -0400 Original-Received: by mail-wg0-f50.google.com with SMTP id n12so4846030wgh.29 for ; Sat, 26 Oct 2013 03:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:references:mail-followup-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=ZgOTofvEDu+/nrECB9mbxbJjxr1HehcN0P6XCvaBsQw=; b=Jy2KvIjOcGd0+/neWMxUzcjs6H5jwsZQR7Q4DgLpX6cWuZA1soa4Eh3onIR2gB/K4Z /ey5W8n4j05Ve7UMOie7PDBLySGqBmUHVbgVUYTbr4oTtbohxsk5hwNhxwLjaDRZCoLT p7ybDfwdDN5DPUA4UeF4z0JKJFYBtJTkJHZt+MBTKMJ5cGS4Djdb/vG8YcbXVTIDC7Dc 2mGy7NZjVmhmN4tvebOJ2sezftG4SFeWF+j0GFijITTh8//7HYr2rboJfvQIPfxHq/Kg Zdf36jEVL3J7j19p/GeG9070oxbjZUCdjNjOfQD3K9jCkaJQ2CCoszaommi2DjDi9IwY P5xw== X-Received: by 10.195.12.39 with SMTP id en7mr9596763wjd.32.1382782581705; Sat, 26 Oct 2013 03:16:21 -0700 (PDT) Original-Received: from Kagami.home (host86-132-92-201.range86-132.btcentralplus.com. [86.132.92.201]) by mx.google.com with ESMTPSA id mw9sm3627452wib.0.2013.10.26.03.16.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 26 Oct 2013 03:16:20 -0700 (PDT) Mail-Followup-To: Dmitry Bogatov , "guile-user" In-Reply-To: <87d2mspkt3.fsf@gnu.org> (Dmitry Bogatov's message of "Sat, 26 Oct 2013 11:12:40 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::232 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10859 Archived-At: Dmitry Bogatov writes: > Hello! > > Recently I faced neseserity to uniq list in Guile. Surprised, that I > did not found ready solution, I decided to prepare it. It's not really that common. I wrote my own "uniq" (which is a terrible name unix has inflicted on us) a long while back, and I think I've used it exactly once. By contrast, I use shuffle (also not in the standard library) fairly often, and I got that one shot down. > By analogy with sorting functions in `sort.c` I prepared > `uniq.c`(attached, but unfinished patch, lacking proper documentation). > But after I became curious, how slower would be Scheme version with > (set-cdr!). To my test (random list of small integers) it is about twice > as slow. > > Is Guile Mainline interested in these routines, and if yes, does in your > opinion doubling execution speed worth resorting to C hacking? Without an actual benchmark, no. -- Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"