Racket is an extensible general programming language in the Lisp family.

learn more… | top users | synonyms

1
vote
0answers
16 views

Number guessing game in Racket

I decided to learn a Lisp-ish language and I am discovering a very weird and new sintax. The obligatory first programme, that also uses all the fundamentals is the number guessing game. Did I ...
2
votes
3answers
69 views

Splitting a list in Racket

I am working my way into learning a bit of Scheme (actually, Racket) with the help of a few practical problems to solve. In this case, I want to split a flat list of symbols at a certain delimiter ...
1
vote
2answers
46 views

Solution to Project Euler #1 - multiples of 3 and 5

I have been programming for about ~2 years, and mostly wrote OOP and structural code. Recently, I have decided to pick up a functional programming language, and Haskell being too alien for me, looked ...
3
votes
1answer
31 views

Digit Summing Function

I'm working through the common divisibility tests, and implementing them in Racket. I'm working on divisible by three, for which I thought it'd be nice to keep summing until I got to a single digit ...
3
votes
0answers
86 views

Graphical editor with geometric intersection

If it is possible I would like some comments on the overall style of the program. It feels like I am writing the whole program as one big script and I'm not sure how to break it down into several ...
9
votes
1answer
127 views

WebSocket-based API library in Racket

I've developed a library in (typed) Racket that wraps a WebSocket-based API. The API itself is very simple—it operates via a series of three-letter commands optionally followed by a JSON-encoded ...
1
vote
1answer
55 views

Extracting values from a list

I had already solved this problem, but in an unnecessarily convoluted way that seems too specific. Can this be done better? From a list: (8 "layer-name" 10 x1 20 y1 10 x2 20 y2 10 x3 20 y3) 8, ...
5
votes
1answer
94 views

Simple evaluator of Scheme-like expressions in Haskell

This is my first nontrivial Haskell program: ...
2
votes
0answers
53 views

Calculating continued fraction expansions (without requiring arbitrary precision decimals)

I'm writing a program that will compute a continued fraction expansion of a number. I've been learning Racket/Scheme for a few weeks and I wanted to see what I can do better. Usage: This program ...
2
votes
1answer
84 views

Finding the subsets of a set

I am trying to write a procedure that finds the power set of a list, that is, the set of 2n subsets (where n is the number of elements in the list). I simply quite find all the subsets. I feel my code ...
1
vote
1answer
108 views

Reading/writing null-terminated strings from socket

I need to handle C style ('\0' delimited) strings from/to a socket and came up with this as a first attempt: ...
16
votes
1answer
202 views

Is this IRC bot utility library Racket-y enough?

To help myself learn Racket, I ported a simple JavaScript ircbot module I wrote for Node.js to Racket. The Racket version is built atop the Racket irc package, so ...
2
votes
1answer
326 views

Solving the N-queens puzzle the Racket or Scheme way

My final version is a direct translation from Python. Thanks to build-in support for generator, its speed is almost the same as Python. As I quite like using generator and list comprehension in ...
4
votes
2answers
66 views

Converting English Measurements to Metric and vice versa

I finished answering Exercise 3.3.1 of How to Design Programs where: Exercise 3.3.1. The United States uses the English system of (length) measurements. The rest of the world uses the metric ...
2
votes
1answer
54 views

Tridiagonal Lists in Scheme

...
5
votes
4answers
232 views

Project Euler 1 (sum of multiples of 3 or 5 under 1000)

I solved this a while ago. In the moment I solved it I was learning Scheme and, well, I still am. I'm not looking at the best solution (I searched for it and coded it already, in Python), what I want ...
2
votes
1answer
167 views

Simplifying Dr.Racket drawing code

I am using Dr.Racket, Intermediate Student with Lambda. I was wondering if there was any way I can simplify this code using any sort of method like lambda, abstraction, map, filter, etc. ...
3
votes
2answers
73 views

Simplifying Dr.Racket alien code

I am using Dr.Racket, Intermediate Student with Lambda. I was wondering if there was any way I can simplify this code using any sort of method like lambda, abstraction, map, filter, etc. ...
4
votes
2answers
280 views

Why is this RC4 code in Racket so slow?

According to shootout.alioth.debian.org, Racket is not much slower than C#, at least in the same order of magnitude due to its JIT compiler. However, I'm seeing at least two degrees of magnitude ...
1
vote
0answers
87 views

Creating an updating hash table

I'm not sure if this implementation is good enough. The function takes a vector of 1 million chars and creates a table of the sequences that pass before the next occurrence of itself. Some questions ...
4
votes
0answers
143 views

Quick Insert Merge Sort

I have written this code to sort a list of numbers, in increasing order. It is a combination of quick sort, insertion sort, and merge sort. I make the first element of the list a pivot, then I go ...
3
votes
1answer
374 views

Scheme/Racket: idiomatic infix math evaluator

Inspired by xkcd and a couple of praising blog posts, I decided to try out Lisp. It seemed that the best-supported dialect was Racket, itself a variant of Scheme, so I went with that and wrote an ...
5
votes
1answer
400 views

Improving a priority queue sketch in Racket/Scheme

I just put together the skeletons for a priority queue using a binary heap in racket/scheme. Using racket/scheme is all about the educational experience and I was wondering if anyone wants to ...
3
votes
1answer
234 views

A Simple Unix Filter in Racket - Learning the Racket Way

I've written the following simple filter in Racket as my first Racket program and am wondering if I am writing it in an "idiomatic Racket style". ...
3
votes
0answers
589 views

Insert-everywhere

This is HtDP Excercise 12.4.2. Develop a function insert-everywhere. It consumes a symbol and a list of words. The result is a list of words like its second argument, but with the first ...