All notable changes to this project will be documented in this file. This change log follows the conventions of keepachangelog.com.
- IMPORTANT: formform versions ≥ 0.4.0 are now distributed under Mozilla Public License 2.0, changing from the previous MIT license. This is because I want to ensure that any changes/improvements made by other people to the source files will be shared with everyone in the spirit of free and open source software. Still, I don’t want to impose any such restrictions on people who just want to use formform in their projects as a library, hence a weak copyleft license.
- When specifying a position in figure-related ini specs, users can now also provide a ratio (a float number in the unit interval as a fraction of the size of a generation) instead of an index number.
emul/ca-iteratorandemul/create-canow take an options map where users can set the seed for random inis. In the case ofemul/create-ca, thehistory-cache-limitmust now be set in this options map instead of as an extra argument.- Ini type
:figure-repeatnow takes a figure ini (type:figureor:rand-figure) instead of a background ini and a pattern.
calc/vmap-dimensionto calculate the dimension of vmaps (likedna-dimension) or get it from meta:dimcached by a vmap constructor (not for zero-dimension vmaps)expr/permute-varsto generate all permutations of a variable orderingexpr/formDNA-perspectivesas a complement tocalc/dna-perspectiveswhich does the same thing but while transforming a formDNA expressions into an arrangement of formDNA expressions as its perspectives (keeping variable names)io/print-dnaandio/print-constfunctions such that formDNA and constants not wrapped in expressions can be printed properly in formula notationcalc/dna-getas a convenience function to quickly get a specific value from a dna (also because it isn’t straightforward thatfilter-dnacan do the same thing with a little more effort)calc/vmap-perspectivesto complementcalc/dna-perspectives(which it takes as input)- New operator
:tsdsprovides a syntactic shortcut to build triple selective decision systems with binary selections. The 3 terms can be arbitrary expressions. Its FORMula notation looks like this:[:tsds 100100 L,E,R] - New
formform.emulmodule to (declaratively) represent, compose and calculate cellular automata with FORM logic. The API is mostly complete, but small changes may still happen. An introduction and more detailled explanation is in progress. nuim-codeandnmui-codedefinitions in the API for conveniencerand-const,rand-dnaandrand-vpointcan now all take a seed for reproducability in randomization- Added
rand-const-weighted,rand-dna-weightedandrand-vpoint-weightedvariants, which take a weights argument for uneven probability in random constant generation eval->val/==>andeval->val-all/==>*are two new functions in theexprmodule. The former only returns simple values, including “holes”:_. The latter returns only complex values, i.e. raw formDNA (possibly with holes). In essence, they return output that can be processed by functions in thecalcas well as the newemulmodule.eval-tsds->val-allbehaves just like==>*, but takes a 6-digit binary selection for a TsDS expr., which is especially convenient foremulfunctions- Added
calc/partial-dna?predicate to check if formDNA contains holes. - Extended
calc/relandcalc/invto enable correct arithmetic with value holes. calc/equal-partial-dna?andcalc/equiv-partial-dna?, which work exactly the same as their non-partial counterparts, but allow value-holes in the formDNA input, where they are assumed to be equal (:_=:_is always true).
- Changed constant/formDNA to lowercase in FORMula notation as well as in formform syntax. It is now much more pleasent to read than with uppercase and more aligned with the conventions in mathematical texts such as uFORM iFORM and LoF, which was the primary reason for this breaking change. Please also read about the change to formDNA notation below that went along with this one.
- Reversed the order of formDNA, which now reads left-to-right instead of right-to-left. The main reason for this change is to make formDNA more intuitive in reading and writing and reduce the mental load to reverse the order in your head. I apologize for this breaking change if you were already using formDNA; there will most certainly be no further changes to the notation. It went along with the new lowercase convention for constants, so that your existing formDNA data will not suddenly become incorrect and instead throws an exception, so you can safely make the transition.
- Removed 0-arity in
rand-vpointbecause the new random functions don’t return an infinite lazy seq (I believe that has never been useful anyway). rand-dnadoesn’t take anelemsvector anymore to select from, which could have arbitrary elements. Its primary function is now better served by the-weightedvariant and this ensures that it always returns a valid formDNA.expr/mark-exprsis deprecated to be replaced byexpr/form-markedandexpr/make-marked(the “unmarked” variant), to avoid the need for an options map.expr/nest-exprsis deprecated to be replaced byexpr/form-nested-l,expr/form-nested-r(l/r distinguishes the nesting direction) andexpr/make-nested-l,expr/make-nested-r(the “unmarked” variants), again to avoid the need for an options map.expr/simplify-expr-chainis deprecated to be replaced byexpr/simplify-nested-landexpr/simplify-nested-r(l/r distinguishes, again, the nesting direction). This is in line with the change above.expr/eval->expr-all(aliasexpr/=>*),expr/eval-all,calc/permute-dna,calc/dna-perspectives,calc/vdictandcalc/dna->vdictnow takeoptsas their last argument instead of the first one. This is to make argument order of the options map consistent with other functions in formform and with the convention in the Clojure community.expr/eval->expr/expr/=>now returns the simplified expression instead of a hole:_for uninterpretable input (such as unregistered symbols or uninterpreted variables). Likewise,expr/eval->expr-all/expr/=>*returns the pre-simplified, uninterpreted expression if it could not be determined to a value in any of its interpretations. It will also just return simple values instead of wrapping them in a formDNA expr. There are some new options explained in the docstring.evaluatenow separates output values in:resultand the simplified expression in:simplified. The result is nownilif it could not be determined to a value. Foreval-all, results are either value constants ornil, but can optionally be maps with the same entries as fromevaluate. Options are explained in the docstring.- Renamed
calc/equal-dna,calc/equiv-dna,expr/equalandexpr/equivto have?appended to their name, to follow the convention for predicates. - Changed
calc/reduce-dna-seqto check if the dna-seq contains value holes (:_) and in that case just return it, because reduction with value holes is not possible (extension is, though!). expr/simplifyandexpr/simplify-innow treat each instance of an expression/value hole (:_) in an expression/context as a unique, distinct symbol. This means that holes in subexpressions do not get simplified by law of calling like they used to.calc/reduce-dna-seqnow takes the optional terms as its second argument instead of the first. This is part of an effort to make argument order more consistent across formform.calc/reorder-dna-seq,calc/expand-dna-seqandcalc/reduce-dna-seqhave been renamed tocalc/reorder-dna,calc/expand-dnaandcalc/reduce-dna, because the-seqsuffix doesn’t make sense anymore and would only confuse users. Aliases to the old names are kept for now but might be removed later.expr/interpret,expr/interpret*,expr/interpret-walkandexpr/interpret-walk*now all receive the optionalenvas the second argument instead of the first. This makes the api more consistent with the other functions inexprthat receive anenv.- Removed
expr/simplify-opas well asexpr/simplify-sym, since they can both be (almost) fully replaced byexpr/simplify, which is less confusing. The only difference is that if the final output is a constant, it will be further simplified.
- Macros not recognized in ClojureScript
calc/permute-dna-seq, which had an incorrect implementation and lack of testingcalc/filter-dnato handle the edge-case where formDNA dimension is 0, i.e. the dna is equivalent to a constantcalc/dna-perspectivesnow retains its original key-order in metadata after being converted to a map, which is useful if the order in which perspectives are listed mattersexpr.core/simplify-contentused to call the methodinterpret-symfor expression symbols, which was incorrect, it now callssimplify-sym
First alpha release of the rewrite on Clojars. I advice against using it in any serious manner just yet, as there are still some rough edges, missing tests, unresolved issues, undecided questions and maybe also some outdated documentation.
However, you are welcome to experiment with the library (take a look at the introduction first) and I am thankful for feedback of any kind, as this is my first real Clojure project.