From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Compall Newsgroups: gmane.lisp.guile.user Subject: Re: References/locations Date: Sun, 10 Aug 2008 02:51:39 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218354716 7984 80.91.229.12 (10 Aug 2008 07:51:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Aug 2008 07:51:56 +0000 (UTC) Cc: guile-user@gnu.org To: "Maciek Godek" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Aug 10 09:52:47 2008 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.50) id 1KS5jK-0005tm-Ma for guile-user@m.gmane.org; Sun, 10 Aug 2008 09:52:46 +0200 Original-Received: from localhost ([127.0.0.1]:59256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KS5iO-0005Os-O1 for guile-user@m.gmane.org; Sun, 10 Aug 2008 03:51:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KS5iJ-0005Md-9h for guile-user@gnu.org; Sun, 10 Aug 2008 03:51:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KS5iH-0005KD-NC for guile-user@gnu.org; Sun, 10 Aug 2008 03:51:42 -0400 Original-Received: from [199.232.76.173] (port=43992 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KS5iH-0005K2-JC for guile-user@gnu.org; Sun, 10 Aug 2008 03:51:41 -0400 Original-Received: from mxsf07.insightbb.com ([74.128.0.77]:42977) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KS5iH-0006Ju-2a for guile-user@gnu.org; Sun, 10 Aug 2008 03:51:41 -0400 X-IronPort-AV: E=Sophos;i="4.31,337,1215403200"; d="scan'208";a="520620302" Original-Received: from unknown (HELO asav03.insightbb.com) ([172.31.249.124]) by mxsf07.insightbb.com with ESMTP; 10 Aug 2008 03:51:40 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAEA7nkhKiZK7/2dsb2JhbACpYg X-IronPort-AV: E=Sophos;i="4.31,337,1215403200"; d="scan'208";a="60406271" Original-Received: from 74-137-146-187.dhcp.insightbb.com (HELO Epsilon-III) ([74.137.146.187]) by asav03.insightbb.com with ESMTP; 10 Aug 2008 03:51:39 -0400 In-Reply-To: (Maciek Godek's message of "Fri\, 8 Aug 2008 03\:50\:33 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:6733 Archived-At: "Maciek Godek" writes: > I've tried to do it using a "procedure with > setter", but the problem is that set! doesn't > evaluate its first argument (as long as it's a > symbol), so I'd have to wrap everything > up in macros to obtain: > (set! (vector-location v 1) 10) Actually, if you (use-syntax (ice-9 syncase)), you should be able to define lexical symbol-macros that expand a single symbol, even in a set! place, something like: (define v #(1 2 3)) (define-syntax v1 (lambda (stx) (syntax-case stx () (_ v)))) Obviously aliasing will serve: (define-syntax alias-syntax (syntax-rules () ((_ form) (lambda (stx) (syntax-case stx () (_ (syntax form))))))) (define-syntax defalias (syntax-rules stx () ((_ new form) (define-syntax new (alias-syntax form))))) (define-syntax let-alias (syntax-rules () ((_ ((new form) ...) body ...) (let-syntax ((new (alias-syntax form)) ...) body ...)))) (defalias v1 (vector-ref v 1)) (set! v1 42) (vector-ref v 1) ; => 42 -- a Mr. Fleming wishes to study bugs in smelly cheese; a Polish woman wishes to sift through tons of Central African ore to find minute quantities of a substance she says will glow in the dark; a Mr. Kepler wants to hear the songs the planets sing. --Carl Sagan, "The Demon-Haunted World"