The classic first program in any language is, of course the “Hello World” program. Here then, are three different version of “Hello World” written in PLT Scheme.
Console based (from Teach Yourself Scheme in Fixnum Days):
(begin (display "Hello, World!") (newline)
Web based (example program that comes with PLT Scheme servlet library):
(require (lib "unitsig.ss") (lib "servlet-sig.ss" "web-server")) (unit/sig () (import servlet^) (define the-text "Hello, Web!") `(html (head (title ,the-text)) (body ([bgcolor "white"]) (p ,the-text))))
And finally, GUI Based (written by me):
(define greeting "Hello world!") (define frame (instantiate frame% (greeting))) (define msg (instantiate message% (greeting frame))) (send frame show #t)
I still don’t know what the hell I’m doing, but it’s a start right?