unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: Johan Hidding <johannes.hidding@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: Reader syntax for accessing arrays
Date: Tue, 23 Aug 2011 20:03:40 +0200	[thread overview]
Message-ID: <CAMFYt2byBWAa5vBVg5LDaSKw3RsMaCOaqRaV_xQ-h7Lk1u-HtA@mail.gmail.com> (raw)
In-Reply-To: <CAEz5FLZbudHezzLDf29cKkziEKEbgJey8rpYPD3GKSnOpd+LPg@mail.gmail.com>

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



  reply	other threads:[~2011-08-23 18:03 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 [this message]
2011-08-24 10:51     ` Ludovic Courtès
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=CAMFYt2byBWAa5vBVg5LDaSKw3RsMaCOaqRaV_xQ-h7Lk1u-HtA@mail.gmail.com \
    --to=godek.maciek@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=johannes.hidding@gmail.com \
    /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).