I'm having an issue where I would like to be able to create a template which will conditionally insert a string into the template based on the value of one of the fields.
This means I want some sort of embedded elisp (or elisp function call) to evaluate if one of my fields has the value 0. If it does not then I want to include a function definition in the snippet. If the field is 0 then there is no reason to include this function definition.
This is what I have so far but it seems to matter what the string is included and the concatenation fails.
$>registerFn(id, &$1FieldEnd, $1FieldOtherEnd,
$> ${5:$1Handler}, 0);
`(if (string= (yas-field-value 5) "0")
(
" ")
(
concat (concat "\nstatic void " (concat (yas-field-value 5) "(void *argPtr)"))
"\n
{
/* handlerImplementation */
}
")
)`
'concat (concat "\nstatic void " (concat (yas-field-value 5) "(void *argPtr)"))
```