number->string and related procedures in GIMP scheme scripting

Posted by dim fish on Stack Overflow See other posts from Stack Overflow or by dim fish
Published on 2010-03-21T02:05:28Z Indexed on 2010/03/21 2:11 UTC
Read the original article Hit count: 520

Filed under:
|
|

I am frustrated with string-to-number and number-to-string conversion in GIMP scripting. I am runnning GIMP 2.6.8 in Windows Vista.

I understand that GIMP's internal Scheme implementation changes over the versions and I can't seem to nail down the documentation. From what I can gather GIMP's Scheme is a subset of TinyScheme and/or supports the R5RS standard procedures. In any case, I usually just look in the packaged script directory for examples when I want to try something new, because that should work for sure, right?

For example, grid-system.scm comes with the latest GIMP release and has the expression,

(string-append (number->string obj) " ")

which is exactly what I want. However, if I use number->string in my own script, or even type it into GIMP's script console (which is how I usually test out new stuff I want to do) it tells me number->string is an unbound variable:

> (number->string 3)

Error: eval: unbound variable: number->string

Other standard procedures from, say R5RS, work just fine:

> (string-append "frust" "rated")

"frustrated"

So,

1) Is there some lurking documentation for current GIMP Scheme scripting other than something drastic like searching GIMP's source code?

2) Can I use the GIMP console to spit out a list of all defined procedures to find something I need?

3) Anyone else confirm that number->string is not defined for the current Windows build, even though it appears in the packaged scripts? My web searches haven't turned up any related problems, and a complete uninstall of all GIMP versions, back to latest puts me in the same scrape.

© Stack Overflow or respective owner

Related posts about gimp

Related posts about scripting