lisp

Convert string to code in Scheme

How do I convert a string into the corresponding code in PLT Scheme (which does not contain the string->input-port method)? For example, I want to convert this string: "(1 (0) 1 (0) 0)" into this list: '(1 (0) 1 (0) 0) Is it possible to do this without opening a file? ...

What can Lisp do that Lua can't?

Lua's most direct competitor in the scripting arena is Python. So it commonly gets compared with Python, however I've heard many times that Lua is very much like Lisp(Scheme) in terms of expressive power and flexibility. Now I'm a Lua power-user, and know its intricacies in and out, but I've only tried Lisp once or twice, so obviously ...

Are Databases and Functional Programming at odds?

I've been a web developer for some time now, and have recently started learning some functional programming. Like others, I've had some significant trouble apply many of these concepts to my professional work. For me, the primary reason for this is I see a conflict between between FP's goal of remaining stateless seems quite at odds wi...

A J2ME lisp?

It seems that programming ON a mobile device (instead of FOR a mobile device) could be easier if a lisp existed that run on J2ME. Do you know any (preferably opensource) lisp/smalltalk apps? I searched the web and I couldn't find a working J2ME lisp. Is it so difficult to port it to J2ME? Thanks ...

The tool for visual programming

I need the tool for graphical representing of work flow in a program (like electronic circuits are described with graphical representation). The representation has to be like the following: functions are boxes and arrows between boxes are "messages". Like this: This picture shows the following: (c (a) (b)) Where parameters of c() are ...

Elisp performance on Windows and Linux

I have the following dead simple elisp functions; the first removes the fill breaks from the current paragraph, and the second loops through the current document applying the first to each paragraph in turn, in effect removing all single line-breaks from the document. It runs fast on my low-spec Puppy Linux box using emacs 22.3 (10 seco...

How do I count the number of open buffers / files in Emacs?

Every now and then, I accidentally hit C-x C-c in Emacs when I'm intending to just hit C-x or C-c. This, of course, closes all open frames and buffers with no confirmation. I know that I can make Emacs prompt "Are you sure you want to exit?", but I don't want to do that all the time, which would get annoying. I just want it to do it when...

Odd question relating to project euler 72 (lisp)

I recognize that there's an obvious pattern in the output to this, I just want to know why lispbox's REPL aborts when I try to run anything > 52. Also, any suggestions on improving the code are more than welcome. ^-^ (defun count-reduced-fractions (n d sum) (setf g (gcd n d)) (if (equal 1 d) (return-from count-reduced-fractio...

What makes you want to learn Common Lisp? What do you want from it?

I'm working on a toolkit (sort of a live-CD Lisp-in-a-Box) for people new to Common Lisp, and I want to make sure it is broadly satisfying. What is attractive to you about Lisp? What do/did/would you need to get you started and keep you interested? What I have so far: SBCL 10.22, Emacs 22.3, SLIME, and LTK bundled together and config...

"Don't know how to create ISeq from: Symbol" error in Clojure

I have the following Clojure code and I'm not sure why it's not working: (defn match (x y &optional binds) (cond ((eql x y) (values binds t)) ((assoc x binds) (match (binding x binds) y binds)) ((assoc y binds) (match x (binding y binds) binds)) ((var? x) (values (cons (cons x y) binds) t)) ((var? y) (values (cons (cons...

Compile lisp / scheme in Notepad++

Hi! I'm pretty much into lisp at the moment, and unfortunately i'm only available to code on windows. Is is possible to let Notepad++ take care of the interpreting of my scripts, and display the output in the compiler window? If yes, what interpreter would be the best to use? Thanks! ...

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

Emacs Lisp function often start like this: (lambda () (interactive) ... What does "(interactive)" do? ...

How do I make an Emacs keybinding to set a variable?

I've got a variable in Emacs called my-var that I'd like to set whenever I press C-v. How do I do that? I tried this: (defun set-my-var (value) "set my var" (interactive) (defvar my-var value "a variable of mine") ) (global-set-key "\C-v" 'set-my-var) But that fails: call-interactively: Wrong number of arguments: (lambda (...

Can I extend lisp with c++?

Can I call a function from lisp from a library written in c or c++? How can I extend lisp? This is useful when you want to do some system calls or stuff like that. ...

LISP Displaying binary tree level by level

I have a list that looks like (A (B (C D)) (E (F))) which represents this tree: A / \ B E / \ / C D F How do I print it as (A B E C D F) ? This is as far as I managed: ((lambda(tree) (loop for ele in tree do (print ele))) my-list) But it prints: A (B (C D)) (E (F)) NIL I'm pretty new to Common LISP so t...

How do you type lisp efficiently, with so many parentheses?

I try to keep my fingers on home row as much as possible. Typing all the parentheses makes me move away from there a fair bit. I use Emacs; the parentheses themselves are no issue, I'm comfortable with them. And I don't like modes that type them for me automatically. I've thought about remapping the square brackets to parentheses an...

Haskell, Lisp, and verbosity

For those of you experienced in both Haskell and some flavor of Lisp, I'm curious how "pleasant" (to use a horrid term) it is to write code in Haskell vs. Lisp. Some background: I'm learning Haskell now, having earlier worked with Scheme and CL (and a little foray into Clojure). Traditionally, you could consider me a fan of dynamic lang...

Lisp OODB with SQL backend - or good ORM

Are there any good Lisp OODBs implemented on top of SQL databases, or good Lisp ORM solutions? I want the administrative features and IT-familiarity of a RDMS, but still get the power of OO. Any recommendations? The state of the art, at least in non-commercial solutions, seems not to have advanced much in the past few years. I'd rath...

What's the best way to learn LISP?

Hi, I have been programming in Python, PHP, Java and C for a couple or years now, and I just finished reading Hackers and Painters, so I would love to give LISP a try! I understand its totally diferent from what i know and that it won't be easy. Also I think (please correct me if I'm wrong) there's way less community and development aro...

Array upgrading

If I understand Section 15.1.2.1 of the Common Lisp standard correctly, it is perfectly legal for (upgraded-array-element-type '(unsigned-byte 8)) to be '(unsigned-byte 16), or even t. My question is therefore about the actual behavior of implementations. Are there any implementations in use today where '(unsigned-byte 8) or '(unsigned...