SimonEnsemble/PoreMatMod.jl

sugar for replacement

Closed this issue · 2 comments

The existing syntactic sugar for substructure replacements may be a bit opaque, despite its beauty:

(q => r) in p

The overloading of the in operator is the issue (b/c q in p functions as the search command)

May be better to refactor as analogue of Base.replace:

replace(p, q => r)

also add a form that allows re-using searches:

s = q in p
replace(s, r)

wait, no, don't. that's just substructure_search(s, r, kwargs...), no need to do that.

refactored as replace(p, q => r)