user1493059
user1493059

Reputation: 23

for loop in racket doesn't seem to work for me

I'm absolutely new to Racket. I'm trying to write simple for loop, but DrRacket keeps throwing error "for: this function is not defined".

(for ([i '(1 2 3)])
    (display i))

Even this simple code (taken from Racket documentation) doesn't work for me. Do I need to declare some libraries or...? I've read the documentation and I have not found any mention about it.

Any help would be much appreciated.

(I'm using the Advanced Student language)

Upvotes: 2

Views: 2379

Answers (1)

uselpa
uselpa

Reputation: 18917

use the racket language:

#lang racket
(for ([i '(1 2 3)]) (display i))

Welcome to DrRacket, version 5.2.1 [3m].
Language: racket [custom]; memory limit: 128 MB.
123
> 

Upvotes: 6

Related Questions