s c h e m a t i c s : c o o k b o o k

/ Cookbook.SchemeHelloWorld

This Web


WebHome 
WebChanges 
TOC (with recipes)
NewRecipe 
WebTopicList 
WebStatistics 

Other Webs


Chicken
Cookbook
Erlang
Know
Main
Plugins
Sandbox
Scm
TWiki  

Schematics


Schematics Home
Sourceforge Page
SchemeWiki.org
Original Cookbook
RSS

Scheme Links


Schemers.org
Scheme FAQ
R5RS
SRFIs
Scheme Cross Reference
PLT Scheme SISC
Scheme48 SCM
MIT Scheme scsh
JScheme Kawa
Chicken Guile
Bigloo Tiny
Gambit LispMe
GaucheChez

Lambda the Ultimate
TWiki.org

Hello World!

Problem

You want to write the classic "Hello World!" program in Scheme

Solution

This is very easy in Scheme:

> (begin (display "Hello World!") (newline))
Hello World!

Discussion

Scheme provides an interactive prompt, called the Read-Eval-Print-Loop (REPL), that allows you to type programs directly into Scheme and have them evaluated immediately. This allows for much more immediate feedback than compiled languages.

This is the first program many C programmers write, but it isn't the best way to start programming Scheme. Scheme makes extensive use of the functional style and it is better to become acquainted with this style before delving into input and output.


Comments about this recipe

Most Schemes allow the embedding of newlines using \n like this:

(display "Hello world!\n")

-- JensAxelSoegaard - 20 May 2005

Contributors

-- NoelWelsh - 31 Aug 2004

CookbookForm
TopicType: Recipe
ParentTopic: SchemeRecipes
TopicOrder: 999

 
 
Copyright © 2004 by the contributing authors. All material on the Schematics Cookbook web site is the property of the contributing authors.
The copyright for certain compilations of material taken from this website is held by the SchematicsEditorsGroup - see ContributorAgreement & LGPL.
Other than such compilations, this material can be redistributed and/or modified under the terms of the GNU Lesser General Public License (LGPL), version 2.1, as published by the Free Software Foundation.
Ideas, requests, problems regarding Schematics Cookbook? Send feedback.
/ You are Main.guest