/usr/share/doc/racket/pkg/name.html is in racket-doc 6.1-4.
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 | <!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>6.4 Package Source Parsing</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="../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="../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">Package Management in Racket</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="getting-started.html" class="tocviewlink" data-pltdoc="x">Getting Started with Packages</a></td></tr><tr><td align="right">2 </td><td><a href="Package_Concepts.html" class="tocviewlink" data-pltdoc="x">Package Concepts</a></td></tr><tr><td align="right">3 </td><td><a href="cmdline.html" class="tocviewlink" data-pltdoc="x">Using <span class="stt">raco pkg</span></a></td></tr><tr><td align="right">4 </td><td><a href="metadata.html" class="tocviewlink" data-pltdoc="x">Package Metadata</a></td></tr><tr><td align="right">5 </td><td><a href="strip.html" class="tocviewlink" data-pltdoc="x">Source, Binary, and Built Packages</a></td></tr><tr><td align="right">6 </td><td><a href="apis.html" class="tocviewselflink" data-pltdoc="x">Package APIs</a></td></tr><tr><td align="right">7 </td><td><a href="catalog-protocol.html" class="tocviewlink" data-pltdoc="x">Package Catalog Protocol</a></td></tr><tr><td align="right">8 </td><td><a href="PLaneT_Compatibility.html" class="tocviewlink" data-pltdoc="x"><span class="planetName">PLane<span class="mywbr"> </span>T</span> Compatibility</a></td></tr><tr><td align="right">9 </td><td><a href="FAQ.html" class="tocviewlink" data-pltdoc="x">FAQ</a></td></tr><tr><td align="right">10 </td><td><a href="Future_Plans.html" class="tocviewlink" data-pltdoc="x">Future Plans</a></td></tr><tr><td align="right">11 </td><td><a href="implementation.html" class="tocviewlink" data-pltdoc="x">How Package Installation and Distribution Works</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>6 </td><td><a href="apis.html" class="tocviewlink" data-pltdoc="x">Package APIs</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">6.1 </td><td><a href="Functions_for_raco_pkg.html" class="tocviewlink" data-pltdoc="x">Functions for <span class="stt">raco pkg</span></a></td></tr><tr><td align="right">6.2 </td><td><a href="lib.html" class="tocviewlink" data-pltdoc="x">Package Management Functions</a></td></tr><tr><td align="right">6.3 </td><td><a href="path.html" class="tocviewlink" data-pltdoc="x">Package Paths and Database</a></td></tr><tr><td align="right">6.4 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Package Source Parsing</a></td></tr><tr><td align="right">6.5 </td><td><a href="db.html" class="tocviewlink" data-pltdoc="x">Package Catalog Database</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-format~3f%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">package-<wbr></wbr>source-<wbr></wbr>format?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-~3ename%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">package-<wbr></wbr>source-<wbr></wbr>>name</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-~3ename%2Btype%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">package-<wbr></wbr>source-<wbr></wbr>>name+<span class="mywbr"> </span>type</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-~3epath%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">package-<wbr></wbr>source-<wbr></wbr>>path</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.1</span></div><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.1", "../");" 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.1");">top</a></span><span class="navright"> <a href="path.html" title="backward to "6.3 Package Paths and Database"" data-pltdoc="x">← prev</a> <a href="apis.html" title="up to "6 Package APIs"" data-pltdoc="x">up</a> <a href="db.html" title="forward to "6.5 Package Catalog Database"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "pkg/scribblings/pkg.scrbl")" x-part-tag=""name"">6.4<tt> </tt><a name="(part._name)"></a><a name="(mod-path._pkg/name)"></a>Package Source Parsing</h4><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">pkg/name</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">base</span></span></td></tr></table></div><div class="SIntrapara">The <a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">pkg/name</span></a> library provides
functions for parsing and normalizing a package source, especially for
extracting a package name.</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._((lib._pkg/name..rkt)._package-source-format~3f))"></a><span title="Provided from: pkg/name | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-format~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">package-source-format?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is <span class="RktVal">'</span><span class="RktVal">name</span> , <span class="RktVal">'</span><span class="RktVal">file</span>,
<span class="RktVal">'</span><span class="RktVal">dir</span>, <span class="RktVal">'</span><span class="RktVal">github</span>, <span class="RktVal">'</span><span class="RktVal">file-url</span>,
<span class="RktVal">'</span><span class="RktVal">dir-url</span>, <span class="RktVal">'</span><span class="RktVal">link</span>, or <span class="RktVal">'</span><span class="RktVal">static-link</span>, and
returns <span class="RktVal">#f</span> otherwise.</div></p><p>The <span class="RktVal">'</span><span class="RktVal">link</span> and <span class="RktVal">'</span><span class="RktVal">static-link</span> formats are the same as
<span class="RktVal">'</span><span class="RktVal">dir</span> in terms of parsing, but they are treated differently
for tasks such as package installation.</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._((lib._pkg/name..rkt)._package-source-~3ename))"></a><span title="Provided from: pkg/name | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-~3ename%29%29" class="RktValDef RktValLink" data-pltdoc="x">package-source->name</a></span></span><span class="hspace"> </span><span class="RktVar">source</span><span class="hspace"> </span>[<span class="RktVar">type</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">source</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">type</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-format~3f%29%29" class="RktValLink" data-pltdoc="x">package-source-format?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the <a href="Package_Concepts.html#%28tech._package._name%29" class="techoutside" data-pltdoc="x"><span class="techinside">package name</span></a> from a <a href="Package_Concepts.html#%28tech._package._source%29" class="techoutside" data-pltdoc="x"><span class="techinside">package source</span></a>, where
the package source type is inferred if <span class="RktVar">type</span> is <span class="RktVal">#f</span>.
If a valid name cannot be inferred, the result is <span class="RktVal">#f</span>.</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 colspan="3"><span class="RktPn">(</span><a name="(def._((lib._pkg/name..rkt)._package-source-~3ename+type))"></a><span title="Provided from: pkg/name | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-~3ename%2Btype%29%29" class="RktValDef RktValLink" data-pltdoc="x">package-source->name+type</a></span></span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">source</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">type</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:complain</span><span class="hspace"> </span><span class="RktVar">complain-proc</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:must-infer-name?</span><span class="hspace"> </span><span class="RktVar">must-infer-name?</span>]</td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:link-dirs?</span><span class="hspace"> </span><span class="RktVar">link-dir?</span><span class="RktPn">)</span></td><td><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><table cellspacing="0" cellpadding="0"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-format~3f%29%29" class="RktValLink" data-pltdoc="x">package-source-format?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">source</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">type</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-format~3f%29%29" class="RktValLink" data-pltdoc="x">package-source-format?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">complain-proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">void</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">must-infer-name?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">link-dir?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-~3ename%29%29" class="RktValLink" data-pltdoc="x">package-source->name</a></span>, but also returns the type of the
source (which is useful when the type is inferred). If the source is
not well-formed, the second result can be <span class="RktVal">#f</span>.</div></p><p>The <span class="RktVar">complain-proc</span> function is applied when <span class="RktVar">source</span> is
ill-formed. The arguments to <span class="RktVar">complain-proc</span> are
<span class="RktVar">source</span> and an error message.</p><p>If <span class="RktVar">must-infer-name?</span> is true, then <span class="RktVar">complain-proc</span>
is called if a valid name cannot be inferred from <span class="RktVar">source</span>.</p><p>If <span class="RktSym">link-dirs?</span> is true, then a directory path is reported as
type <span class="RktVal">'</span><span class="RktVal">link</span> instead of <span class="RktVal">'</span><span class="RktVal">dir</span>.</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._((lib._pkg/name..rkt)._package-source-~3epath))"></a><span title="Provided from: pkg/name | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-~3epath%29%29" class="RktValDef RktValLink" data-pltdoc="x">package-source->path</a></span></span><span class="hspace"> </span><span class="RktVar">source</span><span class="hspace"> </span>[<span class="RktVar">type</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Manipulating_Paths.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._path%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">path?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">source</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">type</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">file</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dir</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">link</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">static-link</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts a file or directory package source to a filesystem path.</div></p><p>The <span class="RktSym"><a href="#%28def._%28%28lib._pkg%2Fname..rkt%29._package-source-~3epath%29%29" class="RktValLink" data-pltdoc="x">package-source->path</a></span> function is different from
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Manipulating_Paths.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string-%7E3epath%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string->path</a></span> in the case that <span class="RktVar">source</span> starts with
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">file://</span><span class="hspace"></span></span>. Also, if <span class="RktVar">type</span> is <span class="RktVal">'</span><span class="RktVal">dir</span>,
<span class="RktVal">'</span><span class="RktVal">link</span>, or <span class="RktVal">'</span><span class="RktVal">static-link</span>, then
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Manipulating_Paths.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._path-%7E3edirectory-path%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">path->directory-path</a></span> is used to ensure that the result path
refers to a directory.</p><p class="SHistory">Added in version 10.0.1.11 of package <span class="stt">base</span>.</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.1", "../");" 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.1");">top</a></span><span class="navright"> <a href="path.html" title="backward to "6.3 Package Paths and Database"" data-pltdoc="x">← prev</a> <a href="apis.html" title="up to "6 Package APIs"" data-pltdoc="x">up</a> <a href="db.html" title="forward to "6.5 Package Catalog Database"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|