Lisp | Haskell
------------------|------------------
map f l | map f l
map list l1 l2 | zip l1 l2
map list l1 l2 l3 | zip3 l1 l2 l3
map f l1 l2 | zipWith f l1 l2
map f l1 l2 l3 | zipWith3 f l1 l2 l3
Lisp | Haskell
--------------------------------------|-----------------------------------------
(EVAL (SETQ X '`(EVAL (SETQ X ',X)))) | <interactive>:1:0: Not in scope: `eval'
Lisp | Haskell
------------------------|-------------------------------------------------------
* (type-of 123) | <interactive>:1:0: Not in scope: `typeof'
(INTEGER 0 536870911) |
Lisp | Haskell
--------------------------|-----------------------------------------------------
(map #'map (read) (read)) | Couldn't match expected type `[t1] -> t'
| against inferred type `[[a] -> [b]]'
Lisp | Haskell
---------------------------|----------------------------------------------------
Prefix notation. | Prelude> let fac 1 = 1; fac n = n * fac n-1
| Prelude> fac 4
| *** Exception: stack overflow
|
| Prelude> let f 1 = 1; f n = ((*)(n)((f) ((-) n 1)))
| Prelude> ((f) 4)
| 24
Lisp | Haskell
-------------------------|------------------------------------------------------
* (setf Tree | data Tree a = Empty | Node (Tree a) a (Tree a)
'((n 5 (n 5 n)) | tree = Node
4 | (Node Empty 5 (Node Empty 5 Empty))
((n 5 n) 6 n))) | 4
| (Node (Node Empty 5 Empty) 6 Empty)
Lisp | Haskell
---------------------------|---------------------------------------------------
Speed comparable to C/C++ | The fastest BWT implementation written in Haskell,
| after weeks of optimization by several experts,
| remained over 200x slower than C++.
Lisp | Haskell
--------------------------|-----------------------------------------------------
* (defun yoba (a b) | Prelude> :{
(if (< a b) | Prelude| let yoba a b = if a < b
'(123 "abc") | Prelude| then [123, "abc"]
'("abc" 123))) | Prelude| else ["abc", 123]
* (* 2 (car (yoba 1 2))) | Prelude> :}
245 | <interactive>:1:30:
* | No instance for (Num [Char])
| arising from ...
This is SBCL 1.0.54, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>;.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (expt -1 (+ 2 1.0e-15 -1e-15))
i think lisp should get it right, it's not cool if you jump from one field to another (mathematicaly speaking)
Name:
Anonymous2011-12-27 22:37
Lisp | Haskell
---------------------------|---------------------------------------------------
Speed comparable to C/C++ | The fastest BWT implementation written in Haskell,
| after weeks of optimization by several experts,
| remained over 200x slower than C++.
Source?
Lisp | Haskell
------------------------|-------------------------------------------------------
* (type-of 123) | <interactive>:1:0: Not in scope: `typeof'
(INTEGER 0 536870911) |
uhh was "import Data.Typeable" too much for you?
Prelude Data.Typeable> typeOf 2.6963
Double
Prelude Data.Typeable> typeOf "mom i love you"
[Char]
Lisp | Haskell
---------------------------|----------------------------------------------------
Prefix notation. | Prelude> let fac 1 = 1; fac n = n * fac n-1
| Prelude> fac 4
| *** Exception: stack overflow
|
| Prelude> let f 1 = 1; f n = ((*)(n)((f) ((-) n 1)))
| Prelude> ((f) 4)
| 24
this one is stupid, you defined fac 2 diferent times.
Prelude Data.Typeable> let {fac 1 = 1; fac n = n * fac (n-1)}
Prelude Data.Typeable> fac 4
24
Lisp | Haskell
--------------------------------------|-----------------------------------------
(EVAL (SETQ X '`(EVAL (SETQ X ',X)))) | <interactive>:1:0: Not in scope: `eval'
>>47
I was just trolling, but I assume it's because you're actually looking at the number at a human interface. If you passed the value of the operation to a function and then outputted the value to a file or read it using a custom reply command, I'm guessing it would show the actual value. My reasoning would be if you tried to see the actual value anyways, it would either like like a ridiculously long value, or it would give the mantissa and multiplicand or whatever the names are.
Name:
Anonymous2011-12-28 1:47
>>48
Lisp | Haskell
-------------------|------------------------
(lambda (x) (x x)) | Prelude> \x -> x x
| Occurs check: cannot construct the infinite type
uhh
fix :: (a -> a) -> a
fix f = let x = f x in x
i am not even a real haskeller
Name:
Anonymous2011-12-28 2:05
>>50 crap :: (crap -> crap) -> crap
looks like crap.
is that because it aint Lisp?
yeah, the type expression for a function that returns itself is infinitely long. You run into the same problem in C if you want to declare a function that returns a pointer to itself. You ahve to cast it as void* and then recast the return value to void*(*)(...)