lisp

Would Lisp be extremely difficult for a new(ish) programmer to learn?

I've got a little experience with Python (enough to where I can do if/else/elif and some random number generation), but I've always had a weird fascination with the Lisp languages. I downloaded some scheme source code to look at the syntax but it was pretty much gibberish to me. For a programmer with only a little programming experience...

When did the idea of macros (user-defined code transformation) appear?

I have read McCarthy's 1960 paper on LISP and found no reference to anything that's similar to user-defined macros or normal order evaluation. I was wondering when marcos first appeared in programming language history (and also in Lisp history): When was the idea of user-defined code transformation (before interpretation or compilation...

Do you know of a language with Static Type checking where Code is Data?

Can you name language with Static Type checking(like Java) and where Code is Data(like in LISP)? I mean both things in one language. ...

how to turn off the debugger in sbcl

I'm trying to learn common lisp currently and I've been using sbcl (I hope that's a decent implementation choice.) Coming from ruby and irb I find the automatic moved to a debugger on every mistake a little annoying at this time. Is there a way to turn it off temporarily when I'm playing around. ...

Make clos objects printable in lisp

If you want to make CLOS objects in common lisp printable (print readably), how do you go about doing this without using anything but print and read. ...

Where can I find the PDF of Practical Common Lisp?

The full text of "Practical Common Lisp" used to be easily available from APress in PDF format, but not anymore. Does anyone know where I can (legally) find it? ...

How do I write a macro-defining macro in common lisp

I have about two macros (and climbing) in my codebase that look like this: (defmacro def-stat-method (method-name stat) `(progn (defmethod ,method-name ((monster monster)) (getf (stats monster) ,stat)) (defmethod (setf ,method-name) (value (monster monster)) (setf (getf (stats monster) ,stat) value)))) and th...

What can be the use of SymbolType in Python?

Here's the SymbolType package that adds symbols to Python. Can those who have done anything useful with Lisp/Scheme tell me what how can I take advantage of this type in Python? Can it be used to isolate strings coming from outside (from the web) from internal code? $ sudo easy_install SymbolType $ ipython Unfortunately, you can't us...

Scheme symbolic equivalence

Hi all. The platform i'm working with is DrScheme. I've seen that a pair (a b) [constructed by (cons a b)] is implemented within the language like a procedure that looks like this: (define (cons a b) (lambda(pick) (cond ((= pick 1) a) ((= pick 2) b)))) and the selectors: (define (car x) (x 1)) (define (cdr x) (x 2))...

Simple LISP function not working

I decided to learn LISP today, and have been playing around with it for a bit. I wrote a simple baby function just to test my understanding, and now understand that my understanding doesn't understand as much as I had understood it to understand. :D Anyway, here is the function. The idea is that when it is called, e.g. (esexp base x) it...

auto indentation on common lisp emacs + slime + sbcl in windows

Hello, all! I can't use auto indentation function on emacs + slime + sbcl when I define my function and so on. My .emacs file configuration is this: (setq inferior-lisp-program "D:/emacs/sbcl_1.0.37/sbcl.exe" lisp-indent-function 'common-lisp-indent-function slime-complete-symbol-function 'slime-fuzzy-complete-symbol ...

Building Lisp/Scheme-like parse tree with flex/bison

Hello, I was trying to parse simple Lisp/scheme-like code E.g. (func a (b c d) ) and build a tree from it, I could do the parsing in C without using bison (i.e, using only flex to return tokens and building the tree with recursion). But, with bison grammar, I am not sure where to add the code to build the list (i.e, which rule to...

What does |5E| mean in Common Lisp?

Hello, all! I got following error message in Common Lisp. What does || mean in CL? CL-USER> (write-to-string 5e) The variable |5E| is unbound. [Condition of type UNBOUND-VARIABLE] ...

require and *modules* are deprecated in common lisp?

Common Lisp HyperSpec says that require and *modules* are deprecated. But I still see we use require all the time. What should we use? ...

Make macros and functions integrate more seamlessly

OK, I understand pretty well how to use both function and macros. What I'm curious about is why the compiler can't be a bit more clever when integrating the two, e.g. consider the Clojure code: (defmacro wonky-add [a b] `(+ ~a (* 2 ~b))) (defn wonky-increment [a] (apply wonky-add a 1)) => Error: can't take value of a macro Yes, I kn...

CLISP overflow after multiplication

i'm trying to get a first lisp program to work using the CLISP implementation, by typing (print (mod (+ (* 28433 (expt 2 7830457) 1)) (expt 10 10)))) in the REPL. but it gives me *** - overflow during multiplication of large numbers. i thought lisp features arbitrary size/precision. how could that ever happen then? ...

CAR and CDR of a list in Scheme

Hi all, I am confused as to how car and cdr work on lists. Here is an example of what I have tried: (define sample (read)) (display sample) (display (car sample)) (display (cdr sample)) (display (car (cadr sample))) (display (cdr (cdr sample))) On entering the value '(A B C D E F), here is what I get: '(a b c d e f) quote ((a b c d...

How to install/upgrade Lisp libraries on Debian

I recently discovered that some of my favorite libraries have been removed from Debian, e.g., Hunchentoot: For a while now most Common Lisp projects do not do releases anymore, our plan is to move to proving a cl-build like environment inside debian I've looked at the mailing lists and Debian Common Lisp homepage and not found an...

Overhead of call-by-need / call-by-name Lisp interpreter strategy

I've a partially finished interpreter for a lexically scoped 'pure Lisp' (no set!) that uses a call-by-need evaluation model which comes down to call-by-name with simple caching, the interpreter naturally uses an environment-based evaluation model. The standard way of evaluating lambda abstractions, as in, constructing a new environment...

What does the double minus (--) convention in function names mean in Emacs Lisp

I've been reading through a number of Emacs Lisp packages and have come across the convention of some functions being declared with -- after the library prefix, e.g.: (defun eproject--combine-regexps (regexp-list) I'm wondering if this a convention for declaring "private" functions to the library but so far I haven't found anything in...