A loop I made tonight in CLIPS:

https://gist.github.com/mrryanjohnston/2062ba2cba820d391cfe2ddfb88d028d

It provides an "environment-as-linked-list," allowing you to iterate through elements in a linked list `n` number of times by running the environment with `(run n)`.

It uses a single `deftemplate` and `defrule`. We use nested `assert`s to "link" meta-facts together.

#programming #clips #rulesengines

Loop

Loop. GitHub Gist: instantly share code, notes, and snippets.

Gist