master > master: codego - minor cleanup

This commit is contained in:
RD
2021-05-14 19:23:53 +02:00
parent 39be87d52f
commit 9b225b0551
2 changed files with 62 additions and 11 deletions

View File

@@ -0,0 +1,23 @@
package formulae
/* ---------------------------------------------------------------- *
* METHOD Get Atoms
* ---------------------------------------------------------------- */
func schemeGetAtoms(fml Formula, prevValues [](*[]Formula)) *[]Formula {
if fml.IsAtom() {
return &[]Formula{fml.Copy()}
} else {
var results = []Formula{}
for _, prevValue := range prevValues {
results = append(results, *prevValue...)
}
return &results
}
}
var fnGetAtoms = CreateFromSchemeFmlsValued(schemeGetAtoms)
func (fml Formula) GetAtoms() []Formula {
return *fnGetAtoms(fml)
}