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...
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...
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...
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....
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 ...
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...
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 (...
Fossilize asked 21/3, 2011 at 8:50
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...
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...
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...
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 ...
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...
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 ...
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...
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...
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...
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...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.