# Is it possible to write something like:\`\`\`op = :(&amp;&amp;)set = AndSet@eval f

**URL:** https://discourse.julialang.org/t/is-it-possible-to-write-something-like-op-amp-amp-set-andset-eval-f/57417
**Category:** General Usage
**Created:** [March 17, 2021, 9:23pm UTC](https://discourse.julialang.org/t/is-it-possible-to-write-something-like-op-amp-amp-set-andset-eval-f/57417 "2021-03-17T21:23:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)
#### Post date: [March 17, 2021, 9:23pm UTC](https://discourse.julialang.org/t/is-it-possible-to-write-something-like-op-amp-amp-set-andset-eval-f/57417/1 "2021-03-17T21:23:43Z")

</div>

is it possible to write something like:

```julia
op = :(&&)
set = AndSet
@eval do_some_operation(::$set, lhs, rhs) = lhs $op $rhs

```

? The `$op` part does not get parsed as hoped. Any way to rewrite this to make it possible?

Note that the original poster on Slack cannot see your response here on Discourse. Consider _transcribing the appropriate answer back to Slack_, or pinging the poster here on Discourse so they can _follow this thread_.  
[(Original message :slack:)](https://julialang.slack.com/archives/C6A044SQH/p1616016185059600?thread_ts=1616016185.059600&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

### Author: ![Wikunia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wikunia/32/2180_2.png) [@Wikunia](https://discourse.julialang.org/u/Wikunia)
#### Post date: [March 17, 2021, 10:04pm UTC](https://discourse.julialang.org/t/is-it-possible-to-write-something-like-op-amp-amp-set-andset-eval-f/57417/2 "2021-03-17T22:04:51Z")

</div>

Answered by @simeonschaub on Slack

```julia
@eval do_some_operation(::$(set), lhs, rhs) = $(Expr(op, :lhs, :rhs))

```

works and for things like `\xor` one needs to write

```julia
@eval do_some_operation(::$(set), lhs, rhs) = $(Expr(:call, op, :lhs, :rhs))

```

or simply `$op(lhs, rhs)`
