### Let function / segfault

Posted:

**Wed Aug 22, 2012 2:49 pm**With the latest hg source, this segfaults:

And I can't figure out how to use let in a function, or define local function variables:
I also just found out about vector2 (after expanding the complex kissing circles formula) Is there a function that extracts individual terms from vectors?

Code: Select all

```
testf(number a1, number b1) = if(a1==b1,5,10)
shape test
rule{
CIRCLE []
CIRCLE[x let(n=5..10;m=testf(n,2);1,m) a -0.5 sat 1 b 1 y 5 h 90]
}
```

Code: Select all

```
testf(number a1, number b1) = let(c=a1*b1;c)
shape test
rule{
CIRCLE []
CIRCLE[x testf(1,2)]
}
```

Code: Select all

```
Error in test.cfdg at line 2 - Arguments are expected.
Error in test.cfdg at line 4 - Definition with same name as user function
Error in test.cfdg at line 4 - user function definition is here.
```