<div dir="ltr"><div><div><div><div><div><div><div>Is there a way to abstract datum literals out of a (splicing) syntax class? I have a number of patterns that look something like this:<br><br></div>(~optional (clause-name: element ...))<br>
<br></div>and I'd like to factor that out into a common syntax class, but be able to specialize it according to the specific clause name I'm expecting. For example, instead of something like this:<br><br></div>(~optional (my-clause: element ...))<br>
<br></div>I would have a syntax class called "maybe-clause" and just write<br><br></div>(~var clause (maybe-clause my-clause:))<br><br></div>Is this possible?<br><br></div>P.S. I know that I should be using literals instead of datum literals, but that's a refactoring that needs to happen to this code later on. In any case, I assume one has the same problems with literals, too.<br>
</div>