'sk' is intended to allow experimentation with combinatory logic.


s et k combinators are builtin.
(((s f) g) x) -> ((f x) (g x))
((k c) x) -> c

'sk' supports two mixable syntaxes :
- Fully parentezised bin tree.
  ((s k) k)
- la unlambda,
The back quote stands for the two parenthesis around two parameters.

Definitions are possible with ':' :

- Uppercase letters glue to a word symbol. Two such consecutive words
 must be separated by a white space.

``: FOO BAR returns BAR and defines FOO to BAR as a side effect.

- A single lowercase letter is a symbol.

`zx ->

  The order of definitions doesn't matter for evaluation.
Is only relevant for definition expansion in a dump.

Compiles with OCaml 3.10. Probably with other versions too.
Please check / adapt 'ocamlmakefile' path in Makefile
(current : debian path).
When OK :


should produces the 'sk' executable.

./sk [some_preedited_file]

Much more comfortable with 'rlwrap' or 'ledit'.
For example :

rlwrap ./sk someDefs.sk

Some definitions of someDefs.sk are borrowed from Rafael R. Sevilla
Combinator Engine 'lazy-l'.
Church numerals arithmetic, for example.
(Often useful to add parameters to compare results. )

> ````+ 2 4 tu
  ((((+ 2) 4) t) u) or
  ````+ 2 4tu ->
  (t (t (t (t (t (t u)))))) or

> ``6tu
  ((6 t) u) or
  ``6tu ->
  (t (t (t (t (t (t u)))))) or

b,c,w belongs to Haskell Curry system of operators.

? dumps the coloured definitions on the console.
q quits, dumping the definitions to file 'definitions.sk'

The symbols we can bring with ':' :
- defined name : dark blue
- undefined name : light blue

s combinator : green
k combinator : red 
back_quote : yellow
The colour of the 'frame' : purple

To customize the colours, please edit 'sk_config.ml' and recompile, sorry !

The order of definitions are sloppily dumpped. So if you feed back a later
'sk' session with a previously output file, the definitions will be more or
less expanded.
If there is no side effect "operator" ( like ':' ) that shouldn't change
evaluations, however the clarity of initial definitions may be lost.

Maybe TODO :
Add some special operators like Unlambda's print operator '.'.
Define 'i' operator as builtin ?
Allow to predefine any operator.
Add a -o option to 'sk' for overriding default outfile name.

In addition to several links Rafael R. Sevilla gives in the README of his
'lazy-l' :

- http://combengine.sourceforge.net/README

-  Jt Gleason blog about Qi language, were lay several articles about SK

- Wikipedia pages :