Why does this work:
ex = :(X --> Y)
but not this:
ex = :(X <--> Y)
I work with biochemical reaction systems and I want to create a macro into which I can type the reactions and which the generates the differential equations for me, to be solved using DifferentialEquations.jl.
DifferentialEquations.jl already have a macro for this:
rs = @reaction_network begin 2.0, X --> Y 1.0, Y --> X end
However since most of my reactions go in both directions I would want do be able to do something like:
rs = @reaction_network begin (1.0,2.0), X <--> Y end
this would make a lot of things half as long. In addition I would like to have functionality to put in more things as reaction rates (pre declared constants, or function of the reactant concentrations. This way I could allow to have reactions with rates not necessarily linear to the reactants concentration).
Since DifferentialEquations.jl have a very similar function I decided it would probably be a task suited for a macro and have been reading up on them. However it seems like I cannot create expressions using
<---> (to denote a two way reactions), and I have been unable to understand what’s the difference between
ex = :(X --> Y) ex = :(X <--> Y)
Neither expression is valid Julia code to begin with, but what trait of the one way arrow makes it allowed, as opposite to the two way arrow?