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
10
votes
9 answers

Large projects built on Lisp

What are some examples of large projects (e.g., web sites) programmed in Lisp or a Lisp framework?
Tom H
  • 11
  • 1
  • 3
10
votes
2 answers

Capturing a variable number of arguments via an ellipsis in a nested macro; Missing pattern variable error

Consider a scenario of two macros: the outer-macro defines a general structure of some entity, and the inner-macro expands in the scope of the outer macro. My intent is captured in the following code, where the expected output is a print statement.…
Sam
  • 776
  • 2
  • 8
  • 22
10
votes
1 answer

How to test the throwing of errors in racket?

I'm currently working in some racket programs, specifically in the PLAI's language of the Programming Languages: Application and Interpretation Book, and there is a function called test, i was wondering how to test the error throwing in racket? Does…
forellana
  • 937
  • 1
  • 8
  • 19
10
votes
2 answers

How to Merge 2 lists into one in racket

I have 2 dynamic lists that I would like to merge into one. Say '(1 2 3 4) and '(15 16) and get '(1 2 3 4 15 16) How can this be done?
user2175783
  • 1,291
  • 1
  • 12
  • 28
10
votes
2 answers

How do I choose what language to use in DrScheme?

I recently downloaded PLT Scheme and DrScheme. When I open DrScheme, I am told to choose a language. However, I'm not familiar with any of my options, and the help guides don't really break it down to help me easily choose which choice. So, first -…
Thomas Owens
  • 114,398
  • 98
  • 311
  • 431
10
votes
4 answers

Could someone explain call/cc in simple words?

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.
Paul Kar.
  • 1,293
  • 2
  • 21
  • 32
10
votes
3 answers

Writing a formal language parser with Lisp

My company is designing a new domain specific scripting language; I have to implement a parser that translates our brand new programming language into a common scripting language so as to be able to enact it. The usual way I do this is by means of…
Aslan986
  • 9,984
  • 11
  • 44
  • 75
10
votes
2 answers

Mysterious Racket error: define: unbound identifier; also, no #%app syntax transformer is bound in: define

This program produces an error: define: unbound identifier; also, no #%app syntax transformer is bound in: define When pasted into the REPL (to be exact, the last line: (displayln (eval-clause clause state))), it works. When run in definition…
KIM Taegyoon
  • 1,917
  • 21
  • 18
10
votes
2 answers

How to implement a try-catch block in scheme?

I'm trying to implement a try-catch block in scheme using (call-cc) method but i'm not sure how it can be used for that. I could not find any example. And found examples contains just error-handling but what i want to do is: if an error occurred,…
Asqan
  • 4,319
  • 11
  • 61
  • 100
10
votes
1 answer

DrRacket autocomplete does not see functions defined in my source code

I am using Racket and DrRacket for a small project (I am trying to learn both and using them to teach a friend of mine some functional programming). I have just discovered the autocomplete function (C-/) and it works fine with library functions, but…
Giorgio
  • 5,023
  • 6
  • 41
  • 71
10
votes
3 answers

How to run Racket in Emacs?

I don't like DrRacket because it does not have convenient edit capabilities as Emacs, however I can only run Scheme file through adding command "racket current-file.scm" in .emacs, now, I want to run the Scheme file in Emacs described as "Run :…
abelard2008
  • 1,984
  • 1
  • 20
  • 35
10
votes
5 answers

Improving performance of Racket Code and error when trying to byte compile

I hacked together several code snippets from various sources and created a crude implementation of a Wolfram Blog article at http://bit.ly/HWdUqK - for those that are mathematically inclined, it is very interesting! Not surprisingly, given that I'm…
lifebalance
  • 1,846
  • 3
  • 25
  • 57
9
votes
3 answers

How to run the Metacircular Evaluator in DrRacket

I'm trying to run the program described in SICP 4.1 (http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-26.html) but have run into some difficulty in redefining the function apply as the book suggests that you do. The code is the following: …
Joshua Aresty
  • 517
  • 4
  • 12
9
votes
1 answer

Racket REPL over TCP

I've built a rather complex application with Racket (formerly PLT Scheme) and would like to add a REPL for debugging purposes. I've tried to make it accessible over a TCP stream: (define repl-server (thread (lambda () (let ((listener…
user434817
9
votes
4 answers

How to check if a list contains only #t

I was trying with the following code in racket and MIT scheme, surprise me that the compiler throw err (foldr and #t '(#t #t #f)) Is there any way to use reduce/fold way to check if a list contains only true or false? I know a lambda can do the…
user734736
  • 91
  • 1
  • 2