Learning the programming language LISP for my Cognitive Science Seminar. Sleepy as hell, but the language seems pretty simple.
Wrote a simple program which cubes a number. ‘defun’ defines a function named cube which takes the parameter (x). I can run it by calling the function (cube 3), then it returns 27. That command searches memory for the function ‘cube’ which I wrote, then it passes the parameter 3 and performs the computation.
(defun cube (x)
“cube of x”
(* x x x))
The main data structure in LISP is lists which are defined as ‘(a b c).
Some Special Forms LISP can do are:
Variable assignment: let, let*, setq
Sequencing: progn – specifies that all the arguments that follow ‘progn’ should be processed in order.
This is way way easier than C or Java. I don’t understand how you can compute Neural Networks using only lists, but I guess we’ll see. I’m freaking sleepy.