/usr/share/doc/racket/teachpack/2htdpitunes.html is in racket-doc 6.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>2.5 iTunes: "itunes.rkt"</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span style="font-style: italic">How to Design Programs</span> Teachpacks</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="htdp.html" class="tocviewlink" data-pltdoc="x">Ht<span class="mywbr"> </span>DP Teachpacks</a></td></tr><tr><td align="right">2 </td><td><a href="2htdp2htdp.html" class="tocviewselflink" data-pltdoc="x">Ht<span class="mywbr"> </span>DP/<span class="mywbr"> </span>2e Teachpacks</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">▼</a></td><td>2 </td><td><a href="2htdp2htdp.html" class="tocviewlink" data-pltdoc="x">Ht<span class="mywbr"> </span>DP/<span class="mywbr"> </span>2e Teachpacks</a></td></tr></table><div class="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">2.1 </td><td><a href="2htdpbatch-io.html" class="tocviewlink" data-pltdoc="x">Batch Input/<span class="mywbr"> </span>Output:<span class="mywbr"> </span> <span class="stt">"batch-<wbr></wbr>io.rkt"</span><a name="(idx._(gentag._20._(lib._teachpack/teachpack..scrbl)._2htdp))"></a></a></td></tr><tr><td align="right">2.2 </td><td><a href="2htdpimage-guide.html" class="tocviewlink" data-pltdoc="x">Image Guide</a></td></tr><tr><td align="right">2.3 </td><td><a href="2htdpimage.html" class="tocviewlink" data-pltdoc="x">Images:<span class="mywbr"> </span> <span class="stt">"image.rkt"</span><a name="(idx._(gentag._21._(lib._teachpack/teachpack..scrbl)._2htdp))"></a></a></td></tr><tr><td align="right">2.4 </td><td><a href="2htdpuniverse.html" class="tocviewlink" data-pltdoc="x">Worlds and the Universe:<span class="mywbr"> </span> <span class="stt">"universe.rkt"</span><a name="(idx._(gentag._22._(lib._teachpack/teachpack..scrbl)._2htdp))"></a></a></td></tr><tr><td align="right">2.5 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">i<span class="mywbr"> </span>Tunes:<span class="mywbr"> </span> <span class="stt">"itunes.rkt"</span><a name="(idx._(gentag._23._(lib._teachpack/teachpack..scrbl)._2htdp))"></a></a></td></tr><tr><td align="right">2.6 </td><td><a href="2htdpabstraction.html" class="tocviewlink" data-pltdoc="x">Abstraction:<span class="mywbr"> </span> <span class="stt">"abstraction.rkt"</span><a name="(idx._(gentag._24._(lib._teachpack/teachpack..scrbl)._2htdp))"></a></a></td></tr><tr><td align="right">2.7 </td><td><a href="2htdpPlanet_Cute_Images.html" class="tocviewlink" data-pltdoc="x">Planet Cute Images</a></td></tr><tr><td align="right">2.8 </td><td><a href="2htdphtdp-port.html" class="tocviewlink" data-pltdoc="x">Porting World Programs to Universe</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_2");">►</a></td><td>2.5 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">i<span class="mywbr"> </span>Tunes:<span class="mywbr"> </span> <span class="stt">"itunes.rkt"</span><a name="(idx._(gentag._23._(lib._teachpack/teachpack..scrbl)._2htdp))"></a></a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">2.5.1 </td><td><a href="#%28part._itunes-data._.Data_.Definitions%29" class="tocviewlink" data-pltdoc="x">Data Definitions</a></td></tr><tr><td align="right">2.5.2 </td><td><a href="#%28part._itunes-api._.Exported_.Funcions%29" class="tocviewlink" data-pltdoc="x">Exported Funcions</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">2.5.1<tt> </tt></span><a href="#%28part._itunes-data._.Data_.Definitions%29" class="tocsubseclink" data-pltdoc="x">Data Definitions</a></td></tr><tr><td><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">track</span></a></td></tr><tr><td><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">date</span></a></td></tr><tr><td><span class="tocsublinknumber">2.5.2<tt> </tt></span><a href="#%28part._itunes-api._.Exported_.Funcions%29" class="tocsubseclink" data-pltdoc="x">Exported Funcions</a></td></tr><tr><td><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._read-itunes-as-lists%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">read-<wbr></wbr>itunes-<wbr></wbr>as-<wbr></wbr>lists</span></span></a></td></tr><tr><td><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._read-itunes-as-tracks%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">read-<wbr></wbr>itunes-<wbr></wbr>as-<wbr></wbr>tracks</span></span></a></td></tr><tr><td><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._create-track%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">create-<wbr></wbr>track</span></span></a></td></tr><tr><td><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._create-date%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">create-<wbr></wbr>date</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="2htdpuniverse.html" title="backward to "2.4 Worlds and the Universe: "universe.rkt""" data-pltdoc="x">← prev</a> <a href="2htdp2htdp.html" title="up to "2 HtDP/2e Teachpacks"" data-pltdoc="x">up</a> <a href="2htdpabstraction.html" title="forward to "2.6 Abstraction: "abstraction.rkt""" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "teachpack/teachpack.scrbl")" x-source-pkg="htdp-doc" x-part-tag=""itunes"">2.5<tt> </tt><a name="(part._itunes)"></a><a name="(mod-path._2htdp/itunes)"></a>iTunes: <span class="stt">"itunes.rkt"</span><a name="(idx._(gentag._23._(lib._teachpack/teachpack..scrbl)._2htdp))"></a></h4><div class="SAuthorListBox"><span class="SAuthorList"><p class="author">Matthias Felleisen</p></span></div><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528form._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._require%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">2htdp/itunes</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">htdp-lib</span></span></td></tr></table></p><p>The <span class="stt">itunes.rkt</span> teachpack implements and provides the functionality
for reading the collection of tracks exported from iTunes.</p><p>In iTunes, select <span class="stt">Library</span> from the <span class="stt">File</span> menu and then choose
<span class="stt">Export Library</span>. Doing so exports a description of your iTunes
collection as a file in XML format.</p><h5 x-source-module="(lib "teachpack/teachpack.scrbl")" x-source-pkg="htdp-doc" x-part-prefixes="("itunes-data")" x-part-tag=""Data_Definitions"">2.5.1<tt> </tt><a name="(part._itunes-data._.Data_.Definitions)"></a>Data Definitions</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><table cellspacing="0" cellpadding="0" class="RForeground"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span></td><td><span class="hspace"> </span></td><td><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._track-played))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._track-play~23))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._track-added))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._track-track~23))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._track-time))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._track-album))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._track-artist))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._track-name))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._make-track))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._track~3f))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._struct~3atrack))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._track))"></a><span title="Provided from: 2htdp/itunes | Package: htdp-lib"><span class="RktSym"><span class="RktSymDef RktSym">track</span></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">name</span><span class="stt"> </span><span class="RktSym">artist</span><span class="stt"> </span><span class="RktSym">album</span><span class="stt"> </span><span class="RktSym">time</span><span class="stt"> </span><span class="RktSym">track#</span><span class="stt"> </span><span class="RktSym">added</span><span class="stt"> </span><span class="RktSym">play#</span><span class="stt"> </span><span class="RktSym">played</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:extra-constructor-name</span><span class="hspace"> </span><span class="RktSym">make-track</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">artist</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">album</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">time</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">track#</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">added</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date~3f%29%29" class="RktValLink" data-pltdoc="x">date?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">play#</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">played</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date~3f%29%29" class="RktValLink" data-pltdoc="x">date?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">is
one representations for the music tracks in an iTunes collection.</div></p><p>An instance records that the track has title <span class="RktSym">name</span>, is produced by
<span class="RktSym">artist</span>, belongs to <span class="RktSym">album</span>, plays for <span class="RktSym">time</span>
milliseconds, is positioned at <span class="RktSym">track#</span>, was added at date
<span class="RktSym">added</span>, has been played <span class="RktSym">play#</span> times, and was last played
at <span class="RktSym">played</span> date.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><table cellspacing="0" cellpadding="0" class="RForeground"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span></td><td><span class="hspace"> </span></td><td><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._date-second))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._date-minute))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._date-hour))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._date-day))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._date-month))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._date-year))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._make-date))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._date~3f))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._struct~3adate))"></a><a name="(def._itunes-data._((lib._teachpack/2htdp/itunes..rkt)._date))"></a><span title="Provided from: 2htdp/itunes | Package: htdp-lib"><span class="RktSym"><span class="RktSymDef RktSym">date</span></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">year</span><span class="stt"> </span><span class="RktSym">month</span><span class="stt"> </span><span class="RktSym">day</span><span class="stt"> </span><span class="RktSym">hour</span><span class="stt"> </span><span class="RktSym">minute</span><span class="stt"> </span><span class="RktSym">second</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:extra-constructor-name</span><span class="hspace"> </span><span class="RktSym">make-date</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">year</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">month</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">day</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">hour</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">minute</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">second</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr></table></blockquote></div><div class="SIntrapara">is
a representations of dates in an iTunes collection.</div></p><p>An instance records six pieces of information: the date’s <span class="RktSym">year</span>,
<span class="RktSym">month</span> (between <span class="RktVal">1</span> and <span class="RktVal">12</span> inclusive),
<span class="RktSym">day</span> (between <span class="RktVal">1</span> and <span class="RktVal">31</span>), <span class="RktSym">hour</span> (between
<span class="RktVal">0</span> and <span class="RktVal">23</span>), <span class="RktSym">minute</span> (between <span class="RktVal">0</span> and
<span class="RktVal">59</span>), and <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._second%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">second</a></span> (between <span class="RktVal">0</span> and <span class="RktVal">59</span>).</p><p><div class="SIntrapara">In this context, we introduce the following data definitions:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><a name="(tech._itunes-data._track)"></a><span style="font-style: italic">Track</span><span class="RktCmt"> is a </span><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track~3f%29%29" class="RktValLink" data-pltdoc="x">track?</a></span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><a name="(tech._itunes-data._date)"></a><span style="font-style: italic">Date</span><span class="RktCmt"> is </span><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date~3f%29%29" class="RktValLink" data-pltdoc="x">date?</a></span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><a name="(tech._itunes-data._ltrack)"></a><span style="font-style: italic">LTracks</span><span class="RktCmt"> is one of:</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">–</span><span class="RktCmt"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">–</span><span class="RktCmt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._cons%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons</a></span><span class="stt"> </span><a href="#%28tech._itunes-data._track%29" class="techoutside" data-pltdoc="x"><span class="techinside">Track</span></a><span class="stt"> </span><a href="#%28tech._itunes-data._ltrack%29" class="techoutside" data-pltdoc="x"><span class="techinside">LTracks</span></a><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><a name="(tech._itunes-data._llist)"></a><span style="font-style: italic">LLists</span><span class="RktCmt"> is one of:</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">–</span><span class="RktCmt"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">–</span><span class="RktCmt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._cons%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons</a></span><span class="stt"> </span><a href="#%28tech._itunes-data._lassoc%29" class="techoutside" data-pltdoc="x"><span class="techinside">LAssoc</span></a><span class="stt"> </span><a href="#%28tech._itunes-data._llist%29" class="techoutside" data-pltdoc="x"><span class="techinside">LLists</span></a><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><a name="(tech._itunes-data._lassoc)"></a><span style="font-style: italic">LAssoc</span><span class="RktCmt"> is one of: </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">–</span><span class="RktCmt"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">–</span><span class="RktCmt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._cons%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons</a></span><span class="stt"> </span><a href="#%28tech._itunes-data._association%29" class="techoutside" data-pltdoc="x"><span class="techinside">Association</span></a><span class="stt"> </span><a href="#%28tech._itunes-data._lassoc%29" class="techoutside" data-pltdoc="x"><span class="techinside">LAssoc</span></a><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><a name="(tech._itunes-data._association)"></a><span style="font-style: italic">Association</span><span class="RktCmt"> is </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._cons%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons</a></span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._cons%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons</a></span><span class="stt"> </span><a href="#%28tech._itunes-data._bsdn%29" class="techoutside" data-pltdoc="x"><span class="techinside">BSDN</span></a><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><a name="(tech._itunes-data._bsdn)"></a><span style="font-style: italic">BSDN</span><span class="RktCmt"> satisfies either </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="RktCmt">, </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._integer%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">integer?</a></span><span class="RktCmt">, </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._real%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">real?</a></span><span class="RktCmt">, </span><a href="#%28tech._itunes-data._date%29" class="techoutside" data-pltdoc="x"><span class="techinside">Date</span></a><span class="RktCmt">, or </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._boolean%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="RktCmt">.</span></td></tr></table></blockquote></div></p><h5 x-source-module="(lib "teachpack/teachpack.scrbl")" x-source-pkg="htdp-doc" x-part-prefixes="("itunes-api")" x-part-tag=""Exported_Funcions"">2.5.2<tt> </tt><a name="(part._itunes-api._.Exported_.Funcions)"></a>Exported Funcions</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._itunes-api._((lib._teachpack/2htdp/itunes..rkt)._read-itunes-as-lists))"></a><span title="Provided from: 2htdp/itunes | Package: htdp-lib"><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._read-itunes-as-lists%29%29" class="RktValDef RktValLink" data-pltdoc="x">read-itunes-as-lists</a></span></span><span class="hspace"> </span><span class="RktVar">file-name</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><a href="#%28tech._itunes-data._llist%29" class="techoutside" data-pltdoc="x"><span class="techinside">LLists</span></a></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">file-name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">creates a list-of-lists representation for all tracks in
<span class="RktVar">file-name</span>, an XML export from an iTunes library.</div></p><p><span style="font-weight: bold">Effect</span> reads an XML document from <span class="RktVar">file-name</span></p><p><div class="SIntrapara">Example:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._read-itunes-as-lists%29%29" class="RktValLink" data-pltdoc="x">read-itunes-as-lists</a></span><span class="hspace"> </span><span class="RktVal">"Library.xml"</span><span class="RktPn">)</span></p></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._itunes-api._((lib._teachpack/2htdp/itunes..rkt)._read-itunes-as-tracks))"></a><span title="Provided from: 2htdp/itunes | Package: htdp-lib"><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._read-itunes-as-tracks%29%29" class="RktValDef RktValLink" data-pltdoc="x">read-itunes-as-tracks</a></span></span><span class="hspace"> </span><span class="RktVar">file-name</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><a href="#%28tech._itunes-data._ltrack%29" class="techoutside" data-pltdoc="x"><span class="techinside">LTracks</span></a></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">file-name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">creates a list-of-tracks representation for all tracks in
<span class="RktVar">file-name</span>, an XML export from an iTunes library.</div></p><p><span style="font-weight: bold">Effect</span> reads an XML document from <span class="RktVar">file-name</span></p><p><div class="SIntrapara">Example:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._read-itunes-as-tracks%29%29" class="RktValLink" data-pltdoc="x">read-itunes-as-tracks</a></span><span class="hspace"> </span><span class="RktVal">"Library.xml"</span><span class="RktPn">)</span></p></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._itunes-api._((lib._teachpack/2htdp/itunes..rkt)._create-track))"></a><span title="Provided from: 2htdp/itunes | Package: htdp-lib"><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._create-track%29%29" class="RktValDef RktValLink" data-pltdoc="x">create-track</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">name</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">artist</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">album</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">time</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">track#</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">added</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">play#</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">played</span><span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">(</span><span class="RktSym">or/c</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track~3f%29%29" class="RktValLink" data-pltdoc="x">track?</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._false%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">false?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">artist</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">album</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">time</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">track#</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">added</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date~3f%29%29" class="RktValLink" data-pltdoc="x">date?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">play#</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">played</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date~3f%29%29" class="RktValLink" data-pltdoc="x">date?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">creates a track representation if the inputs live up to their
predicates. Otherwise it produces <span class="RktVal">#false</span>.</div></p><p><span style="font-weight: bold">Note</span> This is a <span style="font-style: italic">checked</span> constructor.</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._create-track%29%29" class="RktValLink" data-pltdoc="x">create-track</a></span><span class="hspace"> </span><span class="RktVal">"one"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">"two"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">"three"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">4</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">5</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._create-date%29%29" class="RktValLink" data-pltdoc="x">create-date</a></span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">3</span><span class="hspace"> </span><span class="RktVal">4</span><span class="hspace"> </span><span class="RktVal">5</span><span class="hspace"> </span><span class="RktVal">6</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">7</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._create-date%29%29" class="RktValLink" data-pltdoc="x">create-date</a></span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">3</span><span class="hspace"> </span><span class="RktVal">4</span><span class="hspace"> </span><span class="RktVal">5</span><span class="hspace"> </span><span class="RktVal">6</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">(track "one" "two" "three" 4 5 (date 1 2 3 4 5 6) 7 (date 1 2 3 4 5 6))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._create-track%29%29" class="RktValLink" data-pltdoc="x">create-track</a></span><span class="hspace"> </span><span class="RktVal">"one"</span><span class="hspace"> </span><span class="RktVal">"two"</span><span class="hspace"> </span><span class="RktVal">"three"</span><span class="hspace"> </span><span class="RktVal">4</span><span class="hspace"> </span><span class="RktVal">5</span><span class="hspace"> </span><span class="RktVal">"a date"</span><span class="hspace"> </span><span class="RktVal">7</span><span class="hspace"> </span><span class="RktVal">"another date"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr></table></blockquote><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._itunes-api._((lib._teachpack/2htdp/itunes..rkt)._create-date))"></a><span title="Provided from: 2htdp/itunes | Package: htdp-lib"><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._create-date%29%29" class="RktValDef RktValLink" data-pltdoc="x">create-date</a></span></span><span class="hspace"> </span><span class="RktVar">year</span><span class="hspace"> </span><span class="RktVar">month</span><span class="hspace"> </span><span class="RktVar">day</span><span class="hspace"> </span><span class="RktVar">hour</span><span class="hspace"> </span><span class="RktVar">minute</span><span class="hspace"> </span><span class="RktVar">second</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">or/c</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date~3f%29%29" class="RktValLink" data-pltdoc="x">date?</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528def._htdp-beginner._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._false%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">false?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">year</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">month</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">day</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">hour</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">minute</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">second</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">natural-number/c</span></td></tr></table></blockquote></div><div class="SIntrapara">creates a date representation if the inputs live up to their
predicates. Otherwise it produces <span class="RktVal">#false</span>.</div></p><p><span style="font-weight: bold">Note</span> This is a <span style="font-style: italic">checked</span> constructor.</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._create-date%29%29" class="RktValLink" data-pltdoc="x">create-date</a></span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">3</span><span class="hspace"> </span><span class="RktVal">4</span><span class="hspace"> </span><span class="RktVal">5</span><span class="hspace"> </span><span class="RktVal">6</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(date 1 2 3 4 5 6)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._itunes-api._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._create-date%29%29" class="RktValLink" data-pltdoc="x">create-date</a></span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">2</span><span class="hspace"> </span><span class="RktVal">3</span><span class="hspace"> </span><span class="RktVal">"four"</span><span class="hspace"> </span><span class="RktVal">5</span><span class="hspace"> </span><span class="RktVal">6</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr></table></blockquote><p><div class="SIntrapara">In addition to the above, the teachpack exports the predicates for
<a href="#%28tech._itunes-data._track%29" class="techoutside" data-pltdoc="x"><span class="techinside">Track</span></a> and <a href="#%28tech._itunes-data._date%29" class="techoutside" data-pltdoc="x"><span class="techinside">Date</span></a> plus all selectors:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track~3f%29%29" class="RktValLink" data-pltdoc="x">track?</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track-name%29%29" class="RktValLink" data-pltdoc="x">track-name</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track-artist%29%29" class="RktValLink" data-pltdoc="x">track-artist</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track-album%29%29" class="RktValLink" data-pltdoc="x">track-album</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track-time%29%29" class="RktValLink" data-pltdoc="x">track-time</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track-track~23%29%29" class="RktValLink" data-pltdoc="x">track-track#</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track-added%29%29" class="RktValLink" data-pltdoc="x">track-added</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track-play~23%29%29" class="RktValLink" data-pltdoc="x">track-play#</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._track-played%29%29" class="RktValLink" data-pltdoc="x">track-played</a></span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date~3f%29%29" class="RktValLink" data-pltdoc="x">date?</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date-year%29%29" class="RktValLink" data-pltdoc="x">date-year</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date-month%29%29" class="RktValLink" data-pltdoc="x">date-month</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date-day%29%29" class="RktValLink" data-pltdoc="x">date-day</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date-hour%29%29" class="RktValLink" data-pltdoc="x">date-hour</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date-minute%29%29" class="RktValLink" data-pltdoc="x">date-minute</a></span></td></tr><tr><td><span class="RktSym"><a href="#%28def._itunes-data._%28%28lib._teachpack%2F2htdp%2Fitunes..rkt%29._date-second%29%29" class="RktValLink" data-pltdoc="x">date-second</a></span></td></tr></table></blockquote></div></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="2htdpuniverse.html" title="backward to "2.4 Worlds and the Universe: "universe.rkt""" data-pltdoc="x">← prev</a> <a href="2htdp2htdp.html" title="up to "2 HtDP/2e Teachpacks"" data-pltdoc="x">up</a> <a href="2htdpabstraction.html" title="forward to "2.6 Abstraction: "abstraction.rkt""" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|