scheme

DrScheme versus mzscheme: treatment of definitions

One long term project I have is working through all the exercises of SICP. I noticed something a bit odd with the most recent exercise. I am testing a Huffman encoding tree. When I execute the following code in DrScheme I get the expected result: (a d a b b c a) However, if I execute this same code in mzscheme by calling (load "2.67.s...

Any real world experience debugging a production functional program?

I'm interested in what tools and methods are used for diagnosing flaws in large scale functional programs. What tools are useful? My current understanding is that 'printf' debugging (e.g. add logging and redeploy) is what is typically used. If you've done debugging of a functional system what was different about it then debugging a ...

What's the best way to learn LISP?

Hi, I have been programming in Python, PHP, Java and C for a couple or years now, and I just finished reading Hackers and Painters, so I would love to give LISP a try! I understand its totally diferent from what i know and that it won't be easy. Also I think (please correct me if I'm wrong) there's way less community and development aro...

How do I get a scheme interpreter working inside Emacs?

I'm going through SICP and I'd like to have an interpreter analogous to the interactive Python interpreter to play around in while I'm watching the lectures and reading the book. Furthermore, I'd like this interpreter to run inside Emacs so I can jump back and forth between files of scheme code and the interactive interpreter and so fort...

How to enable native threads support in Bigloo Scheme in OS X?

I am trying to compile Bigloo Scheme from source and I cannot figure out how to enable native thread support via ./configure in OS X 10.5 (Leopard) (and I haven't read anywhere that threading is not supposed to work on this platform). I run ./configure --enable-sqlite --enable-web --enable-ssl --enable-pthreads --enable-fthreads, but th...

Scheme Project Ideas

I am interested in improving my Functional Programming skills and I believe that the best way to do this is by working on a medium-sized project. In the past I have worked with Scheme and would like to continue to do so. Can someone please suggest some medium-sized Scheme project ideas? (Note: I am well-versed in C (ANSI C89/ISO C90), so...

Converting an integer Into a List?

Hi, i am currently trying to convert an integer into a list. E.g. 1234 => List composed of 1, 2, 3, 4 I have this: (string->list (number->string 1234)) Unfortunately it adds #'s and \'s to it. I am guessing this is a string representation of a number. How can i remove these symbols. Since i need to reorder the integers, and print o...

What is the best Scheme or LISP implementation for OS X?

I am looking for a version of Scheme or even LISP that I can use to recover some lost Lisp development skills. Some web capabilities would be nice but not essential. I've looked at Plt and MIT scheme and, while both look pretty good, the Plt seems to be more feature rich. I've also looked at Lisp implementations but all of the seem q...

Assigning a list of atoms in Scheme

I'm trying to learn Scheme from the book "The Little Schemer" using DrScheme on a Macintosh. It starts with things like "What is the car of l where l is the argument (a b c)?" I understand that the answer to this question is a, but I'm not able to actually figure out what to type into Dr Scheme to "follow along". A simple idea on how t...

are scheme functions one liners ?

Hi, I am following SICP to learn, and while attempting to solve Ex 1.3 I arrived at the following code as my first attempt: (define (sumsq a b c)( (define highest (if (> (if (> a b) a b) (if (> a c) a c)) (if (> a b) a b) (if (> a c) a c))) (define second_h (if (> (if (> a b) b a) (if (> a c) c a)) (if (> a b) b a) (if (> a c) c a))) (...

Using ironscheme in visual studio 2008

Though it says on the IronScheme codeplex site that a plugin is included for visual studio, I have no idea how to get ironscheme working with VS... Is it possible? If so , how? Thanks ...

In Scheme, what's the point of "set!" ?

What's the point of using the set! assignment operator in scheme? Why not just rebind a variable to a new value using define? > (define x 100) > (define (value-of-x) x) ;; value-of-x closes over "x" > x 100 > (value-of-x) 100 > (set! x (+ x 1)) > x 101 > (value-of-x) 101 > (define x (+ x 1)) > x 102 > (value-of-x) 102 > ...

What software has been written in Scheme?

I loved Scheme in the programming languages concepts class I took several years ago. Ever since reading what Paul Graham has to say about Lisp, I've been intending to go back and pick Scheme up again and see if it'll improve my programming in general. Are there any well-known works of software written in Scheme? Open source packages? ...

Correct threads usage in Scheme (Bigloo)

Hi, I'm trying to write an application server in Scheme with Bigloo implementation. The code: (module server (library fthread) (main main)) (define *port-num* 8080) (define (main argv) (let* ((socket0 (make-server-socket *port-num*)) (ts (thread-start! (make-thread (lambda () (start-server socket0)))))) ...

How to append to a file using Scheme?

I am using TinyScheme (actually Script-Fu in GIMP), and cannot find a good way to open a file and append a line of text to it. I am trying to log some info to the file for debugging, and transcript-on doesn't seem to be implemented... Right now I am scraping along by reading the entire file (one character at a time!), concatenating tha...

How to make a better mapper in Scheme using Streams

The Scheme implementation of map takes N+1 arguments: a procedure of N arguments, and N lists. Further, it terminates mapping when the end of the shortest list is reached. An alternative is to provide a default value for each list, which will be treated as the next element(s) of each list if it turns out to be shorter than the others. ...

Which Lisp should I learn?

To piggyback on http://stackoverflow.com/questions/59428/learning-lisp-scheme-interpreter, O gods of StackOverflow: Which Lisp (dialect) should I learn, and why? The fragmentation between CL and Scheme slows uptake (at least for me!). So give me the True Answer, please. I have tried to read feature comparisons, and they seem to get...

Array representation in scheme

Hi I am a newbie to the realm of functional programming and have just started learning Scheme (though it is a semi-functional programming language). I did some tutorials on lists which is well supported in Scheme. I was wondering whether Scheme has support for fiddling with arrays ? Or do I need to define my own data type ? Lists are ...

Why doesn't C# have lexically nested functions?

Why might the C# language designers not have included support for something like this (ported from Structure and Interpretation of Computer Programs, second ed., p. 30): /// <summary>Return the square root of x.</summary> double sqrt(double x) { bool goodEnough(double guess) { return Math.Abs(square(guess) - x) < 0.001; } doub...

Self-referential data structures in Lisp/Scheme

Is there a way to construct a self-referential data structure (say a graph with cycles) in lisp or scheme? I'd never thought about it before, but playing around I can find no straightforward way to make one due to the lack of a way to make destructive modification. Is this just an essential flaw of functional languages, and if so, what a...