Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mwatts15/Crono
...
head fork: mwatts15/Crono
Checking mergeability… Don't worry, you can still create the pull request.
  • 6 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 6 additions and 4 deletions.
  1. +6 −4 crono/prelude.lisp
View
10 crono/prelude.lisp
@@ -45,7 +45,7 @@
(defun _foldr (f l s) (if (= l nil) s (f (car l) (_foldr f (cdr l) s))))
-(defun foldr (\ (f l) (if (= l nil) nil (_foldr f (cdr l) (car l)))))
+(defun foldr (f l) (if (= l nil) nil (_foldr f (cdr l) (car l))))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% math functions
@@ -68,7 +68,7 @@
(define <K> (\ (x y) x))
%General application combinator
-(define <S> (\ (f g x) ((f x) (g x))))
+(define <S> (\ (f g p) ((f p) (g p))))
%Function composition combinator
(define <B> (\ (f g x) (f (g x))))
@@ -85,10 +85,12 @@
%(define <Y> (\ (f)
% (\ (x) (f (x x))) (\ (x) (f (x x))) ))
-(define <COND> (\ (p f g x) (if (p x) (f x) (g x))))
+(define my_cond (\ (p f g x) (if (p x) (f x) (g x))))
+% (define prFoldr (\ (fn z x)
+% (<Y> (<B> (my_cond (= nil) (<K> z)) (<B> (<S> (<B> fn (car)) ) (<C> <B> cdr))) x)))
(defun pradd1 (x z)
(<Y> (<B>
- (<COND> (= 0) (<K> z))
+ (my_cond (= 0) (<K> z))
(<B> (<S> (<B> + (<K> 1))) (<C> <B> pred)))
x))

No commit comments for this range

Something went wrong with that request. Please try again.