<div dir="ltr">It's part of a DSL I'm writing, the idea being a user gives an accessor to some struct, a function to transform the accessed data, an updater to store the transformed data into another struct. I've nicknamed these source, pipe, and sink procedures respectively.<div>
<br></div><div>The end goal is a DSL that looks like</div><div><br></div><div> (create-trans</div><div> (wire source through pipe into sink) ...)</div><div><br></div><div>The context for this is robotics programming where source and sink structs model input and the robot respectively. If anyone's familiar with LabView, it's not entirely dissimilar. </div>
<div><br></div><div>I'm trying to make the DSL pleasant to use by avoiding mentioning anything about type or field names, just accessors and updaters. So I have no trouble extracting the needed data, but I there aren't any nice functional updaters generated. I could write something like</div>
<div><br></div><div> (create-trans output-type</div><div> (wire source through pipe into field-name) ...)</div><div><br></div><div>which isn't too bad, but it's a bit asymmetric: source can be some arbitrarily complex function but field-name is very limited. Probably I should just suck it up and accept a bit of ugliness. </div>
</div>