0

I'm trying to write my first Gimp script, but I can't seem to get it set two variables in a single IF statement :

(if
  (< a b)
  ((set! a 100)(set! b 200))
  ((set! a 200)(set! b 100))
)

I get an illegal function error. It works if I set a single variable. How should I write it to work with two (or more) ?

Skippy le Grand Gourou
  • 6,976
  • 4
  • 60
  • 76

1 Answers1

3

You forgot begin:

(if
  (< a b)
  (begin (set! a 100) (set! b 200))
  (begin (set! a 200) (set! b 100))
)

begin basically just executes all of its arguments.

wizzwizz4
  • 6,140
  • 2
  • 26
  • 62