lisp

Lisp/Scheme interpreter without Emacs?

自古美人都是妖i 提交于 2019-12-03 04:27:46
问题 I've been wanting to teach myself Lisp for a while. However, all the interpreters of which I've heard involve some flavor of emacs. Are there any command line interpreters, such that I could type this into the command line: lispinterpret sourcefile.lisp just like I can run perl or python. While I'd also like to become more familiar with Emacs (if only not to be frustrated when I work with somebody who uses Emacs), I'd rather decouple learning Emacs from learning Lisp. Edit: I actually want to

What is the difference between a variable and a symbol in LISP?

一个人想着一个人 提交于 2019-12-03 04:16:33
问题 In terms of scope? Actual implementation in memory? The syntax? For eg, if (let a 1) Is 'a' a variable or a symbol? 回答1: Jörg's answer points in the right direction. Let me add a bit to it. I'll talk about Lisps that are similar to Common Lisp. Symbols as a data structure A symbol is a real data structure in Lisp. You can create symbols, you can use symbols, you can store symbols, you can pass symbols around and symbols can be part of larger data structures, for example lists of symbols. A

How do I manipulate parse trees?

人走茶凉 提交于 2019-12-03 03:54:47
问题 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 hacking when I need more functionality. Are there any other tools that are well suited for doing pattern matching on trees and then manipulation of those

Lisp Community - Quality tutorials/resources

二次信任 提交于 2019-12-03 03:53:13
问题 As many other people interested in learning Lisp, I feel the resources available are not the best for beginners and eventually prevent many new people from learning it. Do you feel it could be created some sort of community, with a website, forum or something, that provides good (as in quality) resources/tutorials, for Lisp users, possibly translated to several idioms? That way beginners that don't have the necessary skills for writing tutorials could help translating them. Is it a bad idea

How is Lisp's read-eval-print loop different than Python's?

删除回忆录丶 提交于 2019-12-03 03:50:49
问题 I've encounter a following statement by Richard Stallman: 'When you start a Lisp system, it enters a read-eval-print loop. Most other languages have nothing comparable to read, nothing comparable to eval, and nothing comparable to print. What gaping deficiencies! ' Now, I did very little programming in Lisp, but I've wrote considerable amount of code in Python and recently a little in Erlang. My impression was that these languages also offer read-eval-print loop, but Stallman disagrees (at

Why are C, C++, and LISP so prevalent in embedded devices and robots?

自古美人都是妖i 提交于 2019-12-03 03:47:30
问题 It seems that the software language skills most sought for embedded devices and robots are C, C++, and LISP. Why haven't more recent languages made inroads into these applications? For example, Erlang would seem particularly well-suited to robotic applications, since it makes concurrent programming easier and allows hot swapping of code. Python would seem to be useful, if for no other reason than its support of multiple programming paradigms. I'm even surprised that Java hasn't made a foray

Generating LLVM code for 'lambda', 'define'

限于喜欢 提交于 2019-12-03 03:47:13
问题 So I now have a fairly complete LISP (scheme) interpreter written in haskell. Just for fun I want to try to have it compile down to LLVM. Most of the code generation seems pretty straight forward, but I'm at a loss as to how to generate code for a lambda expression (kind of important in lisp ;) ) and how to manage the heap when I encounter a define expression. How might I generated code for these expressions? Note: I can generate code for the body of the lambda expression, What is confusing

Setting up a working Common Lisp environment for the aspiring Lisp newbie

不问归期 提交于 2019-12-03 03:43:47
问题 I've been a UNIX sysadmin for a long time, and aside from automating tasks with shell scripting, some light PHP work, and a few simple C programs, I've never done much in the way of programming. I recently decided to stretch my mind a bit and learn Common Lisp. I'm half-way through Touretzky's "Gentle Intro" and, having just reached the chapter on I/O, I'm wanting to get beyond typing stuff into the REPL as I walk through the book and the exercises. The problem is that I can't find a decent

Is it possible to have an alias for the function name in Lisp?

三世轮回 提交于 2019-12-03 03:35:24
...just like packages do. I use Emacs (maybe, it can offer some kind of solution). For example (defun the-very-very-long-but-good-name () ...) is not to useful later in code. But the name like Fn-15 or the first letters abbreviation is not useful too. Is it possible either to have an alias like for packages or to access the documentation string while trying to recall the function's name? In other words, is it possible for functions to mix somehow self-documenting and short names? Allen You want defalias . (defalias 'newname 'oldname) will preserve documentation and even show "newname is an

What are the tasks of the “reader” during Lisp interpretation?

孤人 提交于 2019-12-03 03:35:20
I'm wondering about the purpose, or perhaps more correctly, the tasks of the "reader" during interpretation/compilation of Lisp programs. From the pre-question-research I've just done, it seems to me that a reader (particular to Clojure in this case) can be thought of as a "syntactic preprocessor". It's main duties are the expansion of reader macros and primitive forms. So, two examples: 'cheese --> (quote cheese) {"a" 1 "b" 2} --> (array-map "a" 1 "b" 2) So the reader takes in the text of a program (consisting of S-Expressions) and then builds and returns an in-memory data-structure that can