Questions tagged [racket]

Racket is an extensible multi-paradigm programming language in the Lisp/Scheme family.

Racket is a general purpose, multi-paradigm programming language in the Lisp/Scheme family. One of its design goals is to serve as a platform for language creation, design, and implementation. The language is used in a variety of contexts such as scripting, general-purpose programming, computer science education, and research.

Racket Programming Books

Racket documentation is well written and directly accessible from within the DrRacket IDE. It has two great tutorials: one on web applications and one about systems programming.

A great tutorial on macros.

History: Racket was initially called PLT Scheme.

Questions about BSL, HTDP, and other student languages should go into the racket-student-languages tag instead.

5811 questions
9
votes
1 answer

Source code documentation in Racket (Scheme)

Is it possible to write documentation in source files like in Common Lisp or Go, for example, and extract it from source files? Or everybody uses Scribble to document their code?
hsrv
  • 1,372
  • 10
  • 22
9
votes
2 answers

Is anyone using Racket commercially?

I've been reading about how Racket is used for academic research, but I'm having a problem finding commercial success stories in business and/or start ups. Is anyone having any success using Racket commercially or am I barking up the wrong tree? I…
Levi Campbell
  • 6,005
  • 7
  • 40
  • 47
9
votes
1 answer

how can I create a new language in racket?

I would like to create a new language that has the same syntax as typed racket, but when executed will do two things: run the given program as typed racket if type checks, then translates the input into another language (say python). I am planning…
JRR
  • 6,014
  • 6
  • 39
  • 59
9
votes
2 answers

Meaning of letrec in Scheme/Racket

So as far as I understand, the following: let, let*, letrec and letrec* are synthetics sugars used in Scheme/Racket. Now, if I have a simple program: (let ((x 1) (y 2)) (+ x y)) It is translated into: ((lambda (x y) (+ x y)) 1 2) If I…
user4285147
9
votes
4 answers

MiniKanren support by Dr Racket

I started studying miniKanren with the book "The Reasoned Schemer - second edition" and the DrRacket scheme environment. I installed the "faster-minikanren" package, but the first examples of the book with the command run* (for example, (run* q #f))…
Schemer
  • 137
  • 7
9
votes
1 answer

require vs load vs include vs import in Racket

The Racket docs indicate that Racket has separate forms for: require, load, include, and import. Many other languages only contain one of these and are generally used synonymously (although obviously with language specific differences such as…
Leif Andersen
  • 21,580
  • 20
  • 67
  • 100
9
votes
1 answer

*Excruciatingly* slow (over ten seconds for `(+ 1 1)`) with language "How To Design Programs - Beginning Student"

I just installed DrRacket, and tried out the language "How To Design Programs - Beginning Student". Racket - A programmable programming language Racket - Getting Started I run (+ 1 1), and it takes over ten seconds for this to show up: Welcome to…
Owen_AR
  • 2,867
  • 5
  • 20
  • 23
9
votes
3 answers

Why is cond a special form in Scheme, rather than a function?

(defun triangle-using-cond (number) (cond ((<= number 0) 0) ; 1st ((= number 1) 1) ; 2nd ((> number 1) ; 3rd ;; 4th (+ number (triangle-using-cond (1- number)))))) Things that I know about Cond It allows…
9
votes
4 answers

What's the equivalent of Clojure's iterate function in Racket

I'm playing with Racket today, and trying to produce an indefinite sequence of numbers based on multiple applications of the same function. In Clojure I'd use the iterate function for this, but I'm not sure what would be the equivalent in Racket.
interstar
  • 26,048
  • 36
  • 112
  • 180
9
votes
3 answers

Difference between `eval` and `eval-syntax`

According to the documentation eval and eval-syntax behave the same with the exception that eval enriches the input syntax. If top-level-form is a syntax object whose datum is not a compiled form, then its lexical information is enriched before it…
Leif Andersen
  • 21,580
  • 20
  • 67
  • 100
9
votes
2 answers

trying to understand require in language extension

I'm trying to define a new language in racket, let's call it wibble. Wibble will allow modules to be loaded so it has to translate it's forms to Racket require forms. But I'm having trouble getting require to work when used in a language extension.…
john
  • 85,011
  • 4
  • 57
  • 81
9
votes
4 answers

Transpose a matrix in racket (list of lists

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 (list 1 4) …
b4shyou
  • 91
  • 1
  • 1
  • 3
9
votes
1 answer

How to configure the Racket interpreter to support command history?

I've just set up Racket and have been trying out the interpreter. However, I can't seem to go up and down the command history using the arrows (or Ctrlp/Ctrln for that matter) or use Ctrlr to search through it. Is that even supported? Can I build…
Nobilis
  • 7,310
  • 1
  • 33
  • 67
9
votes
1 answer

How do I define functions using Racket macros?

I am trying to write a macro that defines a special class of data structure with associated functions. I know this is possible; it is done multiple times in the core language itself. As a specific example, how would I define the define-struct macro…
nickname
  • 1,187
  • 1
  • 9
  • 20
9
votes
1 answer

Return prematurely from function in Racket

How do I return from a function before reaching the last form in standard Racket? That can be useful to avoid another level of indentation and form nesting. In Common Lisp there is return, a specialized form of return-from. Any equivalent in Racket,…