sicp

Can I use Common Lisp for SICP or is Scheme the only option?

时间秒杀一切 提交于 2019-12-03 00:29:37
问题 Also, even if I can use Common Lisp, should I? Is Scheme better? 回答1: You have several answers here, but none is really comprehensive (and I'm not talking about having enough details or being long enough). First of all, the bottom line: you should not use Common Lisp if you want to have a good experience with SICP. If you don't know much Common Lisp, then just take it as that. (Obviously you can disregard this advice as anything else, some people only learn the hard way.) If you already know

How do I get the functions put and get in SICP, Scheme, Exercise 2.78 and on

萝らか妹 提交于 2019-12-02 23:24:12
I am trying to do exercise 2.78 in SICP, but the functions put and get are unknown. I have tried multiple languages, like pretty big, racket, r5rs, mit-scheme, mzscheme, etc. I even downloaded the SICP support (http://www.neilvandyke.org/sicp-plt/), to no avail. How can I get these functions to work? Yes, I found SICP a little annoying sometimes because of stuff like this. Functions that are assumed to exist but don't actually exist make it harder to try to the examples. I wrote my own (get) and (put) like so (this was in GNU guile): (define global-array '()) (define (make-entry k v) (list k v

What does “Data is just dumb code, and code is just smart data” mean? [closed]

浪尽此生 提交于 2019-12-02 18:09:41
I just came across an idea in The Structure And Interpretation of Computer Programs : Data is just dumb code, and code is just smart data I fail to understand what it means. Can some one help me to understand it better? This is one of the fundamental lessons of SICP and one of the most powerful ideas of computer science. It works like this: What we think of as "code" doesn't actually have the power to do anything by itself. Code defines a program only within a context of interpretation -- outside of that context, it is just a stream of characters. (Really a stream of bits, which is really a

Materials for SICP with python?

喜你入骨 提交于 2019-12-02 17:47:37
I want to try out SICP with Python. Can any one point to materials (video.article...) that teaches Structure and Interpretation of Computer Programs in python . Currently learning from SICP videos of Abelson, Sussman, and Sussman. Don't think there is a complete set of materials, this is the best I know. If you are up to generating the material yourself, a bunch of us plan to work through SICP collectively at . I know at least one guy will be using Haskell, so you will not be alone in pursuing an alternative route. bruno desthuilliers A direct translation of SICP in Python would make no sense

What are the actual differences between Scheme and Common Lisp? (Or any other two dialects of Lisp)

巧了我就是萌 提交于 2019-12-02 14:11:35
Note: I am not asking which to learn, which is better, or anything like that. I picked up the free version of SICP because I felt it would be nice to read (I've heard good stuff about it, and I'm interested in that sort of side of programming). I know Scheme is a dialect of Lisp and I wondered: what is the actual difference is between Scheme and, say, Common Lisp? There seems to be a lot about 'CL has a larger stdlib...Scheme is not good for real-world programming..' but no actual thing saying 'this is because CL is this/has this'. This is a bit of a tricky question, since the differences are

Can I use Common Lisp for SICP or is Scheme the only option?

有些话、适合烂在心里 提交于 2019-12-02 14:06:36
Also, even if I can use Common Lisp, should I? Is Scheme better? You have several answers here, but none is really comprehensive (and I'm not talking about having enough details or being long enough). First of all, the bottom line: you should not use Common Lisp if you want to have a good experience with SICP. If you don't know much Common Lisp, then just take it as that. (Obviously you can disregard this advice as anything else, some people only learn the hard way.) If you already know Common Lisp, then you might pull it off, but at considerable effort, and at a considerable damage to your

How to order my accumulate variable in this case on Racket?

北城以北 提交于 2019-12-02 04:47:27
I am coding with Racket for educational reasons. I was given a task in which I should create a function that, without filter, would receive a list as an input and return another list only with the even numbers of the first list. I came up with this recursive definition of an iterative process: (define (add-even lista) (define (iter lista accu) (cond ((null? lista) accu) ((even? (car lista)) (iter (cdr lista) (cons (car lista) accu))) (else (iter (cdr lista) accu)))) (iter lista empty)) It works fine. However, I get the result in a reverse order, e.g.: (add-even '(1 2 3 4 5 6 7)) >> '(6 4 2)

Three questions w.r.t. the environment model of evaluation

﹥>﹥吖頭↗ 提交于 2019-12-01 20:13:18
问题 I am reading the SICP book Here about the imperative programming model. I could not understand the illustration in two points: W.r.t. the arrow from square to the "pair" (the two circles): What does this arrow mean? Though throughout this section, an arrow means "enclosing environment", this specific arrow seems not pointing to an environment.( square 's environment is the global env , not the "pair") Is below a correct understanding: in the value of a procedure definition, its "code text"

Three questions w.r.t. the environment model of evaluation

◇◆丶佛笑我妖孽 提交于 2019-12-01 20:12:32
I am reading the SICP book Here about the imperative programming model. I could not understand the illustration in two points: W.r.t. the arrow from square to the "pair" (the two circles): What does this arrow mean? Though throughout this section, an arrow means "enclosing environment", this specific arrow seems not pointing to an environment.( square 's environment is the global env , not the "pair") Is below a correct understanding: in the value of a procedure definition, its "code text" part (the left circle) has no interpretation of the symbols within. They are just "text". Only at

seek for some explanation on SICP exercise 1.5

无人久伴 提交于 2019-12-01 17:20:22
The question can be found here . In the book, I found one description of normal order evaluation was: "An alternative evaluation model would not evaluate the operands until their values were needed. Instead it would first substitute operand expressions for parameters until it obtained an expression involving only primitive operators, and would then perform the evaluation." I also found another description in short: "fully expand and then reduce". In the exercise, I thought the definition of p was something like (lambda () (p)) , which would never expand to a primitive operator, thus never