lisp

Are the variables *,+, and / bound to recent input in SLIME or Clozure CL?

I was messing around in SLIME (connected a Clozure REPL) when I discovered this: It looks like the variables +, *, and / are all bound to some variation on recent input, + is the input itself, * is the result of evaluating that input, and / is the result contained in a list. Is this right? Who is responsible for this, SLIME or Clozure?...

Emulating lisp cons cells in Tcl

A list in lisp is a series of cons cells, but in Tcl, a list is a string with whitespace separating the elements. For translating code from lisp to tcl, one might simply take lisp lists and translate them to Tcl lists. However, this runs into trouble with side effecting cons cells not coming across to the Tcl code. For example, consid...

Lisp influence on on Factor programming language?

I have read (from Slava Pestov) that Factor was influenced by Lisp, but I am not sure that I can understand how? Are they not very difference programming languages? ...

Closures and dynamic scope?

I think I understand why there is a danger in allowing closures in a language using dynamic scope. That is, it seems you will be able to close the variable OK, but when trying to read it you will only get the value at the top of global stack. This might be dangerous if other functions use same name in the interim. Have I missed some o...

Turning off the result printing in common lisp

I am working with a reasonably large dataset in GNU clisp. It would be really nice if I could turn off the P of the REPL. Having thousands of results spew across my screen really isn't very useful. I rummaged through the docs and couldn't find out how to turn it off. I assume it's one of the variables. ...

Given the the following LISP eval function - what is required to add defmacro?

Given the following definition of the LISP eval function - what is required to add the defmacro function? (Or even just evaluate a macro) (defun null. (x) (eq x '())) (defun and. (x y) (cond (x (cond (y 't) ('t '()))) ('t '()))) (defun not. (x) (cond (x '()) ('t 't))) (defun append. (x y) (cond ((null. x) ...

Emulating lisp cons cells in Python

A list in lisp is a series of cons cells, but in Python, a native list is a different kind of object. For translating code from lisp to Python, one might simply take lisp lists and translate them to Python native lists. However, this runs into trouble with side effecting cons cells not coming across to the Python code. For example, co...

How to guess out the grammars of a list of sentences generated by some way?

I have a lost of sentences generated from http://www.ywing.net/graphicspaper.php, a random computer graphics paper title generator, some of example sentences sorted are as following: Abstract Ambient Occlusion using Texture Mapping Abstract Ambient Texture Mapping Abstract Anisotropic Soft Shadows Abstract Approximation Abstract Appr...

How do I manipulate parse trees?

I've been playing around with natural language parse trees and manipulating them in various ways. I've been using Stanford's Tregex and Tsurgeon tools but the code is a mess and doesn't fit in well with my mostly Python environment (those tools are Java and aren't ideal for tweaking). I'd like to have a toolset that would allow for easy ...

Cannot create apply function with static language?

I have read that with a statically typed language like Scala or Haskell there is no way to create or provide a Lisp apply function: (apply #'+ (list 1 2 3)) => 6 or maybe (apply #'list '(list :foo 1 2 "bar")) => (:FOO 1 2 "bar") (apply #'nth (list 1 '(1 2 3))) => 2 Is this a truth? ...

Common Lisp - Using a function as input to another function

Say I have a function that takes a list and does something: (defun foo(aList) (loop for element in aList ...)) But if the list is nested I want to flatten it first before the loop does stuff, so I want to use another function (defun flatten(aList)) that flattens any list: (defun foo(flatten(aList)) (loop for element in aList .....

How big is a class in memory?

How do I figure out how many bytes a defclass object has in Common Lisp? ...

Anyone using Scheme/LISP for embedded projects?

Hi to all, This question is maybe somehow inspired with Anyone using Python for embedded projects?; so anyone using some Scheme version or Common Lisp (like ECL) for free/oss/commercial projects? Personally, I used (and still using) TinyScheme for personal projects where some embedded language is needed, mostly due extremely easy embed...

Which Scheme IDE's are there?

I am planning on learning Scheme (by following SICP) and afterwards doing a project with this language. However, I was wondering what would be a good IDE for this? I've looked around a bit, but could not really find very much, except something called Edwin? ...

Common Lisp: Why not the array literal evaluate arguments?

Why is it that the Common Lisp array syntax is not evaluating its arguments: (let ((a 1)) #2A((a 2) (3 4))) => #2A((A 2) (3 4)) I would have guessed it was #2A((1 2) (3 4)). Is this because A is not available at reader time? ...

Feedback desired: non-disruptive deployment strategies for production Lisp webapps

I am interested in hearing how people do their Lisp webapp deployments and updates (especially updates) in production. In Ruby many, myself included, use Capistrano for deployments. It provides some nice indirection and the ability to execute commands remotely and most importantly (in my mind) the ability to rollback to a working code ...

Is there a way to dereference a list in common lisp?

Is there a way to dereference a list in lisp? I am trying to compare 2 strings but one is in a list. ...

Why to use LISP today, when there are Scala, Erlang, Haskell etc...

In the past LISP was the only powerful functional programming language, as far as I understand. Now there are lots, why do people still use LISP with its weird syntax? Is there a unique killer-feature of a kind? ...

Multiple lines comments in Scheme (RnRS)

I created this solution: ; use like this: ; (/* content ... */ <default-return>) ; or ; (/* content ... */) => #f (define-syntax /* (syntax-rules (*/) ((/* body ... */) #f) ((/* body ... */ r) r))) But is it really the best or easy way? ...

Problem with treetop grammar, not matching all options

I am writing a small, really simple lisp parser in ruby with the treetop gem just to experiment with it. However, it is not really working out how I want it to, and the documentation is pretty poor so it's hard to understand what I am doing wrong. Currently, the grammar can match both a symbol and a boolean, but not a number. However, wh...