Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Teach Yourself Scheme: 2.3 Other Data Types

created by washort

(idea) by washort (6.8 y) (print)   ?   (I like it!) Mon Apr 17 2000 at 22:23:37

Prev Up Next Scheme contains some other data types. One is the procedure. We have already seen many procedures, eg, display, +, cons. In reality, these are variables holding the procedure values, which are themselves not visible as are numbers or characters:

cons
=> <procedure>

The procedures we have seen thus far are primitive procedures, with standard global variables holding them. Users can create additional procedure values.

Yet another data type is the port. A port is the conduit through which input and output is performed. Ports are usually associated with files and consoles.

In our ``Hello, World!'' program, we used the procedure display to write a string to the console. display can take two arguments, one the value to be displayed, and the other the output port it should be displayed on.

In our program, display's second argument was implicit. The default output port used is the standard output port. We can get the current standard output port via the procedure-call (current-output-port). We could have been more explicit and written

(display "Hello, World!" (current-output-port))

Prev Up Next


printable version
chaos

Teach Yourself Scheme: 2.4 S-Expressions Teach Yourself Scheme Teach Yourself Scheme: 2.2 Compound Data Types data jack
Learn to Program: Types and Objects How to Win Friends and Influence People Programming Techniques for Creative Thinking
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
Drink up!
Yellow Mountain
glassblowing
Reflections, unacknowledged
angel hair
Hearse black hair
transsexual
You'll never work in dis bidness again
F-14 Tomcat
Invader ZIM
Middle English
The Grey Album
Everything: In the Beginning
Guitar Hero
New Writeups
Heitah
Anarchy is Order(idea)
jessicaj
July 26, 2008(dream)
Berek
ABBA(person)
devolution
k-hole(place)
Nadine_2
The Sound Of Madness(review)
Twin Eclipse
Conversations with God: An Uncommon Dialogue(idea)
SwimmingMonkey
Conversations with Fo Fo- the Loneliest dog in Purgatory(fiction)
locke baron
lynx(thing)
Simulacron3
Reality, Dimensions and the Natural Ontology(essay)
SubSane
Making Love to a 9-Foot Woman(person)
Ouzo
Thoughts(idea)
antigravpussy
I fall silent, listening. The breadcrumbs are talking about us(person)
calgon
Buffalo Bill by the pool(poetry)
gate
Anarchy is Order(idea)
ushdfgakjasgh
Scribeling(thing)
E2 is a by-product of the existence of The Everything Development Company