unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-user@gnu.org
Subject: Re: Reader syntax for accessing arrays
Date: Wed, 24 Aug 2011 12:51:59 +0200	[thread overview]
Message-ID: <87bovf5bg0.fsf@gnu.org> (raw)
In-Reply-To: CAMFYt2byBWAa5vBVg5LDaSKw3RsMaCOaqRaV_xQ-h7Lk1u-HtA@mail.gmail.com

Hi,

Panicz Maciej Godek <godek.maciek@gmail.com> 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	other threads:[~2011-08-24 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 23:17 Reader syntax for accessing arrays Panicz Maciej Godek
2011-08-23  8:10 ` Johan Hidding
2011-08-23 18:03   ` Panicz Maciej Godek
2011-08-24 10:51     ` Ludovic Courtès [this message]
2011-08-24 18:45       ` Panicz Maciej Godek
2011-08-24 19:52         ` Johan Hidding
2011-08-26 21:02           ` Panicz Maciej Godek
2012-01-09 15:39 ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bovf5bg0.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).