Homoiconic and “unrestricted” self modifying code + Is lisp really self modifying?

In the first version (+ 1 2 3) is raw code, whereas in the second version it is data. By assuming the truth of this statement it can be argued that Lisp isn’t even homiconic. The code has the same representation as data in the sense that they are both lists/trees/S-expressions. But the fact that … Read more

How do I increment or decrement a number in Common Lisp?

Use the built-in “+” or “-” functions, or their shorthand “1+” or “1-“, if you just want to use the result, without modifying the original number (the argument). If you do want to modify the original place (containing a number), then use the built-in “incf” or “decf” functions. Using the addition operator: (setf num 41) … Read more

Dr Racket problems with SICP

Even if possible, such redefinitions are not something that you should do without really understanding how the system will react to this. For example, if you redefine +, will any other code break? The answer to that in Racket’s case is “no” — but this is because you don’t really get to redefine +: instead, … Read more

What does “Pure” mean, in the context of programming languages and paradigms?

The word pure has different meanings in different contexts. Functional Programming When people talk about Haskell being a pure language, they mean that it has referential transparency. That is, you can replace any expression with its value without changing the meaning of the program. For example, in Haskell: square :: Int -> Int square x … Read more

What does (interactive) mean in an Emacs Lisp function?

Just to clarify (it is in the quoted docs that Charlie cites) (interactive) is not just for key-bound functions, but for any function. Without (interactive), it can only be called programmatically, not from M-x (or via key-binding). EDIT: Note that just adding “(interactive)” to a function won’t necessarily make it work that way, either — … Read more

Are there Lisp native code compilers?

Many Lisp compilers compile to ‘native’ code. ‘Native’ means here ‘machine code’ (x86 in 32bit or 64bit mode, PowerPC, SPARC, …). Other questions: can ‘non-native code’ compilers generate single file executables? -> Yes. can ‘native code’ compilers generate single file executables? -> Yes. how ‘native’ is ‘native’? -> Lisp system will most of the time … Read more

Is Haskell a Lisp?

Lisp is a very vague concept. I see two more or less useful interpretations: Lisp as a family of languages which share some common ideas. In a wide interpretation very different languages belong to this family: Common Lisp, Scheme, Logo, Dylan, Emacs Lisp, Clojure, RLisp, 3Lisp and many, many others. Lisp as a lineage of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)