lisp

In Lisp, code is data. What benefit does that provide?

你说的曾经没有我的故事 提交于 2019-11-27 11:12:44
问题 In Lisp, any program's code is actually a valid data structure. For example, this adds one and two together, but it's also a list of three items. (+ 1 2) What benefit does that provide? What does that enable you to do that's impossible and/or less elegant in other languages? 回答1: To make things a little clearer with respect to code representation, consider that in every language code is data: all you need is strings. (And perhaps a few file operations.) Contemplating how that helps you to

How to go about learning Common Lisp and Emacs Lisp?

北战南征 提交于 2019-11-27 11:09:29
问题 The last few months I've been using Emacs extensively as my main development environment and I've now come to a point at which I'd like to learn it's own Emacs Lisp to write my own little stuff for Emacs and extend it to my personal needs. Having said that I've also wanted to learn Common Lisp for a while now, to play around with and explore a new language. My question is, where should I start from? Will Emacs Lisp give me the necessary knowledge to pick up Common Lisp later more easily or

scheme continuations for dummies

心已入冬 提交于 2019-11-27 10:31:57
问题 For the life of me, I can't understand continuations. I think the problem stems from the fact that I don't understand is what they are for . All the examples that I've found in books or online are very trivial. They make me wonder, why anyone would even want continuations? Here's a typical impractical example, from TSPL, which I believe is quite recognized book on the subject. In english, they describe the continuation as "what to do" with the result of a computation. OK, that's sort of

Are there any High Level, easy to install GUI libraries for Common Lisp? [closed]

人盡茶涼 提交于 2019-11-27 10:17:58
问题 Are there any good, cross platform (SBCL and CLISP at the very least) easy to install GUI libraries? 回答1: Ltk is quite popular, very portable, and reasonably well documented through the Tk docs. Installation on SBCL is as easy as saying: (require :asdf-install) (asdf-install:install :ltk) There's also Cells-Gtk, which is reported to be quite usable but may have a slightly steeper learning curve because of its reliance on Cells. EDIT: Note that ASDF-INSTALL is integrated this well with SBCL

References Needed for Implementing an Interpreter in C/C++

烂漫一生 提交于 2019-11-27 10:12:45
I find myself attached to a project to integerate an interpreter into an existing application. The language to be interpreted is a derivative of Lisp, with application-specific builtins. Individual 'programs' will be run batch-style in the application. I'm surprised that over the years I've written a couple of compilers, and several data-language translators/parsers, but I've never actually written an interpreter before. The prototype is pretty far along, implemented as a syntax tree walker, in C++. I can probably influence the architecture beyond the prototype, but not the implementation

How many primitives does it take to build a LISP machine? Ten, seven or five?

偶尔善良 提交于 2019-11-27 10:10:17
On this site they say there are 10 LISP primitives. The primitives are: atom, quote, eq, car, cdr, cons, cond, lambda, label, apply . http://hyperpolyglot.wikidot.com/lisp#ten-primitives Stevey reckons there are seven (or five): Its part of the purity of the idea of LISP: you only need the seven (or is it five?) primitives to build the full machine. http://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptable-lisp.html What is the minimum number of primitives to build a LISP machine (ie something that can run an eval/value function on LISP code)? (And which ones are they?) (I can understand

How is Racket different from Scheme?

末鹿安然 提交于 2019-11-27 10:04:17
Racket is a descendant of Scheme. How is Racket different than R6RS? What did it add, or take away, or is just different? I understand that Racket is more than a language, it's a platform for languages. But I'm referring to the main Racket dialect. Zorf Racket is ultimately based on R5RS, and not R6RS and not a strict superset of either. I don't think it can be called 'Scheme' because it's not backwards compatible with any Scheme standard. Most implementations offer extensions, but are otherwise backwards compatible, of course, the compiler that comes with Racket can also run in R5RS or R6RS

Idiomatic clojure for progress reporting?

风格不统一 提交于 2019-11-27 10:00:40
问题 How should I monitor the progress of a mapped function in clojure? When processing records in an imperative language I often print a message every so often to indicate how far things have gone, e.g. reporting every 1000 records. Essentially this is counting loop repetitions. I was wondering what approaches I could take to this in clojure where I am mapping a function over my sequence of records. In this case printing the message (and even keeping count of the progress) seem to be essentially

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

空扰寡人 提交于 2019-11-27 10:00:30
问题 I will be forward in admiting that my knowledge of Lisp is extremely minimal. However I am extremely interested in the language and plan to begin seriously learning it in the near future. My understanding of these issues is no doubt flawed, so if I say anything which is blatently wrong, please comment and correct me rather than downvoting. Truly Homoiconic and Self-modifiable languages I'm looking for examples of programming languages which support both Homoiconicity (Code has the same

Dr Racket problems with SICP

戏子无情 提交于 2019-11-27 10:00:13
问题 I'm working through SICP. Currently, in the first chapter, I'm having problems getting Racket to let me redefine "primitives". For instance, I was under the impression that I should be able to arbitrarily do (define + 5) and that would be fine, or redefine the sqrt procedure. Instead, I get this: define-values: cannot change constant variable: + I have the language currently set to R5RS, which I was under the impression would take care of the compatibility issues with SICP. 回答1: Even if