scheme

Editing programs “while they are running”? How?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 10:29:22
This question is a corollary to: Editing programs “while they are running”? Why? I'm only recently being exposed to the world of Clojure and am fascinated by a few examples I've seen of "live coding". The question linked above discusses the "why." My question is: How is this live coding technique possible? Is it a characteristic of the clojure language which makes it possible? Or is it just a pattern that they applied which could be applied to any language? I've got a background in python and java. Would it be possible to "live code" in either of these languages like it is possible in clojure?

Sublime Text 2 with MIT Scheme

拥有回忆 提交于 2019-12-03 10:14:47
问题 Does anyone know how i could use sublime text 2 with scheme. I've heard ST2 and I want to try it out? right now I'm learning scheme. I have the scheme interpreter installed - I can go to the terminal and type in scheme and run code. I can also run the interpreter in emacs, but emacs isn't really fun. 回答1: It's probably a little bit late but I'd still like to share my experience... Now I'm using Sublime Text 2 and using Scheme fine. First install the package "Scheme" through package control.

The Little Schemer - Where to start?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 10:05:34
I just cracked open The Little Schemer, and I feel like I'm missing something. The first question asks "Is it true that this is an atom?", but I do not see any definition of what an atom is. I suppose I can derive what an atom is by the answers to the questions, but then it goes on to ask what is the car of l, and what is the cdr of l, and I have no idea what is being asked. Is the purpose of the book to discover what the questions mean by reading the answers, or is there some basic knowledge that I need before I tackle this book? If the latter, can someone point me to where I might acquire

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

北城以北 提交于 2019-12-03 09:06:33
问题 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? 回答1: 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

What are the advantages of scheme macros?

孤者浪人 提交于 2019-12-03 08:27:44
问题 Why would anyone prefer Scheme macros over Common Lisp macros (and I genuinely want to know too, I'm not trying to be a troll)? My experience as a Lisp newb is that Common Lisp style macros are much easier to learn than Scheme's macros. I have yet to see any advantages to Scheme's macros, but of course that doesn't mean they don't exist. I do know that Scheme macros are "hygenic", but I'm still not convinced this is worth the additional complexity. On the other hand though, there obviously

scheme for object-oriented programmers

佐手、 提交于 2019-12-03 08:26:21
问题 I'm thoroughly intrigued by Scheme, and have started with some toy programming examples, and am reading through Paul Graham's On Lisp. One thing I haven't been able to find is a book or website intended to teach Scheme to "OO people", i.e. people like myself who've done 99 % of their coding in c++/Java/Python. I see that closures are sort of object-y, in the sense that they have local state, and offer one or more functions that have access to that state. But I don't want to learn Scheme only

How do I test whether a variable is defined before referencing it?

若如初见. 提交于 2019-12-03 07:38:57
I would like to be able to test whether a variable is defined, prior to accessing it. I like to have a global that specifies a "debug level". If debug level is 0, no extra output is given. When greater than 1, debug output is given, with more verbosity at greater numbers. I also would like to set it up so that the procedures would run, and assume a level 0, if I had not gotten around to defining it. Something like: (where defined? is the magic I don't know how to do? (if (and (defined? debug-level) (> debug-level 1)) (diplay "Some debugging info")) I have looked through the summary of forms in

No idea how to solve SICP exercise 1.11

故事扮演 提交于 2019-12-03 06:43:33
问题 Exercise 1.11: A function f is defined by the rule that f(n) = n if n < 3 and f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) if n > 3 . Write a procedure that computes f by means of a recursive process. Write a procedure that computes f by means of an iterative process. Implementing it recursively is simple enough. But I couldn't figure out how to do it iteratively. I tried comparing with the Fibonacci example given, but I didn't know how to use it as an analogy. So I gave up (shame on me) and

small & readable scheme interpreter in C++?

喜欢而已 提交于 2019-12-03 06:30:45
问题 Anyone know of a good / small scheme interpreter in C++? Perferably something < 2000 LOC, with a simple garbage collectro (either compacting or mark & sweep), no need to support all of R5RS, just basics of if/lambda/set!/cons/car/cdr and some basic operations. Thanks! 回答1: Well, there's a veeery tiny lisp by Gary Knott. Not even close to R5RS, but it's small, and comes with a book describing the internals! However, it's C, not C++, and as far as I can remember there's no GC (but I could be

What is ' (apostrophe) in Lisp / Scheme?

拜拜、爱过 提交于 2019-12-03 06:27:55
问题 I am on day 1 hour 1 of teaching myself Scheme. Needless to say, I don't understand anything. So I'm reading The Little Schemer and using this thing: http://sisc-scheme.org/sisc-online.php as an interpreter. I need to use ' in for example (atom? 'turkey) to avoid an "undefined variable" error. The ' , according to the book, is a Common Lisp thing. I have two questions: Is the interpreter I mentioned above a good one? Can you recommend another? I need one that will go well with The Little