Anyway, just some examples, and then we are done:
Factorial:
fact |0> => |1> n-1 |*> #=> arithmetic(|_self>,|->,|1>) fact |*> #=> arithmetic( |_self>, |*>, fact n-1 |_self>)becomes:
fact 0 = 1 n-1 * = _self - 1 fact * = _self * fact n-1 _selfFibonacci:
fib |0> => |0> fib |1> => |1> n-1 |*> #=> arithmetic(|_self>,|->,|1>) n-2 |*> #=> arithmetic(|_self>,|->,|2>) fib |*> #=> arithmetic( fib n-1 |_self>, |+>, fib n-2 |_self>) fib-ratio |*> #=> arithmetic( fib |_self> , |/>, fib n-1 |_self> )becomes:
fib 0 = 0 fib 1 = 1 n-1 * = _self - 1 n-2 * = _self - 2 fib * = fib n-1 _self + fib n-2 _self fib-ratio * = fib _self / fib n-1 _selfRandom greet:
hello |*> #=> merge-labels(|Hello, > + |_self> + |!>) hey |*> #=> merge-labels(|Hey Ho! > + |_self> + |.>) wat-up |*> #=> merge-labels (|Wat up my homie! > + |_self> + | right?>) greetings |*> #=> merge-labels(|Greetings fine Sir. I believe they call you > + |_self> + |.>) howdy |*> => |Howdy partner!> good-morning |*> #=> merge-labels(|Good morning > + |_self> + |.>) gday |*> #=> merge-labels(|G'day > + |_self> + |.>) random-greet |*> #=> pick-elt ( hello |_self> + hey |_self> + wat-up |_self> + greetings |_self> + howdy |_self> + good-morning |_self> + gday |_self>) friends-list |*> #=> extract-value list-to-words extract-value friends |_self>becomes:
hello * = "Hello, ${_self}!" hey * = "Hey Ho! ${_self}." wat-up * = "Wat up my homie! ${_self} right?" greetings * = "Greetings fine Sir. I believe they call you ${_self}." howdy * = "Howdy partner!" good-morning * = "Good morning ${_self}." gday * = "G'day ${_self}." random-greet * = pick-elt [ hello _self, hey _self, wat-up _self, greetings _self, howdy _self, good-morning _self, gday _self] friends-list * = extract-value list-to-words extract-value friends _selfAnd I guess that is about all I have to say about that.
No comments:
Post a Comment