Lisk — Lisp and Haskell
chrisdone.com
Lisk — Lisp and Haskell
1–10 of 30 posts
Re: Lisk — Lisp and Haskell
#2I remember something like this called Liskell, but I think it died.
Re: Lisk — Lisp and Haskell
#3Not tackling pattern matching is a pretty big deficiency. Otherwise, it seems interesting, and I wonder if
:i-o
would really be easier to type than IO
for most use cases.Re: Lisk — Lisp and Haskell
#4I remember something like this called Liskell, but I think it died.
The OP devotes a paragraph to it.
Re: Lisk — Lisp and Haskell
#5Shouldn't:
def fib(n):
if n
Be:
... if n
?Or am I being stupid?
EDIT: changed x to n.
Re: Lisk — Lisp and Haskell
#6Shouldn't: def fib(n): if n Be: ... if n ? Or am I being stupid? EDIT: changed x to n.
works with both - try it on paper
Re: Lisk — Lisp and Haskell
#7Re: Lisk — Lisp and Haskell
#8Re: Lisk — Lisp and Haskell
#9Re: Lisk — Lisp and Haskell
#10Earlier quoted context omitted.
I did - with 2: fib(2) = fib(2-1) + fib(2-2) fib(2) = fib(1) + fib(0) fib(2) = 1 + 1 (rather than 1 + 0) No?
It's definitely wrong - just ran it in python to check in case I was missing something!
I don't think it's explicitly wrong; I've seen both fib(0) = 1 and fib(0) = 0 before. Wikipedia shows:
By definition, the first two Fibonacci numbers are 0
and 1, and each subsequent number is the sum of the
previous two. Some sources omit the initial 0, instead
beginning the sequence with two 1s.