Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Teach Yourself Scheme: 7.5 Loading files

created by washort

(idea) by washort (6.8 y) (print)   ?   (I like it!) Tue Apr 18 2000 at 23:11:22

Prev Up Next

We have already seen the procedure load that loads files containing Scheme code. Loading a file consists in evaluating in sequence every Scheme form in the file. The pathname argument given to load is reckoned relative to the current working directory of Scheme, which is normally the directory in which the Scheme executable was called.

Files can load other files, and this is useful in a large program spanning many files. Unfortunately, unless full pathnames are used, the argument file of a load is dependent on Scheme's current directory. Supplying full pathnames is not always convenient, because we would like to move the program files as a unit (preserving their relative pathnames), perhaps to many different machines.

MzScheme provides the load-relative procedure that greatly helps in fixing the files to be loaded. load-relative, like load, takes a pathname argument. When a load-relative call occurs in a file foo.scm, the path of its argument is reckoned from the directory of the calling file foo.scm. In particular, this pathname is reckoned independent of Scheme's current directory, and thus allows convenient multifile program development.

Prev Up Next


printable version
chaos

Teach Yourself Scheme: 8 Macros Teach Yourself Scheme How do you become a geek? Teach Yourself Scheme: 7.4 String ports
transfer
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes your grandpa would have liked:
K-mart jeans and Payless shoes
You are my electronic human being: my second chance, my way to mend the past.
Try not to look into my eyes
Multimedia software essentials 2D IMAGE EDITING
To Kill a Mockingbird
Editor Log: March 2002
Rule of 72
The war party
scone
Maybe it's bad manners, but you still can't buy my baby
War of the Roses
online identities
Monster
New Writeups
Heitah
Why I love Everything2(person)
trixingee
Dungeon Mastering for the first time(idea)
Netrat0
It's Called Subtext, Honey(person)
eyeofthebeholder
The Dragon(idea)
Heitah
consist, comprise, constitute, or compose(idea)
Meezzio
Gotlandssnus(thing)
argv
Astral Plane(idea)
Madara
One Winged Angel(fiction)
Tom Rook
Talk is cheap(poetry)
shaogo
Adelle Davis(person)
Aerobe
race car g sfjsgsd(poetry)
Binah
Dream Log: July 5, 2008(dream)
StrawberryFrog
Forgotten things in space(idea)
antigravpussy
velvet revolution fairy tale(idea)
Heitah
Nerve agent VX(thing)
E2 is a by-product of the existence of The Everything Development Company