Skip to content

Commit

Permalink
Renaming helper functions in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbor committed Oct 20, 2024
1 parent 30e195e commit b3341d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/fib.lsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

iszero := λn.n (λx. FALSE) TRUE;

fibh := \f x. IFTHENELSE
fib' := \f x. IFTHENELSE
(iszero x)
(\f x . x)
(IFTHENELSE
(iszero (PRED x))
(\f x . f x)
(ADD (f f (PRED x)) (f f (PRED (PRED x)))));
fib := fibh fibh;
fib := fib' fib';

@echo ""
@echo "6. Fibonacci number"
Expand Down
12 changes: 6 additions & 6 deletions examples/sort.lsh
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ four := !n (SUCC three);
iszero := λn.n (λx. FALSE) TRUE;


leh := \f x y. IFTHENELSE
le' := \f x y. IFTHENELSE
(OR (iszero x) (iszero y))
(iszero x)
(f f (PRED x) (PRED y));
le := leh leh;
le := le' le';


inserth := \f e l. IFTHENELSE
insert' := \f e l. IFTHENELSE
(ISNIL l)
(CONS e l)
(IFTHENELSE
(le e (HEAD l))
(CONS e l)
(CONS (HEAD l) (f f e (TAIL l)))
);
insert := inserth inserth;
insert := insert' insert';


sorth := \f l. IFTHENELSE
sort' := \f l. IFTHENELSE
(ISNIL l)
NIL
(insert (HEAD l) (f f (TAIL l)));
sort := sorth sorth;
sort := sort' sort';


@echo ""
Expand Down

0 comments on commit b3341d1

Please sign in to comment.