r/Racket • • 2d ago

homework Help - Lists Test for Racket tomorrow

0 Upvotes

I need any crash courses or any materials you have on racket terminology. I have been taking notes and studying, but I feel like I don't understand concepts well enough, so my brain basically freezes whenever I take a timed test. If there's anything that can help, please tell me. I got tutored 3 times, went to office hours, and completed study material for my last test and still failed. My grade is still in the low Bs and I only have a month to get it up to the low 90s or its going to completely drag down my GPA. Please don't just respond with a video, give me maybe 3 and some practice questions. I'll probably be studying for hours (Chem test tomorrow as well) so I have time to do anything you throw at me. I need any and all help I can get.

Terms list: (We've already learned recursion, so my teacher may be combining list functions and recursion) We could use these functions to complete questions like the ones below.

13. (my-map f L)

Write a function my-map that takes 2 parameters: f is a function that takes one value and a list L. Return a new list made by applying f to every item of L.

Note: add1 is a built-in Racket function that adds 1 to a number.

Test cases:
(my-map add1 '(1 2 3))     -> '(2 3 4) 
(my-map list? '(1 () a))      -> '(#f #t #f)
(my-map add1 '())             -> '()

  • append: A higher-order function that joins multiple lists into a single sequential list.

  • build-list: A list constructor that creates a list of length n by evaluating a function across integer indices 0 to n-1.

  • car: A selector primitive that returns the first element of a list (identical to first).

  • cdr: A selector primitive that returns a list minus its first element (identical to rest).

  • cons: The primitive constructor procedure that prepends an element onto the front of a list or joins two elements into a pair.

  • Data Structure: A specialized format and combination of values designed to organize, process, retrieve, and store data.

  • empty? / null?: Predicate procedures that return #t if a given list contains no elements, and #f otherwise.

  • filter: A higher-order function that evaluates a predicate on each item of a list, returning a new list containing only the items that returned #t.

  • first: A selector function that returns the value in the head node of a list.

  • foldl: A higher-order function that processes list items from left to right, combining them into a single accumulated result.

  • foldr: A higher-order function that processes list items from right to left to produce a single accumulated result.

  • Head: The first node of a linked list.

  • Iteration: The process of repeating a sequence of instructions automatically across data elements.

  • length: A utility function returning the count of top-level items in a list.

  • Linked List: A sequential data structure composed of chained nodes.

  • list: A constructor procedure taking zero or more arguments and returning a list containing those items.

  • map: A higher-order function that applies a procedure to corresponding elements of one or more lists, returning a list of the results.

  • member: A utility function that searches for an element in a list, returning the remaining sublist starting from the element if found, or #f if absent.

  • Node: The fundamental element of a linked list, containing a data value and a reference to the next node.

  • rest: A selector function that returns all nodes of a list following the head node.


r/Racket • • 4d ago

tip im failing racket in uni

0 Upvotes

what should i do? im on the edge of failing. TA's telling me to withdraw the course but i don't wanna repeat this entire thing. no matter how much i study on it and practice on the exam i forget the entire concept since i can try the code and debug.


r/Racket • • 6d ago

release sift now also supports Racket :)

Thumbnail gallery
15 Upvotes

r/Racket • • 9d ago

UK Racket meet-up (London) Tuesday 17 November 2026

Thumbnail
reddit.com
8 Upvotes

r/Racket • • 13d ago

homework Hi, it's me again! Some help?

0 Upvotes

I had an assignment to complete earlier and due to an issue with a recursive function I lost all my code - about 5 hours before it was due. I completed the assignment with the correct answers but there's an issue in the code that is causing it to run void. Does anyone know what the issue is? I'm using WeScheme since Racket doesn't work on my computer, but the syntax is the same. The assignment is being graded soon (and I don't know exactly when) and is worth the same as an assessment (70% of my grade) so I cannot really afford any issues. I can still edit it for now but will not be allowed to change or redo anything after grading. My teacher does not offer extra credit.

;; Question 1

;;; tree-apples -> integer

; n : integer

(define (tree-apples n)

(if (= n 0)

0

(if (odd? n)

(+ 3 (tree-apples n))

(+ 5 (tree-apples n)))))

(tree-apples 7)

;; Question 2

;;; triangle -> integer

; n : integer

(define (triangle2 n)

(if (= n 0)

0

(if (= n 1)

1

(+ n (triangle2 (- n 1))))))

(triangle2 2)

;; Question 3

;;; count2 -> integer

; n : number

(define (count2 n)

(if (= n 0)

0

(if (= (remainder n 10) 2)

(+ (count2 (quotient n 10)) 1)

(count2 (quotient n 10))))

(count2 243)

;; Question 4

;;; sequence -> integer

; n : integer

(define (sequence n)

(if(= n 1)

1

(sequence (+ (- n 1) 3))))

(sequence 3 1)

;; Question 5

;;; root2 -> number

; n : integer

(define (root2 n)

(if

(= n 1)

1

(root2 (/ (- n 1)(expt n 2)))))

(root2 7 1)

;; Question 6

;;; gcd -> integer

; p : integer

; q : integer

(define (gcd2 p q)

(if

(= q 0)

p

(gcd2 q (modulo p q))))

(gcd2 35 15)

;; Question 7

;;; sum-of-squares-helper -> integer

; a : integer

; b : integer

(define (sum-of-squares-helper a b acc)

(if

(> a b)

acc

(sum-of-squares-helper (+ a 1) b (+ (expt a 2) acc))))

(define (sum-of-squares a b)

(sum-of-squares-helper a b 0))

(sum-of-squares 1 3)

;; Question 8

;;; power-n -> integer

; x : integer

; n : integer

(define (power-n-helper x n acc)

(if

(= n 0) acc

(power-n x (- n 1) (* acc x))))

(define (power-n2 x n)

(power-n-helper x n 1))

(power-n 2 3)


r/Racket • • 16d ago

homework Help with Intro to CS test - tomorrow

0 Upvotes

I've been having some issues in understanding concepts in CS, and although I've gone to tutoring and gotten my grade up a bit, knowing and understanding base concepts would help significantly, especially since we do cover material very quickly. My test tomorrow is exclusively on recursion, specifically tail and non-tail. I've been able to complete non-tail recursions correctly for the study guide given, but am having a bit of a harder time with the tail recursions (below). I also need to go over if and cond statements, which I can do correctly but don't have an entirely firm grasp of, and the basic syntax - things like memorizing quotient, remainder, modulo etc. The questions are :

7. Write a tail-recursive function sum-of-squares, where a <= b, that computes: a ^ 2 + (a + 1) ^ 2 + (a + 2) ^ 2  + ... + b ^ 2. You may write a helper function.

Write a procedure that computes the sum of the squares of every integer from a to b:

a² + (a+1)² + (a+2)² + … + b²

For example, (sum-of-squares 2 4) computes 2² + 3² + 4² = 4 + 9 + 16 = 29.

Your solution must be tail-recursive: the recursive call must be the very last thing the procedure does, with nothing left to compute after it returns. 

a. The helper: (sum-of-squares-helper a b acc)

b. The wrapper: (sum-of-squares a b), the wrapper should contain no recursion of its own.

Examples:

(sum-of-squares 1 1) => 1
(sum-of-squares 5 5) =>  25
(sum-of-squares 1 3) => 14
(sum-of-squares 2 4) => 29

8. Write a tail-recursive function that computes x ^ n (x to the power of n). Name your function power-n. 

For example, (power-n 2 3) computes 2 × 2 × 2 = 8.

Your solution must be tail-recursive.

a. The helper: (power-helper x n acc)

b. The wrapper: (power-n x n). The wrapper should contain no recursion of its own.

Examples:

(power-n 2 0)   => 1
(power-n 2 1)   => 2
(power-n 2 3)   =>  8

I can answer these on my own, so please do not give the answers, but provide a very basic explanation - visual if possible - and label each component. Thank you!


r/Racket • • 17d ago

paper Stepper is not working

6 Upvotes

I am going through htdp and everytime I use the stepper (on a function that has steps) the following happens:

The Stepper popup appears and says "All of the definitions have been successfully evaluated"

Below is the function I am evaluating

May someone please assist with this?


r/Racket • • 20d ago

Racket (online) meet-up: Saturday, 7 November 2026 at 18:00 UTC

Thumbnail pasterack.org
4 Upvotes

r/Racket • • 26d ago

Happy Halloween Racketeers and Rhombunauts*

Post image
19 Upvotes

Happy Halloween Racketeers and Rhombunauts*

This image was not created with GenAI tools.
It was made with Pict the Functional Pictures library - also available in Rhombus https://rhombus-lang.org

‘Rhombunauts’ is not official - I just made it up.(didn’t use genAI for that either)

https://functional.cafe/@racketlang/117529933848067788
https://bsky.app/profile/racket-lang.org/post/3mz3su2tf7b2x


r/Racket • • Oct 13 '26

UK Racket meet-up (London) Tuesday 20 October 2026

Thumbnail
reddit.com
9 Upvotes

r/Racket • • Oct 08 '26

Missed RacketCon this year?

17 Upvotes

# Missed RacketCon this year?

The videos are now available at https://con.racket-lang.org or https://youtube.com/playlist?list=PLac8FQVpsRAU&si=fPf0NNLIMv14WtfR

Discuss on the Racket [Discourse](https://racket.discourse.group/invites/VxkBcXY7yL) and [Discord](https://discord.gg/6Zq8sH5)

Please consider sponsoring us https://racket-lang.org/rplf.html


r/Racket • • Oct 02 '26

RacketCon RacketCon listen party & Racket meet-up Sat, 3 Oct 2026

Thumbnail
racket.discourse.group
9 Upvotes

r/Racket • • Sep 27 '26

question How do I learn racket fast where do I start? I want to learn 100% of racket maybe

Thumbnail reddit.com
0 Upvotes

r/Racket • • Sep 26 '26

question Any videos on making external DSLS in racket the BRO CODE atyle

0 Upvotes

I don't like educational videos on learning making external DSLS in racket but I can't find the "BRO CODE STYLE" on YouTube can you guys help?


r/Racket • • Sep 24 '26

RacketCon (sixteenth RacketCon) is almost here!

Thumbnail reddit.com
11 Upvotes

r/Racket • • Sep 18 '26

package Polars Dataframe bindings for Racket

27 Upvotes

https://github.com/bkc39/rkt-polars

Here is a preliminary version of polars (/pandas) data frame processing in Racket. I have been using it for a few weeks and I think it has most "basic" features one would want from a data frame.

Currently only supports linux and macOS because I do not have Windows but if there is interest I can try to ship a binary for it down the line.


r/Racket • • Sep 18 '26

RacketCon (sixteenth RacketCon) tickets on sale now

11 Upvotes

(sixteenth RacketCon) tickets on sale now

October 3-4, Oakland, Ca https://con.racket-lang.org/

Get your tickets now at https://www.eventbrite.com/e/racketcon-2026-tickets-1997181002140

* Professional $120
* Patron $150
* Student/Retired $35

Includes Saturday lunch and Saturday evening social event.

**Can’t attend in-person?**

* Remote Participant $10
The live stream is publicly available, but buying this ticket helps pay for the live stream and ensure its availability for the entire community.


r/Racket • • Sep 13 '26

What if you're right and they're wrong?

Post image
31 Upvotes

What if you're right and they're wrong?

Poster from #fargo created with Racket and Rhombus

https://gist.github.com/racket-raccoon/1548ac70a7d071eae10fda31c44fec07

for the Rhombus picture competition https://racket.discourse.group/t/summer-rhombus-picture-competition-2026/4282

Enter now! Learn some Racket and Rhombus https://racket-lang.org https://rhombus-lang.org


r/Racket • • Sep 13 '26

event Early registration for Racketcon ends in 14 hours

Thumbnail reddit.com
5 Upvotes

r/Racket • • Sep 08 '26

show-and-tell (display (((1 . + . 2) . * . 3) . = . 9))

Thumbnail docs.racket-lang.org
12 Upvotes

r/Racket • • Aug 31 '26

question I'm interested in learning all about the racket programing language

Thumbnail reddit.com
2 Upvotes

r/Racket • • Aug 30 '26

Racket meet-up (online) Saturday, 5 September 2026

Post image
12 Upvotes

Racket meet-up(online) Saturday, 5 September 2026 at 18:00 UTC EVERYONE WELCOME 😁 Details and discussion https://racket.discourse.group/t/racket-meet-up-online-saturday-5-september-2026-at-18-00-utc/4363 https://luma.com/scx2kbei


r/Racket • • Aug 29 '26

language How to learn the racket programing language efficiency

Thumbnail reddit.com
5 Upvotes