racket Questions

2

I'm using VSCode as my racket IDE, and while all the code compiles, none of the indentation features work. I've installed a variety of racket extensions (Magic Racket and such), so the code is al...
Whitherward asked 22/10, 2019 at 21:0

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

3

Solved

I am trying to use unit-tests with Racket. Usually, I am successful and I really like rackunit. However, I am having trouble with this specific case. The function to be tested outputs two values....
Serinaserine asked 10/12, 2016 at 23:26

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

I'm having no luck finding a way to have this work the way I'd like it to, so if anyone could help that would be so greatly appreciated. What I'd like is to be able to do this on Terminal: > r...
Keslie asked 16/4, 2013 at 17:33

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

3

Is there any way of adding sections to an already-linked executable? I'm trying to code-sign an OS X executable, based on the Apple instructions. These include the instruction to create a suitable...
Monomorphic asked 26/10, 2010 at 9:49

2

I'm trying to use the json package in Typed Racket, but I'm having some trouble handling how to type the jsexpr? predicate. My first attempt was simply using #:opaque. (require/typed json [#:opaq...
Nomadic asked 4/12, 2014 at 21:57

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

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

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

4

Solved

I am studying the language racket and trying to grasp what call/cc is actually for. Could someone please explain it in simple words and give an example or two? Thanks.
Brahma asked 6/4, 2014 at 0:50

3

Solved

Need to write a to-string function that accepts integer and string. (to-string 3) ; -> "3" (to-string "hello") ; -> "\"hello\"" (to-string "hel\"lo") ; -> "\"hel\\\"lo\"" I managed to d...
Geddes asked 27/12, 2015 at 12:51

7

Solved

Example: How to convert list: '(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) Into list of lists: '((0 1 2 3) (4 5 6 7) (8 9 10 11) (12 13 14 15)) Based on answers provided here so far, this is what...
Concurrent asked 4/1, 2012 at 11:9

6

Solved

For the love of the almighty I have yet to understand the purpose of the symbol 'iamasymbol. I understand numbers, booleans, strings... variables. But symbols are just too much for my little impera...
Annis asked 13/1, 2012 at 6:8

4

I got a list of lists in racket and have to transpose them. (: transpose ((list-of(list-of %a)) -> (list-of (list-of %a)))) (check-expect (transpose (list (list 1 2 3) (list 4 5 6))) (list (...
Runnerup asked 11/6, 2015 at 8:4

10

I'm trying to reverse a list, here's my code: (define (reverse list) (if (null? list) list (list (reverse (cdr list)) (car list)))) so if i enter (reverse '(1 2 3 4)), I want it to come out ...
Collinear asked 25/2, 2013 at 0:7

3

It’s common for explanations of continuations to say that a continuation represents the “rest of the program” (or similar phrasing). But there’s plainly a boundary at which the continuation stops c...
Lentigo asked 13/8, 2021 at 21:44

5

Solved

I am going through SICP as a self-study and am on the picture language section in Chapter 2. I have been using DrRacket for the earlier exercises, but I get compilation errors when trying to do an ...
Angeles asked 27/11, 2012 at 20:19

2

Solved

I am currently learning miniKanren by The Reasoned Schemer and Racket. I have three versions of minikanren implementation: The Reasoned Schemer, First Edition (MIT Press, 2005). I called it TRS1 h...

3

Solved

I started to study Scheme and I do not understand some of it. I'm using DrRacket. I wrote the following code: (define mult_mat (λ (A B) (Trans_Mat (map (λ (x) (mul_Mat_vec A x)) (Trans_Mat B))...
Bikaner asked 5/9, 2018 at 11:30

4

Solved

What's the best way to read input from stdin in racket? In particular I'd like something like cin from c++ or scanf from c where I specify the types of things I want read and they are returned.
Allard asked 14/11, 2011 at 10:5

6

Given two lists, return a list whose elements are lists of size two, such that for the i-th list, the first element is the i-th element of the first original list, and the second element is the i-t...
Frederiksberg asked 10/2, 2014 at 22:8

© 2022 - 2024 — McMap. All rights reserved.