Re: [Gimp-developer] changes in script-fu in 2.3.14

2007-02-15 Thread Kevin Cozens
Alexander Rabtchevich wrote:
 Many 3-rd side script-fu scripts, working in 2.3.12, refused to work in 
 2.3.14 on Windows. One of them even kills Gimp at program start.

If you have a script that crashes GIMP, you should post it somewhere so it can
be examined. No script should be able to kill GIMP. Scripts can crash plug-ins 
since some plug-ins don't check the passed parameters properly but that is a 
different issue.

 Where can I read what has changed in script-fu specifications to adapt 
 scripts? Or has the API changed?

I have some notes on my web page in the information about Tiny-Fu but I
haven't gotten around to turning the information in to any formal
documentation about the differences.


PS. I would have replied sooner but it seems I haven't been checking my
gimp-devel mail folder very closely over the last couple of weeks.

-- 
Cheers!

Kevin.

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
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] changes in script-fu in 2.3.14

2007-02-15 Thread Kevin Cozens
Alexander Rabtchevich wrote:
   Raphaƫl, could you please explain me (I'm new to scheme) in a few 
 words, why the global variables are poor style coding?

Global variables can lead to bugs if not used carefully. The use of global 
variables in Script-Fu is particularly bad since all scripts are read in to a 
single namespace. A global variable defined in one file can be altered by code 
in another file without the need to use a Scheme equivalent of a C extern 
declaration. Everything will seem ok until you add another script file from 
somewhere that happens to use a global variable with the same name as a global 
defined in another file.

Problems can also arise when two files have global functions with the same 
name but different behaviour. This sort of problem has been seen even amongst 
the scripts shipped with GIMP. It is why you now see the use of locally 
defined functions rather than global ones in most scripts. For an example, 
look at the alien-glow-arrow.scm file.

 But the inability to use global 
 variables along with scheme syntaxes leads to a good deal of parentheses 
 which could be a problem to a programmer.

When you understand the syntax of the language, the use of local variables 
instead of global doesn't have any significant impact on the number of 
parentheses in a script.

If someone is afraid of the parentheses they shouldn't be trying to use 
Scheme. :-) More likely the fear of parentheses is caused by badly formatting 
the Scheme code (ie. lack of whitespace). Always putting the closing brackets 
for statements at the end of a single line leads to wasting a lot of time 
counting brackets.

-- 
Cheers!

Kevin.

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
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] changes in script-fu in 2.3.14

2007-02-15 Thread Kevin Cozens
Sven Neumann wrote:
 If I understood Kevin correctly the long-term goal for Tiny-Fu is to
 start the interpreter on demand for each script that is executed. So at
 some point scripts will behave more like plug-ins.

That is one of the goals I have in mind for the Script-Fu plug-in.

-- 
Cheers!

Kevin.

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
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer