guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reader syntax for accessing arrays


From: Ludovic Courtès
Subject: Re: Reader syntax for accessing arrays
Date: Wed, 24 Aug 2011 12:51:59 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

Hi,

Panicz Maciej Godek <address@hidden> skribis:

>> 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.

It roughly works with 2.0, but only with Latin-1 text.

>> 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)

You could even write macros for this.  I would actually find it more
elegant than additional syntax.

Thanks,
Ludo’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]