The Nature of Lisp (2006)
defmacro.org
defmacro.org
Don't get me wrong, I love Emacs and it is truly the superior environment to do work in Lisp. However it has a bit of a steep learning curve just like Lisp itself and fighting two battles (one with Lisp and one with Emacs) is no easy task for someone coming from a Java / C# and Eclipse / Visual Studio background. I know because I've been there. That's why I decided to start work on an open source Visual Studio add-in to support for Common Lisp in Visual Studio itself. I think being able to do the first steps in a familiar environment would be a great help for newcomers. I wonder what you guys think of the idea?
http://www.daansystems.com/lispide/
Hardly a substitute for Emacs/Slime, but for beginners, you can get a lot done. I use it when I am not plugged into in A/C outlet; it saves battery ;-)
(However I like Scheme better anyway.)
Common Lisp isn't even very functional. Not much more than e.g. Python. Scheme is a bit more functional oriented.
I'd be grateful if you could expand upon that statement. I'm a Lisper, and half the time I see one of these Haskell articles, I wonder if there really is a there there. For sure, functional programming can be a whole lot better than CL or Scheme, but I'd like to know if the difference is significant.
Purity by (strong) default makes it easier to combine your programs. Lazyness can help, too, but I am not completely sure whether you should make lazy the default. Chris Okasaki's "Purely Functional Data Structures" argues for needing both lazy and strict evaluation to guarantee asymptotic run times.
Have a look at, say, Software Transactional Memory to see what purity can buy you. Combinatorial parsers are another interesting application in Haskell; however they should be easily implementable in Scheme, too.
Please have a look at how http://www.cs.kent.ac.uk/people/staff/smk/redblack/rb.html uses the type system to statically guarantee the balance of red-black trees.
Please pardon that I mostly talked about the `how' and not so much the `why'. I hope giving some examples might not totally be in vain.
Lisp's parenthesis seem to share their deterrence factor with Python's significant indentation. Most people who have used one of them for a while don't even notice them any longer. At least not as a problem.
Interestingly, Haskell seems to be strange enough, that nobody fears its significant indentation.
Scheme is nice, too.
I have no issues with Scheme, except that I have chosen to use CL over Scheme because it does feel like something of a batteries-included system.
On the other hand, I was annoyed by what I felt was inconsistent syntax with Haskell revealed in Real World Haskell chapter 13 (unfortunately my only experience with it) when they showed this function definition:
mkFuncRec :: String -> (Int -> Int) -> FuncRec
vs this function definition: simplify :: (Num a) => SymbolicManip a -> SymbolicManip a
The =>, previously used to instance types, confused me here (they never explained how this definition differed), and I was having a hard time keeping up with all the various times I needed to use each special symbol. Of course, I tolerated it through C++ and perl, so if I ever decided to try a project, I could probably get used to it.Perhaps I am too used to Haskell, but I do not see anything confusing in those two definitions. What do you mean with "previously used to instance types"? As far as I can remember => is only ever used in the context shown above.
Here is the page that suddenly introduced that second form: http://book.realworldhaskell.org/read/data-structures.html
It is entirely possible I missed some context somewhere in there; "namespaces for values vs types" might be my clue. :)
my_fun :: (TypeClass1 a, Typeclass2 b) => a -> b
the stuff preceeding the => declares what typeclasses the types you mention later should fall into.A good example is the module Data.Map; this module deals with finite mappings of keys to values. Since those Maps are based on balanced trees, the keys have to be orderable/comparable. So for inserting a key into a map (http://hackage.haskell.org/packages/archive/containers/0.2.0...) we get the following type
insert :: Ord k => k -> a -> Map k a -> Map k a
This just says that the type of keys has to be an instance of the class Ord (http://haskell.org/ghc/docs/6.12.1/html/libraries/base-4.2.0...). I.e. there has to be an instance declaration with the function (<=) :: a -> a -> Bool
Does that help?By the way, if you want to find documentation about a function and you know its name or type, you can use Hoogle (http://www.haskell.org/hoogle/).
That makes it clear. Thank you!