From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user Subject: Re: Reader syntax for accessing arrays Date: Tue, 23 Aug 2011 20:03:40 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1314122630 28266 80.91.229.12 (23 Aug 2011 18:03:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Aug 2011 18:03:50 +0000 (UTC) Cc: guile-user@gnu.org To: Johan Hidding Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Aug 23 20:03:46 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QvvKE-00033i-4L for guile-user@m.gmane.org; Tue, 23 Aug 2011 20:03:46 +0200 Original-Received: from localhost ([::1]:53929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvvKD-0005sU-LX for guile-user@m.gmane.org; Tue, 23 Aug 2011 14:03:45 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvvKB-0005sJ-3y for guile-user@gnu.org; Tue, 23 Aug 2011 14:03:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QvvK9-0005G3-9u for guile-user@gnu.org; Tue, 23 Aug 2011 14:03:42 -0400 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:64701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvvK9-0005Fl-7h for guile-user@gnu.org; Tue, 23 Aug 2011 14:03:41 -0400 Original-Received: by vwm42 with SMTP id 42so386908vwm.0 for ; Tue, 23 Aug 2011 11:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PM3T867N3kWgsTfHdx3iP4o19K8Yu3x6PsZFR80HDFI=; b=br/dsnI9ZC7go+VBj6Y4rXNkSFQQEpG9nCzwQnpPETJ89PLl+LcOD0xWY5CvMaSE/f 91z5NyDrkl7MtZZhNO5Y9PP7kY58K6/EYu15l8dqiDtFdkFFUz+YLv3ObNbDqW53O09m BmWF+5WJIddZSm8NEI23BHUxezwJm396VoWKk= Original-Received: by 10.220.1.129 with SMTP id 1mr449998vcf.189.1314122620261; Tue, 23 Aug 2011 11:03:40 -0700 (PDT) Original-Received: by 10.220.194.136 with HTTP; Tue, 23 Aug 2011 11:03:40 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.41 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:8730 Archived-At: > Hi Maciej, > I've been thinking among the same lines. At the same time this syntax could > be used to access members of a 'struct' or 'class' object. It should be > relatively simple to write a small interpreter (or maybe a pre-compiler). I thought that maybe it could be achieved using the guile-reader by Ludovic, but I don't know if this library is still supported by guile (according to the savannah web site, "it requires guile 1.8.x", but git logs suggest that it should go with 1.9.x and 2.0.x as well). I am using 1.8 series, and I've had some trouble with compiling it with gnu lightning, so I didn't even manage to test it yet. > Otherwise you could make a wrapper around the array in the form of a > closure. In that case, your example could be written > (*=! (a i j) 2) Oh, that's a very good idea (at least for now). Thanks! M.