Skip to main content

Questions tagged [racket]

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

10 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
313 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 ...
Rajesh Bhat's user avatar
3 votes
0 answers
126 views

Racket macro for variadic FFI

I'm working on FFI wrapper for SDL2 library in Racket. The library includes several variadic functions (e.g. SDL_SetError, SDL_LogMessage etc); Racket FFI does not have straight way for importing ...
Andrew Kravchuk's user avatar
3 votes
0 answers
677 views

Knapsack solution in Scheme/Racket

Following is my solution to Knapsack problem using all combinations of the sent list of items (in Racket programming language). Although it is very short, I am sure it can be improved in many ways. <...
rnso's user avatar
  • 241
3 votes
0 answers
185 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 ...
KRC's user avatar
  • 143
3 votes
0 answers
200 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 ...
Chris Brooks's user avatar
2 votes
0 answers
148 views

Sum of matrix region in racket

I'm learning racket and did simple code challenge in a literate programming style with org mode The problem: Given a matrix of integers and the top left and bottom right coordinates of a ...
George Mauer's user avatar
  • 1,652
2 votes
0 answers
698 views

Simple web API that access sqlite database

This is a very simple web API for a school assignment, as a part of a bigger system. The web API returns a list of courses or a single course as json. I doubt that I will get any feedback on the code ...
paraplyet's user avatar
1 vote
0 answers
111 views

Simply Scheme book: "functions.scm", How to use basic language constructs to create interactive prompt for function application

While reading Simply Scheme by Brian Harvey and Matthew Wright: Part I: Chapter 2 Functions In this chapter you are going to use the computer to explore functions, but you are not going to use the ...
RacketeerHaskeller's user avatar
1 vote
0 answers
87 views

Is this zip function ok?

A slick way to write the zip function in Scheme/Racket: (define (zip . lsts) (apply map list lsts)) (zip '(a b c) '(1 2 3)) '((a 1) (b 2) (c 3)) Is using cons ...
X10D's user avatar
  • 119
1 vote
0 answers
649 views

Cartesian product in racket (Is append-map okay?)

I've read several places that say it's really bad to use append, and I understand why. I read somewhere that it was never even correct to use ...
BrainFRZ's user avatar
  • 819