Jim Sabatke wrote:
> I understand 
> that gimp has migrated to tiny scheme and variables need to be declared 
> with let or let*.  I have tried and tried to modify some of the scripts 
> and can't get them to work.
> The documents on the let and let* functions make it seem like I 
> shouldn't be having this much trouble.

I realize that Scheme code looks rather cryptic to a lot of people but, no, 
you shouldn't be having that much trouble.

What doesn't help matters is that a lot of Scheme code is poorly formatted 
making it look like something suitable for submission to an Obufuscated Scheme 
contest. When the code is properly formatted it is much easier to see the 
syntax of the lanuage. This also makes it easier to modify Scheme code and 
eliminates so much of the time one otherwise spends counting brackets.

As someone else mentioned, you can "cheat" and just change the 'set!' calls to 
'define'. However, putting the undefined variables in a let/let* block is 

A let block looks like the following:
(let* (
       (var1 value-or-code-to-give-initial-value-for-variable)
       (var2 some-other-value)
       ... scheme code ...

If your script gives you an error message along the line of 'unbound variable: 
bad-var', you just need to add 'bad-var' to the let block.

(let* (
       (var1 value-or-code-to-give-initial-value-for-variable)
       (var2 some-other-value)
       ... scheme code ...

You don't have to even have to specify a value if you don't want to. 
Alternatively, you could take the entire Scheme set! statement where bad-var 
is first used and put it in the header without the leading set! command where 
I showed '(bad-var)'.



http://www.ve3syb.ca/           |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172      |"Same thing we always do, Pinkutus:
                                 |  Try to assimilate the world!"
#include <disclaimer/favourite> |              -Pinkutus & the Borg
Gimp-developer mailing list

Reply via email to