Re: [Gimp-user] Help! Problem with gimp-curves-spline procedure

2012-05-09 Thread Adir Kol
Thanks Kevin!
This would be the 2d time you're helping me :)

On Wed, May 9, 2012 at 6:56 PM, Kevin Cozens  wrote:

> On 12-05-09 06:44 AM, Adir Kol wrote:
>
>> *(define spoint 15)*
>> *(gimp-curves-spline drawable 0 6 #(0 0 0  spoint  255 255))*
>>
>> I get an error: *Error: Item 4 in vector is not a number (argument 4 for
>> function gimp-curves-spline) #( 0 0 0  spoint  255 255 )*
>>
>
> Putting a variable name in a list (or vector in this case) and expecting
> the value held by the variable to become part of the list (or vector) is an
> often made error when writing Scheme scripts. The syntax #( objects ) is a
> vector containing the listed objects. It is *not* an expression that
> evaluates to a list. To put it another way, it will not use the value or
> contents of "spoint" in the vector. The "spoint" reference was treated as a
> symbol.
>
> It is easy to solve the problem by using the "list" procedure, but in your
> case you want a vector so you need one additional procedure call.
>
> Use the following:
>(list->vector (list 0 0 0 spoint 255 255))
>
> --
> 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  | --Chris Hardwick
> __**_
> gimp-user-list mailing list
> gimp-user-list@gnome.org
> http://mail.gnome.org/mailman/**listinfo/gimp-user-list
>
___
gimp-user-list mailing list
gimp-user-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gimp-user-list


Re: [Gimp-user] Help! Problem with gimp-curves-spline procedure

2012-05-09 Thread Kevin Cozens

On 12-05-09 06:44 AM, Adir Kol wrote:

*(define spoint 15)*
*(gimp-curves-spline drawable 0 6 #(0 0 0  spoint  255 255))*

I get an error: *Error: Item 4 in vector is not a number (argument 4 for
function gimp-curves-spline) #( 0 0 0  spoint  255 255 )*


Putting a variable name in a list (or vector in this case) and expecting the 
value held by the variable to become part of the list (or vector) is an 
often made error when writing Scheme scripts. The syntax #( objects ) is a 
vector containing the listed objects. It is *not* an expression that 
evaluates to a list. To put it another way, it will not use the value or 
contents of "spoint" in the vector. The "spoint" reference was treated as a 
symbol.


It is easy to solve the problem by using the "list" procedure, but in your 
case you want a vector so you need one additional procedure call.


Use the following:
(list->vector (list 0 0 0 spoint 255 255))

--
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  | --Chris Hardwick
___
gimp-user-list mailing list
gimp-user-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gimp-user-list


[Gimp-user] Help! Problem with gimp-curves-spline procedure

2012-05-09 Thread Adir Kol
Hi All,
I've been trying to make gimp-curves-spline get variable (which is number)
instead of number and I get error.

For example -
when I do:
*(gimp-curves-spline drawable 0 6 #(0 0 0 15 255 255))*

everything works well as it should be.

but if I do:
*(define spoint 15)*
*(gimp-curves-spline drawable 0 6 #(0 0 0  spoint  255 255))*

I get an error: *Error: Item 4 in vector is not a number (argument 4 for
function gimp-curves-spline) #( 0 0 0  spoint  255 255 )*
As you can see, all I did was replacing the number 15 with a variable
(which is a number)
I also check it is a number by the *number?* type predicate

Any thoughts?
___
gimp-user-list mailing list
gimp-user-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gimp-user-list