From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: logical shift operators in guile? Date: Thu, 10 Jun 2010 00:45:21 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1276124649 27062 80.91.229.12 (9 Jun 2010 23:04:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Jun 2010 23:04:09 +0000 (UTC) Cc: Guile Mailing List To: steve tell Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Jun 10 01:04:05 2010 connect(): No such file or directory Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OMUJW-0006S2-FT for guile-user@m.gmane.org; Thu, 10 Jun 2010 01:04:02 +0200 Original-Received: from localhost ([127.0.0.1]:35974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMTzu-00062L-Nk for guile-user@m.gmane.org; Wed, 09 Jun 2010 18:43:46 -0400 Original-Received: from [140.186.70.92] (port=35378 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMTzf-0005J1-DL for guile-user@gnu.org; Wed, 09 Jun 2010 18:43:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMTzT-0007y7-Uz for guile-user@gnu.org; Wed, 09 Jun 2010 18:43:22 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:56387 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMTzT-0007xh-TJ for guile-user@gnu.org; Wed, 09 Jun 2010 18:43:19 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 00AE2B98E9; Wed, 9 Jun 2010 18:43:19 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=sWf6F3rIzgxbf3UV6gFpF6MAYIM=; b=j59bg7 9eR9l34hOHhtbS8ZeKo+b8Fb++4dLe0etzGn75ozlwZ8FXr5DCZRsaIPpszxM2eL SsOvqtvjp1YHxPDsjLQrlM/OkMqFwzATHpxY9bJDNI15BBMr70r67HTmUXWPKR6s nCYzZlvNqlfrZDHuu0c+aIMRdQPEQWzCgk8m8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=jZ3tWCS+dOzCBHAs23GkUyYWRCMjA1lk NoM+bGa60lif5I+Dq50SAws5gz6N69Rt6dvOQhUnMVvewa2neeDMJCCkOxDOeLyA aBaBCC1kHyuqVrViH97nsw0uefxiqFTEry40dh51mZzhBfUyQjj1xXjHdG0EE8eJ gC+KfX9drcw= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id DF254B98E5; Wed, 9 Jun 2010 18:43:17 -0400 (EDT) Original-Received: from unquote (unknown [81.38.180.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 4B103B98E4; Wed, 9 Jun 2010 18:43:16 -0400 (EDT) In-Reply-To: (steve tell's message of "Wed, 9 Jun 2010 00:04:41 -0400 (EDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 65B5AF9A-7418-11DF-B89A-9056EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7857 Archived-At: Hi Steve, On Wed 09 Jun 2010 06:04, steve tell writes: > Does guile (1.8.x, or any version) have the integer logical shift > operators, like C's << and >> ? We have ash (arithmetic shift) but not lsh (logical shift). I admit I am somewhat ignorant regarding when you would prefer lsh over ash. If it is important (as it probably is) we should add lsh. > While searching for those, I realized that what I was trying to do was > represent small sets of booleans as the bits of an integer... and that > somthing similar could be done in a more scheme-like fashion with > bitvectors. > > But is there any way to copy the contents of bitvector a to another > bitvector b of the same size, short of iterating over the elements? There does not seem to be, though perhaps I am overlooking something. There is array-copy!, but that is not implemented in the most efficient way for contiguous uniform vectors like bitvectors. Would you like to submit a patch to add bitvector-copy and/or bitvector-copy! ? For my eye there's something still not right as far as bitvectors' implementation. I guess I would prefer something with a bytevector as a backing store... But that's a topic for another day. Regards, Andy -- http://wingolog.org/