public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: kawa <kawa@sourceware.org>
Subject: Support for $lookup$
Date: Tue, 7 Nov 2023 12:51:01 +0100	[thread overview]
Message-ID: <CAMFYt2bhb7DcVLZNn+oK+RtSOdAHgO0xhLU75WDZH=qAfKSmbA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

I've noticed something weird.

I maintain 3 variants of GRASP: one for Android, one for terminal, and one
that uses AWT.
In both PC versions the Kawa interpreter seems to be initialized when I
start up.

But when I start Android version, I invoke

(let ((scheme ::gnu.expr.Language
 (or kawa.standard.Scheme:instance
     (kawa.standard.Scheme))))

      (kawa.standard.Scheme:registerEnvironment)
      (gnu.mapping.Environment:setCurrent
       (scheme:getEnvironment)))

in order to be able to use "eval".

Now, the thing is that when the interpreter is initialized in this way, it
doesn't seem to support the $lookup$ syntax properly.

For some time, I used the following definition (provided to the
interpreter) as a workaround:

(define-syntax $lookup$
  (syntax-rules ()
    (($lookup$ object method)
     (lambda args
       (apply invoke object method args)))))

but it only handles method syntax and not slot accessing, which I find a
bit annoying.

But - since I recently noticed that the Kawa REPL handles both slot
accessing and method calling, I thought that perhaps there is some module
that I could import in the interpreter to have that syntax working?

                 reply	other threads:[~2023-11-07 11:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to='CAMFYt2bhb7DcVLZNn+oK+RtSOdAHgO0xhLU75WDZH=qAfKSmbA@mail.gmail.com' \
    --to=godek.maciek@gmail.com \
    --cc=kawa@sourceware.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).