12-21-2017, 09:41 PM
(12-21-2017, 09:25 PM)Ofnuts Wrote: Far from a Scheme expert(*), but I would expect to do something like:
that would entirely side-step the issue.Code:
(if (> ((string-length g1Text) 0)
++ No dice, it seems that Scheme really doesn't want if clauses in the variable declaration section of its Let statement.
(12-21-2017, 09:25 PM)Ofnuts Wrote: Also it is usually considered good style to use "guard clauses" to avoid putting the bulk of the code in a nested condition. In other words, instead of doing:
++ Yeah, I know. I tried but I couldn't find the scheme version of return or exit so I just trudged ahead with that mess.
(12-21-2017, 09:25 PM)Ofnuts Wrote: (*) We are in the third millennium, why don't you use Python instead of a 1950-era language?
++ Haha, believe me I wish I had. When I first started looking at writing a Gimp plugin it appeared Scheme had more tutorials and was better supported so I just went with it. Believe me, I regret the decision.