getchar

Synopsis

(getchar)

Parameters

Description

This procedure returns the next character from the console-input-port. If there’s no character available, (getchar) doesn´t block but immediately returns #f instead. This is a non-standard procedure.

Side Effects

Return Value

A character or #f.

Example

$ ./scheme
Inlab Scheme 5.1.44
macOS 12.6.3 Darwin 21.6.0 x86_64 2023-04-20 18:27:12
> (getchar)
#f
> (define (x)
   (define c (getchar))
   (if c (print c))
   (x))
x
> (x)
#\h
#\i
#\space