vectaport / ivtools

X11 vector graphic servers
Other
17 stars 13 forks source link

add return(val) func to return early from user defined func in comterp #12

Open vectaport opened 4 years ago

vectaport commented 4 years ago

In a user defined func in comterp, the value returned is the last expression evaluated, i.e.: addsuffix=func(s+=".XXX") returns "hello.XXX" after addsuffix(:s "hello") is called. With a return statement it could be written as addsuffix=func(if(s==nil :then return(nil));s+=".XXX")