Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Whoa...I did a 'zcat /vmlinuz > /dev/audio' and I think I heard God... -- mikecd on #Linux


devel / comp.lang.scheme / Help with modify tinyscheme to do late binding of unbound variable to a foreign func

SubjectAuthor
* Help with modify tinyscheme to do late binding of unbound variable toLloyd Konneker
`- Re: Help with modify tinyscheme to do late binding of unboundLloyd Konneker

1
Help with modify tinyscheme to do late binding of unbound variable to a foreign func

<a902ccce-8a91-4540-994a-c80d256239ffn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9931&group=comp.lang.scheme#9931

  copy link   Newsgroups: comp.lang.scheme
X-Received: by 2002:a37:9445:: with SMTP id w66mr14857096qkd.410.1625500533790;
Mon, 05 Jul 2021 08:55:33 -0700 (PDT)
X-Received: by 2002:aca:d58f:: with SMTP id m137mr10097591oig.34.1625500533641;
Mon, 05 Jul 2021 08:55:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.scheme
Date: Mon, 5 Jul 2021 08:55:33 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2605:a601:a621:1800:e077:35dd:785:ed22;
posting-account=6tgp3QoAAABjRARvt3B0hzSi10AI4y4B
NNTP-Posting-Host: 2605:a601:a621:1800:e077:35dd:785:ed22
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a902ccce-8a91-4540-994a-c80d256239ffn@googlegroups.com>
Subject: Help with modify tinyscheme to do late binding of unbound variable to
a foreign func
From: konnek...@gmail.com (Lloyd Konneker)
Injection-Date: Mon, 05 Jul 2021 15:55:33 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Lloyd Konneker - Mon, 5 Jul 2021 15:55 UTC

I am hacking at the TinyScheme interpreter that is embedded in the GIMP open source image editing app.

Is this an appropriate forum to get help? or please point me to a more appropriate forum.

The idea is that whenever an unbound variable is encountered and the name exists in the GIMP API, create a foreign function object and bind it to the symbol in the global environment.

In C code of the tinyscheme interpreter, at the point the interpreter determines a symbol is unbound, more or less:

scheme_define (sc,
sc->global_env,
symbol,
sc->vptr->mk_foreign_func (sc, script_fu_marshal_procedure_call);

and then simply use the new binding as it would have been used if it was found in the first place.

Where symbol is an object of the interpreter ( type field is T_SYM and name field is "gimp-drawable-desaturate") and where script_fu_marshal_procedure_call is a foreign C function.
It seems to work, but right after the TS interpreter calls the foreign func, the symbol object is trashed: its name field is garbage. Whereas I expected it to still exist.

Probably just a stupid programming error, but is the concept sound?

Re: Help with modify tinyscheme to do late binding of unbound variable to a foreign func

<3878dc53-5daa-4b99-b899-298489aceb91n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9932&group=comp.lang.scheme#9932

  copy link   Newsgroups: comp.lang.scheme
X-Received: by 2002:a05:620a:126e:: with SMTP id b14mr20032769qkl.36.1625582185243;
Tue, 06 Jul 2021 07:36:25 -0700 (PDT)
X-Received: by 2002:a9d:7ad7:: with SMTP id m23mr15763648otn.138.1625582184950;
Tue, 06 Jul 2021 07:36:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.scheme
Date: Tue, 6 Jul 2021 07:36:24 -0700 (PDT)
In-Reply-To: <a902ccce-8a91-4540-994a-c80d256239ffn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2605:a601:a621:1800:d951:854b:950d:81ee;
posting-account=6tgp3QoAAABjRARvt3B0hzSi10AI4y4B
NNTP-Posting-Host: 2605:a601:a621:1800:d951:854b:950d:81ee
References: <a902ccce-8a91-4540-994a-c80d256239ffn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3878dc53-5daa-4b99-b899-298489aceb91n@googlegroups.com>
Subject: Re: Help with modify tinyscheme to do late binding of unbound
variable to a foreign func
From: konnek...@gmail.com (Lloyd Konneker)
Injection-Date: Tue, 06 Jul 2021 14:36:25 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Lloyd Konneker - Tue, 6 Jul 2021 14:36 UTC

Nevermind, and sorry to pollute the forum. It was my stupid programming error.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor