Re: [Gimp-user] script-fu: illegal function?



On 09/17/12 21:44, Richard Gitschlag wrote:
That's right - parentheses are not "free" in Scheme scripting, every opening parenthesis must be 
immediately followed by a function call.  When you just want parentheses to group a few statements together 
with, call the (begin ... ) function:

(begin (function a) (function b) (etc ) ... )

Thanks, both of you for clarifications.
Not sure where I saw the "print" but it seems to work:

(define (find-dot txt txtLen offset) (print "foo") "xyz" "pqr") (find-dot "abcd.ef" 7 1)
find-dot"foo"
"pqr"
(define (find-dot txt txtLen offset) (display "foo") "xyz" "pqr") (find-dot "abcd.ef" 7 1)
find-dotfoo"pqr"

The function itself seems to be accepted.
It appears the difference between using "display" and using "print" 
is that "print" outputs enclosing double quotes plus trailing newline;
"display" outputs the unadorned string and no trailing newline.

-- Stratadrake
strata_ranger hotmail com
--------------------
Numbers may not lie, but neither do they tell the whole truth.


 > Date: Mon, 17 Sep 2012 18:47:38 -0400
 > From: kevin ve3syb ca
 > To: gimp-user-list gnome org
 > Subject: Re: [Gimp-user] script-fu: illegal function?
 >
 > On 12-09-17 02:28 PM, Gary Aitken wrote:
 > > ((define (find-dot txt txtLen offset) (print "foo")) (find-dot "abcd.ef" 7 1))
 >
 > First, you wrapped the whole thing in ( ). Drop the leading and trailing
 > parentheses.
 >
 > Second, that is a line of Scheme code and Scheme does not contain a "print"
 > function. You probably meant to use "display". Also keep in mind that the
 > "display" function only takes a string so you may first need to convert what
 > you pass it to a string.
 >
 > --
 > Cheers!
 >
 > Kevin.
 >
 > http://www.ve3syb.ca/ |"Nerds make the shiny things that distract
 > Owner of Elecraft K2 #2172 | the mouth-breathers, and that's why we're
 > | powerful!"
 > #include <disclaimer/favourite> | --Chris Hardwick
 > _______________________________________________
 > gimp-user-list mailing list
 > gimp-user-list gnome org
 > https://mail.gnome.org/mailman/listinfo/gimp-user-list


_______________________________________________
gimp-user-list mailing list
gimp-user-list gnome org
https://mail.gnome.org/mailman/listinfo/gimp-user-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]