scheme

How to choose what scheme to use for emacs?

I have the following code in ~/.emacs for running scheme (gosh and mit-scheme). ;(setq scheme-program-name "gosh -i") (setq scheme-program-name "mit-scheme") (autoload 'scheme-mode "cmuscheme" "Major mode for scheme." t) (autoload 'run-scheme "cmuscheme" "Run an inferior scheme process." t) (defun scheme-other-window () "Run scheme on...

After "The Little Schemer", what's next?

So I just read The Little Schemer and found it really good! I had no prior functional programming background, apart from the "infamous" parenthesis myth I so much heard about Lisp :P I found it an amazing read and now I'm starving for more. However, after searching a bit, I found this post about a Scheme Bookshelf. In that, the author s...

Packaging system in Racket

I would like to use the R6RS library/module system as detailed in Dybvig's TSPL4 chapter 10 in Racket. I selected "Pretty Big" language in DrRacket. But when I do (import (list-tools setops) (more-setops) (rnrs)) on the top window and run, I get this error: "import: misuse of unit keyword in: (import (list-tools setops) (more-setops)...

Tasks unsuited for dynamic scoping

Hi! Can you give me some examples of tasks unsuited for dynamically scoped lisps? I'm failing to see how the Lexical scope is so much better and not just a matter of changing the coding style, so I'd love to code something and see it with my own eyes. Thanks! ...

Compiling Scheme to Java and/or Objective-C

We have Bigloo.NET does anyone know of such a project that offers the same but for the Java and/or Objective-C language? I am developing a component of a project that will also have a Windows and Apple GUI built around it. Would be nice if I could develop this component in a single language and have it compiled into the native language ...

Dr Racket problems with SICP

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 v...

Multiple (define)s in a CL style macro [scheme]

I'm currently learning how to write CL style macros (define-macro) in Scheme. As a simple example, I wrote a struct macro that defines functions like make-thing, thing?, thing-field accessors and so on. Now I'd like to combine multiple defines in a single macro, but only the last one is actually used. Currently I'm using eval to define ...

Scheme: Using only R6RS, how do I determine a flonum's mantissa and exponent

Is this possible to extract mantissa and exponent from a float in major R6RS Scheme implementations so that: v = f x b^e f - mantissa b - base e - exponent For example: 3.14 = 0.785 x 2^2 If it's not supported, I'd like to have access to flonum's (IEEE 754) bits directly to approach the problem of extracting the above values, but I'v...

In clojure, is (= 'a 'a) referring to the 'same atom'?

In some implementations of Common LISP we can say that for the following expression (eq 'a 'a) Is true because 'a and 'a are the "same atom". This may be implementation dependent, but it seems the phrase (used in a popular LISP teaching book) assumes that atoms of the same value are stored in the same location in memory. In Java, ...

Problem with 'let' syntax in scheme

I'm going through "Structure and Interpretation of Computer Programs" and I'm having a bit of trouble doing one of the exercises ( 2.1 ) . I'm coding in DrRacket in R5RS mode. here's my code : (define (make-rat n d) (let (((c (gcd n d)) (neg (< (* n d) 0)) (n (/ (abs n) c)) (d (/ (abs d) c))) (cons...

SICP Accumulate function

In Structure and Interpretation of Computer Programs (SICP) Section 2.2.3 several functions are defined using: (accumulate cons nil (filter pred (map op sequence))) Two examples that make use of this operate on a list of the fibonacci numbers, even-fibs and list-fib-squares. The accumulate, filter and map functions are de...

Flickr Web application URL scheme problem

Hi, I am developing an iPad application that used Flickr API services (Objective Flickr). As mentioned in the document: 1. Obtained the Consumer Key and Secret for my app. 2. Modified the App type as web application 3. Updated Callback URL as neo://auth 4. In info.plist of my app, added new entry for URL types: URL identifier : same as...

Anyone using Scheme/LISP for embedded projects?

Hi to all, This question is maybe somehow inspired with Anyone using Python for embedded projects?; so anyone using some Scheme version or Common Lisp (like ECL) for free/oss/commercial projects? Personally, I used (and still using) TinyScheme for personal projects where some embedded language is needed, mostly due extremely easy embed...

Which Scheme IDE's are there?

I am planning on learning Scheme (by following SICP) and afterwards doing a project with this language. However, I was wondering what would be a good IDE for this? I've looked around a bit, but could not really find very much, except something called Edwin? ...

Small question about scheme.

I'm very new to lisp and recently i discovered the thin that I don't understand. This code works: (define (f x) (define a x) (define (b) a) (b)) And this doesn't: (define (f x) (define a x) (define b a) b) Why? ...

Common Lisp or Scheme for server-side?

I wonder if some functional languages are used for web development and which are most useful and supported with that goal? ...

Multiple lines comments in Scheme (RnRS)

I created this solution: ; use like this: ; (/* content ... */ <default-return>) ; or ; (/* content ... */) => #f (define-syntax /* (syntax-rules (*/) ((/* body ... */) #f) ((/* body ... */ r) r))) But is it really the best or easy way? ...

Any way to write a unit test framework in Scheme without either apply or macros?

I am wondering if there is a way to write a test framework (a very small one, just as an interesting example of Scheme code) that uses neither APPLY nor macros. I suppose not, since any test framework would need to at least get a list of arguments and apply procedures to them. ...

Difference between a procedure and a combinator?

I've been using Scheme and Common Lisp for a while and there is one thing about nomenclature that I never got: I know that combinators are procedures with no free variables, but I seldom see them being called "combinators", except for those that deal with lists and other sequences. Is my perception correct? Or is there some other defini...

Common uses of letrec, named let and internal defines?

I have a couple of books on Scheme, and some of them mention named let and letrec, but none will actually give a convincing example of each (I mean, when and why would I use one instead of the other). Are there examples of situations where letrec/named let would be really a better alternative than an internal define, or even an outside a...