Gimp-Forum.net
scheme : error in vector - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: scheme : error in vector (/Thread-scheme-error-in-vector)



scheme : error in vector - geka - 05-03-2026

Hello,

I need to write a script for GIMP and I'm stuck on an error I don't understand.

I haven't found a solution to this problem.

Here's an example of a script that returns an error in a console schema:


Code:
(define
myvector (vector 'a 'b 'c 'd 'e)
)
(vector-set! myvector 2 'x)
Error: vector-set!: index must be exact: 2


Where is my error?

Thank you for your help.


RE: scheme : error in vector - programmer_ceds - 05-05-2026

If you download the zip file https://programmer97.byethost10.com/Files/StraightenAndCrop.zip, look in folder StraightenAndCrop_scm_GV3 at StraightenAndCrop_scm_GV3.scm and search for all references to maximize_type_strs it may help you (make sure that you look at the script ending in _GV3 - the earlier script (for V2) doesn't include the vector usage)

(Just noticed that you are using V2.10 - so the above won't work unless you update to V3)


RE: scheme : error in vector - geka - 05-06-2026

(05-05-2026, 09:26 AM)programmer_ceds Wrote: If you download the zip file https://programmer97.byethost10.com/Files/StraightenAndCrop.zip, look in folder StraightenAndCrop_scm_GV3 at StraightenAndCrop_scm_GV3.scm and search for all references to maximize_type_strs it may help you (make sure that you look at the script ending in _GV3 - the earlier script (for V2) doesn't include the vector usage)

(Just noticed that you are using V2.10 - so the above won't work unless you update to V3)

Thank you very much for your reply.
I'll look into it.
I think the error comes from tinyscheme, because it works with other scheme interpreters.