scheme Questions

3

Solved

The object returned by delay in Scheme is "a promise", but promises are not considered to be a type (so there is no promise? procedure, and it's not listed as a type in R5RS or R6RS). Is there a s...
Magnusson asked 23/9, 2010 at 10:37

5

Solved

I have this curry function: (define curry (lambda (f) (lambda (a) (lambda (b) (f a b))))) I think it's like (define curry (f a b)). my assignment is to write a function consElem2All using curry...
Necking asked 26/6, 2011 at 22:21

4

Solved

I'm new to Scheme, have been using MIT Scheme for sometime now. I'm trying to understand how to implement popular graph algorithms like the shortest path algorithms, BFS, DFS. Are there any tutoria...
Behave asked 27/1, 2012 at 13:38

3

Solved

Files of the programming language Scheme are by convention either of the extension .scm or .ss. I'm interested in what the history of these extensions is, and also in the proper use, though it see...
Goldeye asked 26/3, 2016 at 20:39

8

Solved

I'm trying to grasp the semantics of call/cc in Scheme, and the Wikipedia page on continuations shows the yin-yang puzzle as an example: (let* ((yin ((lambda (cc) (display #\@) cc) (call-with-cur...
Complex asked 22/4, 2010 at 21:32

5

Solved

I'm working on a homework assignment where we are asked to implement an evaluation strategy called "call by name" in a certain language that we developed (using Scheme). We were given an example ...
Beardsley asked 3/6, 2010 at 2:34

5

Solved

Im trying to write a simple scheme function that returns the last element of a list. My function looks like it should work, but I managed to fail on something: (define (last_element l)( (cond (nu...
Picture asked 1/11, 2012 at 10:28

4

Solved

Does Scheme or do any dialects of scheme have a kind of "self" operator so that anonymous lambdas can recur on themselves without doing something like a Y-combinator or being named in a letrec etc....
Apetalous asked 28/10, 2011 at 23:57

2

Solved

The question is described on the title, basically I'd like to execute a command line from scheme, let's say 'ls' and obtaining the output. So my questions are: Is it possible? How? Thanks a lot...
Gahl asked 19/10, 2015 at 9:5

9

So I have to remove the last element of a list in scheme. For example, let's say I have a list (1 2 3 4). I need to return: (1 2 3) My idea: reverse(list) car(list) reverse(list) Is there a ...
Ruisdael asked 15/2, 2011 at 16:55

5

Solved

How do you run Scheme programs from the terminal in linux(ubuntu)? Also how to accept arguments from the command-line in a Scheme program? Edit: Im using the DrScheme implementation.
Pantin asked 24/7, 2009 at 6:13

3

Solved

I'm using chez-scheme and I can't find a way to clear the screen completely. (If someone knows a better way than printing I'd be interested in that too but it's not my question here) From what I c...
Weissberg asked 12/6, 2016 at 13:48

2

Solved

Before I start: YES, this is a homework from college. Before I get told that I'm lazy and evil: this part of the homework was to convert two functions we already had, this one is the 6th. (define (...

3

Solved

I am just trying to do very simple code with set-car! and set-cdr! in racket, but I got the error: expand: unbound identifier in module in: set-car! and expand: unbound identifier in module in: set...
Rothman asked 28/2, 2012 at 2:5

2

Solved

Okay, I am new with scheme/racket/lisp. I am practicing creating my own functions, syntax, and recursion, so I want to make my own foldl and foldr functions that do exactly what the predefined vers...
Llama asked 9/2, 2017 at 18:16

4

Solved

PLT Scheme's documentation says: The rationale for providing print is that display and write both have relatively standard output conventions, and this standardization restricts the ways th...
Eliza asked 5/6, 2009 at 16:58

15

Solved

I usually write web apps in PHP, Ruby or Perl. I am starting the study of Scheme and I want to try some web project with this language. But I can't find what is the best environment for this. I am...
Gopherwood asked 14/8, 2009 at 1:10

5

Solved

I want to map a function over the values in a hash table, like so: (hash-map add1 (hash "apple" 1 "pear" 2)) => #hash(("apple" . 2) ("pear" . 3)) Is there a library function to do this? It'd ...
Obligato asked 31/1, 2013 at 18:4

5

Solved

I've started learning Scheme, for fun mostly, and because I've never used a functional language before. I chose Scheme because I wanted to read SICP for a long time. Anyway, I'm currently learning...
Nimrod asked 11/6, 2010 at 11:59

7

I am trying to translate this Python program to Scheme: def test(x): if x > 1: print('foo') if x > 10: return if x == 4: print('bar') test(1) test(2) # prints 'foo' test(4) # prints ...
Hussey asked 27/4, 2014 at 19:24

5

Solved

According to SICP section 1.2.6, exercise 1.22: Most Lisp implementations include a primitive called runtime that returns an integer that specifies the amount of time the system has been running...
Welfarism asked 3/2, 2010 at 20:16

6

Solved

Should I use (apply + (filter prime? (range 1 20))) or (reduce + (filter prime? (range 1 20))) Edit: This is the source for prime in clojure from optimizing toolkit. (defn prime? [n] (con...
Backboard asked 2/8, 2009 at 16:15

7

Solved

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 wort...
Pomerania asked 3/6, 2009 at 12:28

5

In the classic text by Abelson/Sussman, Structure and Interpretation of Computer Programs, in Section 1.2.2 on tree recursion and the Fibonacci sequence, they show this image: The tree-recursive p...
Drudge asked 11/10, 2019 at 0:17

4

Solved

Emacs lisp is a dialect of LISP and especially Scheme. Most of scheme interpreters do have a optimization of Tail Recursion, but emacs lisp doens't. I searched the reason in `info elisp' for a whil...
Overby asked 21/7, 2016 at 2:28

© 2022 - 2024 — McMap. All rights reserved.