I play to self-study 6.001 with the video lectures and lecture handouts. However, I have some problems setting up MIT Scheme in Ubuntu (intrepid).
I used package management and installed MIT-Scheme, but it's obviously the wrong version to use. It should be 7.5.1 instead of 7.7.90
I followed the instructions from this website (http://oc...
problem
I'm using LilyPond to typeset sheet music for a church choir to perform. Depending on who is available on any given week, songs will be played in various keys. We have an amazing pianist who can play anything we throw at her and the guitarists will typically pencil in alternate chords, but I want to make things easier by having...
I'm in the process of learning Scheme. I recently spent (too much!) time trying to find a bug in a program before I realized I was missing the 'else' word in a cond clause. But the behavior in such circumstances appears to be a little weird. Experimenting with the conditions with just a simple program (below) the 'whatever' gets display...
In SICP, (ex 2.6) the following functions are described as ways of 'getting by without numbers'. I'm scratching trying to understand this. As a starting point, how do these functions get invoked? Can I actually apply them in some way where the output will be 1? (Or any other number?)
(define zero (lambda (f) (lambda (x) x)))
(define ...
This is not homework. I'm learning Standard ML on my own. I know a bit of Scheme, too, so this question ought to be answerable in either language.
My self-imposed assignment is to write a function that constructs a list of integers from 1 to n. For example, list(7) should return [1,2,3,4,5,6,7]. An O(n) solution would be ideal.
It's ea...
So if a language provides higher order procedure then I can have procedure that returns procedure... something like
(define (Proc a b c) (lambda (x) ( // method body here in terms of a b c and x)))
To create new proc I would just do something like..
(define ProcA (Proc a1 b1 c1)) // Would create ProcA that has 1 argument
Similar task...
Please help me with using the DrScheme built-in function "filter".
"create a function "hello" that consumes a number 'Max', and a list of numbers 'L', produce a list of numbers in 'L' that are smaller than 'Max'."
edit Taken from the comments for formatting
this is what i have so far
(define (smaller? n Max)
(cond
[(> Max n...
This is a question that I've always wanted to know the answer, but never really asked.
How does code written by one language, particularly an interpreted language, get called by code written by a compiled language.
For example, say I'm writing a game in C++ and I outsource some of the AI behavior to be written in Scheme. How does the c...
I am writing a Scheme-like in interpreter. It seems natural that the Scheme-like interpreter ought to work well with any object that implements IEnumerable.
The interpreter does not allow for mutation - no functions with side effects are exposed.
Because IEnumerable is not cloneable, (see here ), I can't implement iteration over the l...
The Question
What is the most efficient MGU algorithm? What is its time complexity? Is it simple enough to describe as a stack overflow answer?
I've been trying to find the answer on Google but keep finding private .PDFs that I can only access via an ACM subscription.
I found one discussion in SICP: here
Explanation of what a "most ...
I have this code to calculate derivatives:
(define (diff x expr)
(if (not (list? expr))
(if (equal? x expr) 1 0)
(let ((u (cadr expr)) (v (caddr expr)))
(case (car expr)
((+) (list '+ (diff x u) (diff x v)))
((-) (list '- (diff x u) (diff x v)))
((*) (list '+
(list '* u (diff x v...
I want to type something like 'scheme file.scm' and have it interpret the file, and then take me back to my shell, rather than loading it in the REPL.
edit: I tried scheme < test.scm and it still uses the REPL, the only difference is that scheme exits when the stream ends.
...
Hi all,
I come across the word 'thunk' at a lot of places in code and documentation related to Scheme, and similar territories. I am guessing that it is a generic name for a procedure, which has a single formal argument. Is that correct? If yes, is there more to it? If no, please?
For eg. in SRFI 18, in the 'Procedures' section.
...
I'm thinking of designing & implementing my own SQL-equivalent (DDL+DML) that is...
a pure relational algebraic language, and
has an elegant Lisp-/Scheme-like syntax
Assuming an RDBMS such as MySQL, where exactly would I need to start my language design work? On top of the storage engine layer such as InnoDB?
I don't know what all R...
What is implicit recursion? How is it different from explicit recursion?
...
Hi,
I have been using the Module for SICP in DrScheme 4.2 but which language has the best support for SICP in DrScheme?
Has anyone here tried this?
Thanks.
...
> (eq? 1 1)
#t
> (eq? 1.1 1.1)
#f
> (= 1.1 1.1)
#t
This is the interaction window in DrScheme. Could somebody please explain the difference between = and eq? in Scheme?
...
I want it to extract all the words that have a letter e in them.
eg.
(ewords '(i e ee o oo)) -> '(e ee)
Berkeley's 61a lecture uses (first 'word) to extract the first character of the word. However DrScheme screams at me when I try to do that. How do take the first character of the word? like
(first 'word)->'w.
...
Hi,
I am learning Scheme. What is wrong with the code below?I want to write a program that takes the first function from the list and then applies that to a number?
(define num 3)
;;I want to do something like this which returns 3
((λ (x) x)num)
;;but my functions are in a list so this should return3
((first '((λ...
A phrase that I've noticed recently is the concept of "point free" style...
First, there was this question, and also this one.
Then, I discovered here they mention "Another topic that may be worth discussing is the authors' dislike of point free style."
What is "point free" style? Can someone give a concise explanation? Does it have s...