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
15
votes
1 answer

What are the similarities and differences between the typing features in Typed Racket and the type-like features in Clojure?

Clojure has some interesting features for representing types including but not limited to deftype, defprotocol, reify and extend. What are the similarities and differences between the typing features in Typed Racket and the type-like features in…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
15
votes
2 answers

How can I clear the interpreter screen in Dr. Racket IDE?

Just starting into The Little Schemer, and have a very basic Dr. Racket IDE question: How can I clear the interpreter screen? How can I set the up arrow to display the previously-typed items (like in Bash) rather than the current behavior of…
i_made_that
  • 941
  • 1
  • 8
  • 19
15
votes
3 answers

Racket: execute file and stay in interactive mode

Is there a way from a command line to run Racket file and stay in the interactive mode afterwards? E.g. same in Python it would be: python -i
Michal
  • 611
  • 5
  • 11
15
votes
1 answer

What is "3D syntax"?

In the context of writing Racket macros, what does "3D syntax" mean? I've heard the phrase a few times. Including once in reference to a macro I was writing. But that was awhile ago; I fixed it, and now I can't remember exactly what I was doing…
Greg Hendershott
  • 16,100
  • 6
  • 36
  • 53
15
votes
1 answer

Differences between Guile Scheme and Standard Scheme (in Racket IDE)?

I've got a bunch of "legacy" Guile Scheme code that I want to get running in the Racket Scheme IDE. There appear to be enough differences to make this a non-trivial exercise. (My level of Scheme knowledge is the level to complete the The Little…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
14
votes
3 answers

I need help installing PLT Racket, I moved the Racket folder into Applications but I don't know how to use the raco command in the terminal

To explain, I have OSX and I wanted to install PLT Racket. I don't know how to use the raco command to run .rkt files in the terminal instead of using the Dr. Racket interpreter. I don't really like the DrRacket text editor. Where do I put the bin,…
TheVerv
  • 141
  • 1
  • 3
14
votes
2 answers

How do I pass a list as a list of arguments in racket?

I have a statement like this: ((lambda (a b c) (+ a b c)) 1 2 3) ; Gives 6 And I would like to be able to also pass it a list as so: ((lambda (a b c) (+ a b c)) (list 1 2 3)) ...except this doesn't work because the entire list is passed as 'a.'…
peskal
  • 1,213
  • 1
  • 12
  • 28
14
votes
3 answers

Running SICP Pattern Matching Rule Based Substitution Code

I have found the code from this lesson online (http://groups.csail.mit.edu/mac/ftpdir/6.001-fall91/ps4/matcher-from-lecture.scm), and I am having a heck of a time trying to debug it. The code looks pretty comparable to what Sussman has written: ;;;…
Benjamin Powers
  • 3,186
  • 2
  • 18
  • 23
14
votes
2 answers

How to (re)load files in Racket (X)REPL?

Suppose I have a file like #lang racket/base (define (hello) (print "Hello")) ... more definitions ... and I would like to load the definitions in the file to interactively work with them in the (X)REPL. How do I do that? If I start the (X)REPL and…
Confusion
  • 16,256
  • 8
  • 46
  • 71
14
votes
1 answer

How does Typed Racket's type inference work?

What kind of type inference does Typed Racket do? I found the following snippet on the Racket mailing list: The Typed Racket type system contains a number of features that go beyond what's supported in Hindley/Milner style type systems, and so …
Ord
  • 5,693
  • 5
  • 28
  • 42
14
votes
2 answers

Meaning of # in Scheme number literals

DrRacket running R5RS says that 1### is a perfectly valid Scheme number and prints a value of 1000.0. This leads me to believe that the pound signs (#) specify inexactness in a number, but I'm not certain. The spec also says that it is valid syntax…
Abhay Buch
  • 4,548
  • 1
  • 21
  • 26
14
votes
1 answer

How to eval strings in racket

I'm trying to understand how to get the eval function to read a string and evaluate the content that's inside the string. Currently I know that > (eval '(+ 1 2)) 3 but I'm not that knowledgeable with the use of racket. So at the moment I'm…
Razed
  • 181
  • 1
  • 4
14
votes
5 answers

LISP In Small Pieces - best LISP environment to run code in?

Christian Queinnec has written a masterpiece called LISP In Small Pieces, which features eleven Lisp Interpreters and two Lisp compilers. When you go to download the code from the website here - it has the comment: The programs of this book are…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
13
votes
3 answers

Which language in DrScheme for SICP?

I have been using the Module for SICP in DrScheme 4.2 but which language has the best support for SICP in DrScheme? Has anyone here tried this? Thanks.
unj2
  • 52,135
  • 87
  • 247
  • 375
13
votes
4 answers

How to make a GUI using Lisp: DrScheme or Common Lisp

Or the basic work need to do to create a GUI. I know the basic Components of GUI, but where to begin. I'm just a self-study person and I'm reading "How to Design Program" (HtDP) at the end of the book the author suggest that knowledge of GUI and CGI…
user1472
  • 131
  • 1
  • 1
  • 3