AlgebraicJulia / StockFlow.jl

https://algebraicjulia.github.io/StockFlow.jl/
MIT License
65 stars 6 forks source link

Created Composition DSL. #85

Closed neonWhiteout closed 1 year ago

neonWhiteout commented 1 year ago

sfcompose(sf1, sf2, quote (s1, s2) s1, s2 ^ A => N end)

Where sf1 and sf2 are stockflows, the first line is an ordered tuple of symbols which will act as its corresponding stockflow, and stockflows are separated from feet with ^. This commit includes Composition.jl, a testing file, and slight changes to Syntax.jl in src and tests; in src, I include Composition.jl, and in tests, I run the Composition tests from Syntax.

neonWhiteout commented 1 year ago

This doesn't have any overlap with the stratification DSL. Shouldn't be any issue with accepting both of them.

neonWhiteout commented 1 year ago

Force pushing was me removing some code which only works with stratification.

neonWhiteout commented 1 year ago

Rewriting DSL will likely need to wait until Stratification is merged; it relies on a few functions which are on the Stratification branch.

Also I still need to write tests for it.

neonWhiteout commented 1 year ago

Some minor updates. Used to need quote blocks, now you can use begin end

neonWhiteout commented 1 year ago

I'm hoping you won't get a merge conflict after every merge. They should be easy to deal with, though.