<div>
<div>Hello,</div><div><br></div><div>I have been trying to write a macro to allow me to omit some parentheses in complicated expressions with many complicated sub-expressions in the tail position. </div><div><br></div><div>(I want the dollar sign to work exactly as it does in Haskell)</div><div><br></div><div>I want to be able to write </div><div><br></div><div><blockquote type="cite">(map (lambda (str) (string-append "Hello, " str)) $ string-titlecase $ list "Alice "Bob" "Eve")</blockquote></div><div><br></div><div>and have it expand to</div><div><br></div><div><blockquote type="cite">(map (lambda (str) (string-append "Hello, " str)) (string-titlecase (list "Alice "Bob" "Eve")))</blockquote><div><br></div><div>My most recent attempt at this macro is </div><div> </div></div><div></div><blockquote type="cite"><div>(define-syntax $</div><div> (lambda (stx)</div><div> (syntax-case stx ()</div><div> [(before ... $ after ...) </div><div> #'(before bs ... (after as...))])))</div></blockquote><div><br></div><div>but this does not work, as I cannot have multiple ellipses in the pattern I match against in syntax-case. </div><div><br></div><div>I assume it is possible to write such a macro in Racket, but I am at a loss as to how.</div><div><br></div><div>Can anyone point me in the right direction, please? </div><div><br></div><div>Thanks,</div><div>-Spencer Gordon</div><div></div>
</div>
<div></div>