public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Damien Mattei <damien.mattei@gmail.com>,
	kawa mailing list <kawa@sourceware.org>
Subject: Re: how to know if a variable is defined
Date: Wed, 10 Apr 2024 18:00:55 -0700	[thread overview]
Message-ID: <2dec7074-c846-413c-a247-18bae45813d7@bothner.com> (raw)
In-Reply-To: <CADEOaddExfrJvzNhoXf55wOO46T70h3-xt575nAuOmGn72GsKg@mail.gmail.com>



On 4/10/24 14:49, Damien Mattei via Kawa wrote:
> hello,
> 
> is there a way to know if a variable is defined in Kawa?
> 
> (like 'identifier-binding' in Racket)

If you need to know if a variable is bound in the dynamic environment,
you could perhaps use eval wrapped in an exception handler.

There are probably better ways, but I don't remember off-hand.

Can't think of anything to use if you need information about lexical bindings.
I supposed you could implemented identifier-binding or something similar.

-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

  reply	other threads:[~2024-04-11  1:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10 21:49 Damien Mattei
2024-04-11  1:00 ` Per Bothner [this message]
2024-04-11  9:51   ` Lassi Kortela
2024-04-13 22:45   ` Damien Mattei
2024-04-13 22:58     ` Damien Mattei
2024-04-16  6:37       ` Damien Mattei

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=2dec7074-c846-413c-a247-18bae45813d7@bothner.com \
    --to=per@bothner.com \
    --cc=damien.mattei@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).