From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: modifying pointers Date: Fri, 09 Apr 2010 18:59:16 +0200 Message-ID: References: <87k4sgpp0w.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1270832315 26016 80.91.229.12 (9 Apr 2010 16:58:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Apr 2010 16:58:35 +0000 (UTC) Cc: guile-devel To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Apr 09 18:58:33 2010 Return-path: Envelope-to: guile-devel@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 1O0HXM-00025E-Bq for guile-devel@m.gmane.org; Fri, 09 Apr 2010 18:58:32 +0200 Original-Received: from localhost ([127.0.0.1]:55249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0HXL-0008Ig-MT for guile-devel@m.gmane.org; Fri, 09 Apr 2010 12:58:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0HX5-0008Ch-Aa for guile-devel@gnu.org; Fri, 09 Apr 2010 12:58:15 -0400 Original-Received: from [140.186.70.92] (port=46218 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0HWz-0008An-VZ for guile-devel@gnu.org; Fri, 09 Apr 2010 12:58:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0HWy-0006EF-DO for guile-devel@gnu.org; Fri, 09 Apr 2010 12:58:09 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:54343 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0HWy-0006EA-BI; Fri, 09 Apr 2010 12:58:08 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 93F5DA9180; Fri, 9 Apr 2010 12:58:05 -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:content-transfer-encoding; s=sasl; bh=3WYz0dVYhcqB liV4oRbL+21a12c=; b=H7l6TPEyKnkIYMtGEnDjT7we52Pi2AnttpgL+MAp/5Z1 9gJAxY276PQ4bO+2p7jIWpJBYUiG4e8PxRY1TUGIYvqsvjhmEFBekqUnY65c5KWF H4zot7DrbFSFeTk1yOcu3oDBT7Ndptqhq5sLlAyxZeAbYEVqJq9lLehzBBJYakI= 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:content-transfer-encoding; q=dns; s=sasl; b=P64gvW 7zxKShVoIk3vdfX3rmlrOYCwS08MxWfPWE9WviL8nrT6wtD3n9/bI+LPu1DrGgjw Ednohm4ySgEEkilfKDGAuMf52UeRIUWlqSqlX0eMf6IXFpeax4dfmfqYsxJIFDTM BBPjLN00GzChZObWnLp7k/RN+ojhl6OnFRsGE= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 655ADA917E; Fri, 9 Apr 2010 12:58:04 -0400 (EDT) Original-Received: from unquote (unknown [83.34.178.60]) (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 B6A63A9176; Fri, 9 Apr 2010 12:57:54 -0400 (EDT) In-Reply-To: <87k4sgpp0w.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Fri, 09 Apr 2010 18:30:07 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 1044F9F2-43F9-11DF-A490-D033EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10181 Archived-At: Hi, On Fri 09 Apr 2010 18:30, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Andy Wingo writes: > >> You added a change to foreign-set! for %null-pointer. Would it not make >> sense instead to make foreign pointers of type "void" unsettable? > > Not necessarily. See the test that was added: > > (pass-if "foreign-set! other-null-pointer" > (let ((f (bytevector->foreign (make-bytevector 2)))) > (and (not (=3D 0 (foreign-ref f))) > (begin > (foreign-set! f 0) > (=3D 0 (foreign-ref f))) > (begin > ;; Here changing the pointer value of F is perfectly valid. > (foreign-set! f 777) > (=3D 777 (foreign-ref f)))))) > > Here a ((void *) 777) pointer is created. I'm just wondering if it is valid to create a ((void*) 777) pointer. Under what condition is that useful? If that is useful, OK; but under what condition is it useful to mutate the pointer in a foreign pointer object? Why not create a new foreign pointer object? Andy --=20 http://wingolog.org/