Re: Re: [stack] Re: Flat concatenative basis (was: Concatenative macros?)
"Brent L Kerby" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
> Okay; and then you posted it where? :-)
Oh, yeah, I forgot to mention that. It's at http://www.tunes.org/~iepos/joys.zip (it's linked from the article "Theory of Concatenative Combinators"); I overwrote the old version with the new version. The C source code is included, although it's very unreadable (sorry about that). I meant to include an updated README, but it looks like I've misplaced the file. The basic difference is that if you want to search only for flat constructions, place an underscore ("_") on a line by itself anywhere in the "goal" file. And, to support the use of improper combinators in the basis, you may declare auxiliary combinators (which will not be included in the basis) at the beginning of the "goal" file and separate them from the others by putting a "." on a line by itself. The goal combinator is marked by an asterisk ("*") and may be placed anywhere in the file (whereas the older version always required the goal to be the first line); but it must occur after any combinators it references (so, if you're searching for "[q]", it should come after the definition of "q"); it's fine to always put it at the end.
For example, to search for constructions of "swat" over the basis {o, k} where o == [] [q] [k], use this for the "goal" file:
_
2q [[1]][01]
.
2k 0
0o [][q][k]
2* [01]
Oh, by the way, the searcher assumes opaque quotation because this was the easiest to implement; years ago I partially implemented transparent quotation (activated by uncommenting the line "#define LIVEQUOTES") but the code for it is broken, so I don't recommend using it.
Enjoy!
> -Billy
- Brent