<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16809" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Courier New" size=2>define-struct does not define a struct, it
defines a struct-type and a number of related procedures, such as a constructor
(make-...), a predicate ...? and accessors and mutators.</FONT></DIV>
<DIV><FONT face="Courier New" size=2>make-struct-... is a procedure that returns
an instantiation of the struct-type.</FONT></DIV>
<DIV><FONT face="Courier New" size=2>I think `define-struct-type' would be a
better name, but reality is different.</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Personally I prefer make-struct-type, but
that is not in the teaching languages, I think.</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Jos</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=adityashukla1983@gmail.com
href="mailto:adityashukla1983@gmail.com">aditya shukla</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=plt-scheme@list.cs.brown.edu
href="mailto:plt-scheme@list.cs.brown.edu">PLT Scheme ML</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, February 18, 2009 2:43
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [plt-scheme] Defining
structures</DIV>
<DIV><BR></DIV>I have a doubt the concept of defining structures.In htdp
chapter 6 its given as<BR><BR>A
<SMALL>S</SMALL><SMALL>T</SMALL><SMALL>R</SMALL><SMALL>U</SMALL><SMALL>C</SMALL><SMALL>T</SMALL><SMALL>U</SMALL><SMALL>R</SMALL><SMALL>E</SMALL>
<SMALL>D</SMALL><SMALL>E</SMALL><SMALL>F</SMALL><SMALL>I</SMALL><SMALL>N</SMALL><SMALL>I</SMALL><SMALL>T</SMALL><SMALL>I</SMALL><SMALL>O</SMALL><SMALL>N</SMALL>
<A name=node_idx_432></A>is, as the term says, a new form of definition. Here
is DrScheme's definition of <CODE class=scheme><SPAN class=variable>posn: i
have modified the example here<BR><BR></SPAN></CODE><PRE class=scheme>(<SPAN class=keyword>define-struct</SPAN> <SPAN class=variable>entry</SPAN> (<SPAN class=variable>name</SPAN> <SPAN class=variable>zip</SPAN> <SPAN class=variable>phone</SPAN>))<BR>
<BR>Now a few lines later it says <BR><BR><BR>If we give the structure a name,<BR><BR>(<SPAN class=keyword>define</SPAN> <SPAN class=variable>phonebook</SPAN> (<SPAN class=builtin>make-entry</SPAN> <SPAN class=keyword>'</SPAN><SPAN class=variable>PeterLee</SPAN> <SPAN class=selfeval>15270</SPAN> <SPAN class=keyword>'</SPAN><SPAN class=variable>606-7771</SPAN>))<BR>
</PRE>Now my question here is phonebook the name of the structure
or it is a structure of type entry?<BR><BR><BR>Aditya<BR>
<P>
<HR>
<P></P>_________________________________________________<BR> For
list-related administrative tasks:<BR>
http://list.cs.brown.edu/mailman/listinfo/plt-scheme<BR></BLOCKQUOTE></BODY></HTML>