Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Scheme 9 From Empty Space

Scheme 9 From Empty Space

Ratings:
(0)
|Views: 211|Likes:
Published by rgomezv
This textbook contains the complete and heavily commented source code to an interpreter for a broad
subset of R5RS Scheme.
This textbook contains the complete and heavily commented source code to an interpreter for a broad
subset of R5RS Scheme.

More info:

Published by: rgomezv on Jan 16, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/22/2011

pdf

text

original

 
Nils M Holm
Scheme 9
from Empty Space
 
Scheme9fromEmptySpace
Copyright (C)2007 Nils M HolmAll rights reservedPrint and distribution:Lulu Press,IncOrder:http://www.lulu.com/nmh/ 
 
Preface
This textbook containsthe complete and heavily commented source code to an interpreter for a broadsubset of R5RSScheme.It covers many essential propertiesof the language,including:-- automatic memory management-- lexical closures-- tail recursion (tail call elimination)-- syntax transformation (macros)-- arbitrary precision (bignum)arithmeticsThe book isnot exactlyfor beginners,because the better part of it consistsof code.Although the codeis very straight-forward,some familiaritywith both C and Scheme is required to follow it.The code appears in the same order as in the actual source file, so some forward references occur.Expect to read the code at least twice unless you jump to forward references while reading it. If youintend todoso:the indexcontainsthepage number of each function,procedure,constant,and variabledeclared anywhere in the program.Becausethetext containsthe
whole
codeof theinterpreter,therewillbeadvanced partsand easyparts.Feel free to skip parts that you consider trivial. Parts that are complex can often be identified by thelarger amount of annotationsand figures that surround them.You might even want to download a copy of the source code from the
Scheme9fromEmptySpace
section at
http://t3x.org
and study the actual code and the book at the same time.The text uses different fonts for different types of code.In annotations,
Ccode
prints in a typewriterfont,
Scheme code
in boldface typewriter font,and
abstractvariables
use a boldface font.Listingsof SchemeandCcodearebothrenderedina lighttypewriterfont.Furthermorethefollowingnotationsare used:
form1 ===> form2
denotes the transformation of 
form1
to
form2
type1 --> type2
denotes a procedure that maps
type1
to
type2
(p t1 ...) --> type
denotes a procedure
p
of types
t1
...-->
type
f => v
denotes the evaluation of a form
to a value
v
(‘
evaluatesto
v
’)Annotations (which are renderd with the same font as this text) always precede the code that theydescribe--mostlyCfunctionsor Schemeprocedures.Therearealsosomeinlineannotationswhichareordinary C or Scheme comments.Feel free to use, modify and redistribute the Scheme 9 from Empty Space code, as long as you keepintact all copyright notices in the code and documentation.When distributing modified copies,pleasemark them as such.Nils M Holm,July 2007

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->