lu4nx
lu4nx

Reputation: 94

How to disable Racket's any s-expression value output

Example, I write a Racket script:

; filename: hello.rkt
#lang racket/base
(displayln "hello")
(+ 1 1)

and execute it:

$ racket hello.rkt

output is:

hello
2

I don't want it to print the number '2', how to disable result of the any S-expression value output?

Upvotes: 0

Views: 236

Answers (1)

Rufflewind
Rufflewind

Reputation: 8956

You could use void to discard values, and begin to group several expressions together. E.g.

(void (begin (+ 1 1) (+ 2 2) (+ 3 3)))

This prints nothing.

Upvotes: 4

Related Questions