CINXE.COM

class Slip | Raku Documentation

<!DOCTYPE html> <html lang="en" class="fontawesome-i2svg-active fontawesome-i2svg-complete" style="scroll-padding-top:60px"> <head> <title>class Slip | Raku Documentation</title> <meta charset="UTF-8" /> <link href="/assets/images/Camelia.ico" rel="icon" type="image/x-icon"/> <link rel="stylesheet" href="/assets/css/Website.css"/> <link rel="stylesheet" href="/assets/css/typegraph-styling.css"/> <link rel="stylesheet" href="/assets/css/typegraph-dark.css" title="dark"/> <link rel="stylesheet" href="/assets/css/typegraph-light.css" title="light"/> <link rel="stylesheet" href="/assets/css/css/filtered-toc-dark.css" title="dark"/> <link rel="stylesheet" href="/assets/css/css/filtered-toc-light.css" title="light"/> <link rel="stylesheet" href="/assets/css/css/announce-light.css" title="light"/> <link rel="stylesheet" href="/assets/css/css/announce-dark.css" title="dark"/> <link rel="stylesheet" href="/assets/css/all.min.css"/> <link rel="stylesheet" href="/assets/css/listf-styling-light.css" title="light"/> <link rel="stylesheet" href="/assets/css/listf-styling-dark.css" title="dark"/> <link rel="stylesheet" href="/assets/css/css/options-search-light.css" title="light"/> <link rel="stylesheet" href="/assets/css/css/options-search-dark.css" title="dark"/> <link rel="stylesheet" href="/assets/css/css/page-styling-main.css"/> <link rel="stylesheet" href="/assets/css/css/page-styling-dark.css" title="dark"/> <link rel="stylesheet" href="/assets/css/css/page-styling-light.css" title="light"/> <link rel="stylesheet" href="/assets/css/css/chyronToggle-dark.css" title="dark"/> <link rel="stylesheet" href="/assets/css/css/chyronToggle-light.css" title="light"/> <link rel="stylesheet" href="/assets/css/css/centreToggle-dark.css" title="dark"/> <link rel="stylesheet" href="/assets/css/css/centreToggle-light.css" title="light"/> <link rel="stylesheet" href="/assets/css/tm-styling.css"/> <link rel="stylesheet" href="/assets/css/tm-light.css" title="light"/> <link rel="stylesheet" href="/assets/css/tm-dark.css" title="dark"/> <link rel="stylesheet" href="/assets/css/css/rainbow-dark.css" title="dark"/> <link rel="stylesheet" href="/assets/css/css/rainbow-light.css" title="light"/> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.7/dist/css/autoComplete.min.css" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-light.min.css" title="light" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css" title="dark" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script src="/assets/scripts/all.min.js"></script><script src="/assets/scripts/filter-script.js"></script><script src="/assets/scripts/tableManager.js"></script><script src="https://cdn.jsdelivr.net/npm/fuzzysort@2.0.4/fuzzysort.min.js"></script><script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.7/dist/autoComplete.min.js"></script><script src="/assets/scripts/filtered-toc.js"></script><script src="/assets/scripts/options-search.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/haskell.min.js"></script><script src="/assets/scripts/page-styling.js"></script><script src="/assets/scripts/announcements.js"></script><script src="/assets/scripts/rainbow.js"></script> </head> <body class="has-navbar-fixed-top"> <div id="class_Slip" class="top-of-page"></div> <nav class="navbar is-fixed-top is-flex-touch" role="navigation" aria-label="main navigation"> <div class="navbar-item" style="margin-left: auto;"> <div class="left-bar-toggle" title="Toggle Table of Contents & Index"> <label class="chyronToggle left"> <input id="navbar-left-toggle" type="checkbox"> <span class="text">Contents</span> </label> </div> </div> <div class="container is-justify-content-space-around"> <div class="navbar-brand"> <div class="navbar-logo"> <a class="navbar-item" href="/"> <img src="/assets/images/camelia-recoloured.png" alt="Raku" width="52.83" height="38"> </a> <span class="navbar-logo-tm">tm</span> </div> <a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navMenu"> <span aria-hidden="true"></span> <span aria-hidden="true"></span> <span aria-hidden="true"></span> </a> </div> <div id="navMenu" class="navbar-menu"> <div class="navbar-start"> <a class="navbar-item" href="/introduction" title="Getting started, Tutorials, Migration guides"> Introduction </a> <a class="navbar-item" href="/reference" title="Fundamentals, General reference"> Reference </a> <a class="navbar-item" href="/miscellaneous" title="Programs, Experimental"> Miscellaneous </a> <a class="navbar-item" href="/types" title="The core types (classes) available"> Types </a> <a class="navbar-item" href="/routines" title="Searchable table of routines"> Routines </a> <a class="navbar-item" href="https://raku.org" title="Home page for community"> Raku<sup>®</sup> </a> <a class="navbar-item" href="https://web.libera.chat/#raku" title="IRC live chat"> Chat </a> <div class="navbar-item has-dropdown is-hoverable"> <a class="navbar-link"> More </a> <div class="navbar-dropdown is-right is-rounded"> <hr class="navbar-divider"> <a class="navbar-item js-modal-trigger" data-target="download-ebook"> Download E-Book (epub) </a> <hr class="navbar-divider"> <a class="navbar-item" href="/about"> About </a> <hr class="navbar-divider"> <a class="navbar-item has-text-red" href="https://github.com/raku/doc-website/issues"> Report an issue with this site </a> <hr class="navbar-divider"> <a class="navbar-item" href="https://github.com/raku/doc/issues"> Report an issue with the documentation content </a> <hr class="navbar-divider"> <label class="navbar-item centreToggle" title="Enable/Disable Announcements" style="--switch-width: 18"> <input id="cancelAnnouncements" type="checkbox"> <span class="text">Announcements</span> <span class="on">suppressed</span> <span class="off">allowed</span> </label> </div> </div> </div> <div class="navbar-end navbar-search-wrapper"> <div class="navbar-item"> <div class="field has-addons"> <div class="autoComplete_options"> <input class="control input" id="autoComplete" type="search" dir="ltr" spellcheck=false autocorrect="off" autocomplete="off" autocapitalize="off" placeholder="🔍 Type f to search for ..."> </div> <div class="control" title="Search options"> <a class="button is-primary js-modal-trigger" data-target="options-search-info"> <span class="icon"> <i class="fas fa-cogs"></i> </span> </a> </div> </div> </div> </div> <div id="options-search-info" class="modal"> <div class="modal-background"></div> <div class="modal-content"> <div class="box"> <p>The last search was: <span id="selected-candidate" class="ss-selected"></span></p> <div class="control is-grouped is-grouped-centered options-search-controls"> <label class="centreToggle" title="Include extra information (Alt-E)" style="--switch-width: 10.5"> <input id="options-search-extra" type="checkbox"> <span class="text">Extra info</span> <span class="on">yes</span> <span class="off">no</span> </label> <p>The search response can be shortened by excluding the extra information line (Alt-E)</p> <label class="centreToggle" title="Search engine type Strict/Loose (Alt-L)" style="--switch-width: 10.5"> <input id="options-search-loose" type="checkbox"> <span class="text">Search type</span> <span class="on">loose</span> <span class="off">strict</span> </label> <p> The search engine can perform a strict search (only the characters in the search box) or a loose search (Alt-L)</p> <label class="centreToggle" title="Search in headings (Alt-H)" style="--switch-width: 10.5"> <input id="options-search-headings" type="checkbox"> <span class="text">Headings</span> <span class="on">yes</span> <span class="off">no</span> </label> <p>Search through headings in all web-pages (Alt-H)</p> <label class="centreToggle" title="Search indexed items (Alt-I)" style="--switch-width: 10.5"> <input id="options-search-indexed" type="checkbox"> <span class="text">Indexed</span> <span class="on">yes</span> <span class="off">no</span> </label> <p>Search through all indexed items (Alt-I)</p> <label class="centreToggle" title="Search composite pages (Alt-C)" style="--switch-width: 10.5"> <input id="options-search-composite" type="checkbox"> <span class="text">Composite</span> <span class="on">yes</span> <span class="off">no</span> </label> <p>Search in the names of composite pages, which combine similar information from the main web pages (Alt-C)</p> <label class="centreToggle" title="Search primary sources (Alt-P)" style="--switch-width: 10.5"> <input id="options-search-primary" type="checkbox"> <span class="text">Primary</span> <span class="on">yes</span> <span class="off">no</span> </label> <p>Search through the names of the main web pages (Alt-P)</p> <label class="centreToggle" title="Open in new tab (Alt-Q)" style="--switch-width: 10.5"> <input id="options-search-newtab" type="checkbox"> <span class="text">New tab</span> <span class="on">yes</span> <span class="off">no</span> </label> <p>Once a search candidate has been chosen, it can be opened in a new tab or in the current tab (Alt-Q)</p> <p>If all else fails, an item is added to use the Google search engine on the whole site</p> <button class="button is-warning" id="options-search-reset-defaults">Clear options, reset to defaults</button> <p>Exit this page by pressing &lt;Escape&gt;, or clicking on X or on the background.</p> </div> </div> </div> <button class="modal-close is-large" aria-label="close"></button> </div> </div> <div id="download-ebook" class="modal"> <div class="modal-background"></div> <div class="modal-content"> <div class="box"> <p><a href="/RakuDocumentation.epub" download>RakuDocumentation.epub</a> is a work in progress e-book. It targets the <a href="https://www.w3.org/publishing/epub3/">EPUB v3 specification</a>. It needs testing on a variety of ereaders (some of which may still implicitly expect compliance with EPUB v2). The CSS definitely needs enhancing (especially for code snippets). The Ebook opens in a Calibre reader, which is available on all operating systems.</p> <p>Suggestions are welcome and should be addressed by opening an issue on the Raku/doc-website repository</p> <p>Exit this popup by pressing &lt;Escape&gt;, or clicking on X or on the background.</p> </div> </div> <button class="modal-close is-large" aria-label="close"></button> </div> <div id="announcement-modal" class="modal"> <div class="modal-background"></div> <div class="modal-content"> <div class="box"> <div id="raku-doc-announcement"></div> <p>For more see <a href="/announcements">Announcements page</a>.</p> <p>Exit this popup by pressing &lt;Escape&gt;, or clicking on X or on the background.</p> </div> </div> <button class="modal-close is-large" aria-label="close"></button> </div> </div> </nav> <div class="tile is-ancestor section"> <div class="page-edit"> <a class="button page-edit-button" href="https://github.com/Raku/doc/edit/main/doc/Type/Slip.rakudoc" title="Edit this page.&#13;Commit: 99c751d5d 2024-05-28"> <span class="icon is-right"> <i class="fas fa-pen-alt is-medium"></i> </span> </a> </div> <div id="left-column" class="tile is-parent is-2 is-hidden"> <div id="left-col-inner"> <div class="tabs" id="tabs"> <ul> <li class="is-active" id="toc-tab"> <a>Table of Contents</a> </li> <li id="index-tab"> <a>Index</a> </li> </ul> </div> <div class="field"> <div class="control has-icons-right"> <input id="toc-filter" class="input" type="text" placeholder="Filter"> <span class="icon is-right has-text-grey"> <i class="fas fa-search is-medium"></i> </span> </div> </div> <div class="raku-sidebar"> <aside id="toc-menu" class="menu"> <ul class="menu-list"> <li><a href="#Methods">Methods</a></li> <ul> <li><a href="#method_List">method List</a></li> <li><a href="#sub_slip">sub slip</a></li> </ul> <li><a href="#Constants">Constants</a></li> <ul> <li><a href="#constant_Empty">constant Empty</a></li> </ul> </aside> <aside id="index-menu" class="menu is-hidden"> </aside> </div> </div> </div> <div id="main-column" class="tile is-parent" style="overflow-x: hidden;"> <div id="main-col-inner"> <section class="raku page-header"> <div class="container px-4"> <div class="raku page-title has-text-centered"> class Slip </div> <div class="raku page-subtitle has-text-centered"> <p>A kind of List that automatically flattens into an outer container</p> </div> </div> </section> <section class="raku page-content"><div class="container px-4"><div class="columns one-col"> <div class="raku-code raku-lang"> <button class="copy-code" title="Copy code"><i class="far fa-clipboard"></i></button> <label>Raku highlighting</label> <div> <pre class="nohighlights"><span class="highlite-KEYWORD">class</span> <span class="highlite-TYPE">Slip</span> <span class="highlite-KEYWORD">is</span> <span class="highlite-TYPE">List</span> {}</pre> </div> </div> <p>A <code>Slip</code> is a <a href="/type/List"><code>List</code></a> that automatically flattens into an outer List (or other list-like container or iterable).</p><p>For example it allows you to write a <a href="/routine/map">map</a> that produces more than one value into the result without nesting:</p> <div class="raku-code raku-lang"> <button class="copy-code" title="Copy code"><i class="far fa-clipboard"></i></button> <label>Raku highlighting</label> <div> <pre class="nohighlights"><span class="highlite-ROUTINE">say</span> &lt;a b c&gt;.<span class="highlite-ROUTINE">map</span>({ (<span class="highlite-NAME_SCALAR">$_</span><span class="highlite-OPERATOR">,</span> <span class="highlite-NAME_SCALAR">$_</span>.<span class="highlite-ROUTINE">uc</span>).<span class="highlite-TYPE">Slip</span> }).<span class="highlite-ROUTINE">join</span>(<span class="highlite-STRING_DELIMITER">'</span><span class="highlite-STRING">|</span><span class="highlite-STRING_DELIMITER">'</span>); <span class="highlite-COMMENT"># OUTPUT: «a|A|b|B|c|C␤» </span></pre> </div> </div> <p>In contrast, when returning an ordinary List, the resulting list is nested:</p> <div class="raku-code raku-lang"> <button class="copy-code" title="Copy code"><i class="far fa-clipboard"></i></button> <label>Raku highlighting</label> <div> <pre class="nohighlights"><span class="highlite-ROUTINE">say</span> &lt;a b c&gt;.<span class="highlite-ROUTINE">map</span>({ <span class="highlite-NAME_SCALAR">$_</span><span class="highlite-OPERATOR">,</span> <span class="highlite-NAME_SCALAR">$_</span>.<span class="highlite-ROUTINE">uc</span> }).<span class="highlite-ROUTINE">join</span>(<span class="highlite-STRING_DELIMITER">'</span><span class="highlite-STRING">|</span><span class="highlite-STRING_DELIMITER">'</span>); <span class="highlite-COMMENT"># OUTPUT: «a A|b B|c C␤» </span></pre> </div> </div> <p>To create a <code>Slip</code>, either coerce another list-like type to it by calling the <code>Slip</code> method, or use the <code>slip</code> subroutine:</p> <div class="raku-code raku-lang"> <button class="copy-code" title="Copy code"><i class="far fa-clipboard"></i></button> <label>Raku highlighting</label> <div> <pre class="nohighlights"><span class="highlite-COMMENT"># This says &quot;1&quot; and then says &quot;2&quot;, rather than saying &quot;(1 2)&quot; </span>.<span class="highlite-ROUTINE">say</span> <span class="highlite-KEYWORD">for</span> <span class="highlite-KEYWORD">gather</span> { <span class="highlite-ROUTINE">take</span> <span class="highlite-ROUTINE">slip</span>(1<span class="highlite-OPERATOR">,</span> 2); }</pre> </div> </div> <p>A <code>Slip</code> may also be created by using the <a href="/language/operators#prefix_|"><code>prefix:&lt;|&gt;</code></a> operator. This differs from the <code>slip</code> subroutine in both precedence and treatment of single arguments. In fact, <code>prefix:&lt;|&gt;</code> only takes a single argument, so in that way, it behaves closer to the <code>.Slip</code> method than the <code>slip</code> subroutine.</p> <div class="raku-code raku-lang"> <button class="copy-code" title="Copy code"><i class="far fa-clipboard"></i></button> <label>Raku highlighting</label> <div> <pre class="nohighlights"><span class="highlite-KEYWORD">my</span> <span class="highlite-NAME_SCALAR">$l</span> <span class="highlite-OPERATOR">=</span> (1<span class="highlite-OPERATOR">,</span> 2<span class="highlite-OPERATOR">,</span> 3); <span class="highlite-ROUTINE">say</span> (1<span class="highlite-OPERATOR">,</span> <span class="highlite-ROUTINE">slip</span> 2<span class="highlite-OPERATOR">,</span> 3).<span class="highlite-ROUTINE">raku</span>; <span class="highlite-COMMENT"># says (1, 2, 3) , slips 2, 3 into (1, …) </span><span class="highlite-ROUTINE">say</span> (0<span class="highlite-OPERATOR">,</span> <span class="highlite-ROUTINE">slip</span> <span class="highlite-NAME_SCALAR">$l</span><span class="highlite-OPERATOR">,</span> 4).<span class="highlite-ROUTINE">raku</span>; <span class="highlite-COMMENT"># says (0, $(1, 2, 3), 4) , $l does not break apart </span><span class="highlite-ROUTINE">say</span> (0<span class="highlite-OPERATOR">,</span> <span class="highlite-ROUTINE">slip</span> <span class="highlite-NAME_SCALAR">$l</span>).<span class="highlite-ROUTINE">raku</span>; <span class="highlite-COMMENT"># says (0, 1, 2, 3) , slips from $l into (0, …) </span><span class="highlite-ROUTINE">say</span> (0<span class="highlite-OPERATOR">,</span> <span class="highlite-NAME_SCALAR">$l</span>.<span class="highlite-TYPE">Slip</span>).<span class="highlite-ROUTINE">raku</span>; <span class="highlite-COMMENT"># says (0, 1, 2, 3) , slips from $l into (0, …) </span><span class="highlite-ROUTINE">say</span> (0<span class="highlite-OPERATOR">,</span> <span class="highlite-NAME_SCALAR">$l</span>.<span class="highlite-TYPE">Slip</span><span class="highlite-OPERATOR">,</span> 4).<span class="highlite-ROUTINE">raku</span>; <span class="highlite-COMMENT"># says (0, 1, 2, 3, 4) , slips from $l into (0, …, 4) </span><span class="highlite-ROUTINE">say</span> (<span class="highlite-OPERATOR">|</span><span class="highlite-NAME_SCALAR">$l</span>).<span class="highlite-ROUTINE">raku</span>; <span class="highlite-COMMENT"># says slip(1, 2, 3) , breaks apart $l </span><span class="highlite-ROUTINE">say</span> (0<span class="highlite-OPERATOR">,</span> (<span class="highlite-OPERATOR">|</span><span class="highlite-NAME_SCALAR">$l</span><span class="highlite-OPERATOR">,</span> 4)<span class="highlite-OPERATOR">,</span> 5); <span class="highlite-COMMENT"># says (0 (1 2 3 4) 5) , slips from $l into (…, 4) </span><span class="highlite-ROUTINE">say</span> (0<span class="highlite-OPERATOR">,</span> (<span class="highlite-NAME_SCALAR">$l</span>.<span class="highlite-TYPE">Slip</span><span class="highlite-OPERATOR">,</span> 4)<span class="highlite-OPERATOR">,</span> 5); <span class="highlite-COMMENT"># says (0 (1 2 3 4) 5) , slips from $l into (…, 4) </span><span class="highlite-ROUTINE">say</span> (0<span class="highlite-OPERATOR">,</span> (<span class="highlite-ROUTINE">slip</span> <span class="highlite-NAME_SCALAR">$l</span><span class="highlite-OPERATOR">,</span> 4)<span class="highlite-OPERATOR">,</span> 5); <span class="highlite-COMMENT"># says (0 (1 2 3) 4 5) , slips ($l, 4) into (0, …, 5) </span><span class="highlite-ROUTINE">say</span> (0<span class="highlite-OPERATOR">,</span> (<span class="highlite-NAME_SCALAR">$l</span><span class="highlite-OPERATOR">,</span> 4).<span class="highlite-TYPE">Slip</span><span class="highlite-OPERATOR">,</span> 5); <span class="highlite-COMMENT"># says (0 (1 2 3) 4 5) , slips ($l, 4) into (0, …, 5) </span></pre> </div> </div> <p>Loops that do not want to produce a value for an iteration use <code>Slip</code>s, rather than empty <a href="/type/List"><code>List</code></a>s to do so, as do <code>if</code> statements that do not run their blocks.</p><p>Please note that <code>prefix:&lt;|&gt;</code> will also apply parameters in a slippy manner to a routine call. It does not forward a <code>Slip</code> to the called routine, that includes <code>return</code> and <code>take</code>.</p> <div class="raku-code raku-lang"> <button class="copy-code" title="Copy code"><i class="far fa-clipboard"></i></button> <label>Raku highlighting</label> <div> <pre class="nohighlights"><span class="highlite-KEYWORD">my</span> \<span class="highlite-ROUTINE">l</span> <span class="highlite-OPERATOR">=</span> <span class="highlite-KEYWORD">gather</span> <span class="highlite-KEYWORD">for</span> 1..10 <span class="highlite-KEYWORD">-&gt;</span> <span class="highlite-NAME_SCALAR">$a</span><span class="highlite-OPERATOR">,</span> <span class="highlite-NAME_SCALAR">$b</span> { <span class="highlite-ROUTINE">take</span> <span class="highlite-OPERATOR">|</span>(<span class="highlite-NAME_SCALAR">$a</span><span class="highlite-OPERATOR">,</span> <span class="highlite-NAME_SCALAR">$b</span>) }; <span class="highlite-ROUTINE">say</span> <span class="highlite-ROUTINE">l</span>.<span class="highlite-ROUTINE">raku</span>; <span class="highlite-COMMENT"># OUTPUT: «((1, 2), (3, 4), (5, 6), (7, 8), (9, 10)).Seq␤» </span><span class="highlite-KEYWORD">my</span> \<span class="highlite-REGEX_DELIMITER">m=</span><span class="highlite-REGEX_SPECIAL"> </span><span class="highlite-REGEX_LITERAL">gather</span><span class="highlite-REGEX_SPECIAL"> </span><span class="highlite-REGEX_LITERAL">for</span><span class="highlite-REGEX_SPECIAL"> </span><span class="highlite-REGEX_LITERAL">1</span><span class="highlite-REGEX_SPECIAL">..</span><span class="highlite-REGEX_LITERAL">10</span><span class="highlite-REGEX_SPECIAL"> -&gt; </span><span class="highlite-NAME_SCALAR">$a</span><span class="highlite-REGEX_SPECIAL">, </span><span class="highlite-NAME_SCALAR">$b</span><span class="highlite-REGEX_SPECIAL"> {</span> <span class="highlite-ROUTINE">take</span> (<span class="highlite-NAME_SCALAR">$a</span><span class="highlite-OPERATOR">,</span> <span class="highlite-NAME_SCALAR">$b</span>).<span class="highlite-TYPE">Slip</span> <span class="highlite-REGEX_SPECIAL">}; </span><span class="highlite-REGEX_LITERAL">say</span><span class="highlite-REGEX_SPECIAL"> </span><span class="highlite-REGEX_LITERAL">m</span><span class="highlite-REGEX_SPECIAL">.</span><span class="highlite-REGEX_LITERAL">raku</span><span class="highlite-REGEX_SPECIAL">; </span><span class="highlite-COMMENT"># OUTPUT: «(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).Seq␤»</span><span class="highlite-REGEX_DELIMITER"></span></pre> </div> </div> <h1 id="Methods" class="raku-h1"><a href="#class_Slip" title="go to top of document">Methods<a class="raku-anchor" title="direct link" href="#Methods">§</a></a></h1> <h2 id="method_List" class="raku-h2"><a href="#class_Slip" title="go to top of document">method List<a class="raku-anchor" title="direct link" href="#method_List">§</a></a></h2> <!-- defnmark method_List 2 --> <div class="raku-code raku-lang"> <button class="copy-code" title="Copy code"><i class="far fa-clipboard"></i></button> <label>Raku highlighting</label> <div> <pre class="nohighlights"><span class="highlite-KEYWORD">multi</span> <span class="highlite-KEYWORD">method</span> <span class="highlite-TYPE">List</span>(Slip:D: <span class="highlite-KEYWORD">--&gt;</span> List:D)</pre> </div> </div> <p>Turns it into a list.</p> <h2 id="sub_slip" class="raku-h2"><a href="#class_Slip" title="go to top of document">sub slip<a class="raku-anchor" title="direct link" href="#sub_slip">§</a></a></h2> <!-- defnmark sub_slip 2 --> <div class="raku-code raku-lang"> <button class="copy-code" title="Copy code"><i class="far fa-clipboard"></i></button> <label>Raku highlighting</label> <div> <pre class="nohighlights"><span class="highlite-KEYWORD">multi</span> <span class="highlite-ROUTINE">slip</span>(<span class="highlite-KEYWORD">--&gt;</span> <span class="highlite-TYPE">Empty</span>) <span class="highlite-KEYWORD">multi</span> <span class="highlite-ROUTINE">slip</span>(<span class="highlite-NAME_ARRAY">@args</span> <span class="highlite-KEYWORD">--&gt;</span> Slip:D) <span class="highlite-KEYWORD">multi</span> <span class="highlite-ROUTINE">slip</span>(+<span class="highlite-ROUTINE">args</span> <span class="highlite-KEYWORD">--&gt;</span> Slip:D)</pre> </div> </div> <p>Creates a <code>Slip</code> from its arguments by calling <a href="/routine/Slip"><code>.Slip</code></a> on the object formed by them. Returns <a href="/type/Slip#constant_Empty"><code>Empty</code></a> if called with void arguments.</p> <h1 id="Constants" class="raku-h1"><a href="#class_Slip" title="go to top of document">Constants<a class="raku-anchor" title="direct link" href="#Constants">§</a></a></h1> <h2 id="constant_Empty" class="raku-h2"><a href="#class_Slip" title="go to top of document">constant Empty<a class="raku-anchor" title="direct link" href="#constant_Empty">§</a></a></h2> <!-- defnmark constant_Empty 2 --> <p><code>Empty</code> is a <code>Slip</code> of the empty <a href="/type/List"><code>List</code></a>.</p> <div class="raku-code raku-lang"> <button class="copy-code" title="Copy code"><i class="far fa-clipboard"></i></button> <label>Raku highlighting</label> <div> <pre class="nohighlights"><span class="highlite-ROUTINE">say</span> <span class="highlite-STRING_DELIMITER">&quot;</span><span class="highlite-STRING_DELIMITER">&quot;</span>.<span class="highlite-ROUTINE">comb</span> <span class="highlite-OPERATOR">~~</span> <span class="highlite-TYPE">Empty</span>; <span class="highlite-COMMENT"># OUTPUT: «True␤»</span></pre> </div> </div> <p>For example, these constructs with a failing test return <code>Empty</code>:</p> <div class="raku-code raku-lang"> <button class="copy-code" title="Copy code"><i class="far fa-clipboard"></i></button> <label>Raku highlighting</label> <div> <pre class="nohighlights"><span class="highlite-ROUTINE">do</span> <span class="highlite-KEYWORD">if</span> 0 {}; (42 <span class="highlite-KEYWORD">if</span> 0); <span class="highlite-ROUTINE">do</span> <span class="highlite-KEYWORD">with</span> <span class="highlite-TYPE">Any</span> {}; (42 <span class="highlite-KEYWORD">with</span> <span class="highlite-TYPE">Any</span>);</pre> </div> </div> <h1 id="typegraphrelations" class="raku-h1"><a href="#" title="go to top of document">Typegraph<a class="raku-anchor" title="direct link" href="#typegraphrelations">§</a></a></h1> <figure class="typegraph" > <figcaption>Type relations for <code>Slip</code></figcaption> <svg width="303pt" height="332pt" viewBox="0.00 0.00 303.04 332.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 328)"> <title>raku&#45;type&#45;graph</title> <polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-328 299.04,-328 299.04,4 -4,4"/> <!-- Slip --> <g id="node1" class="node"> <title>Slip</title> <g id="a_node1"><a xlink:href="/type/Slip" xlink:title="Slip"> <ellipse fill="none" stroke="#000000" cx="132.55" cy="-18" rx="27.1" ry="18"/> <text text-anchor="middle" x="132.55" y="-14.3" font-family="FreeSans" font-size="14.00" fill="#000000">Slip</text> </a> </g> </g> <!-- List --> <g id="node7" class="node"> <title>List</title> <g id="a_node7"><a xlink:href="/type/List" xlink:title="List"> <ellipse fill="none" stroke="#000000" cx="132.55" cy="-90" rx="27" ry="18"/> <text text-anchor="middle" x="132.55" y="-86.3" font-family="FreeSans" font-size="14.00" fill="#000000">List</text> </a> </g> </g> <!-- Slip&#45;&gt;List --> <g id="edge1" class="edge"> <title>Slip&#45;&gt;List</title> <path fill="none" stroke="#000000" d="M132.55,-36.3C132.55,-44.02 132.55,-53.29 132.55,-61.89"/> <polygon fill="#000000" stroke="#000000" points="129.05,-61.9 132.55,-71.9 136.05,-61.9 129.05,-61.9"/> </g> <!-- Mu --> <g id="node2" class="node"> <title>Mu</title> <g id="a_node2"><a xlink:href="/type/Mu" xlink:title="Mu"> <ellipse fill="none" stroke="#000000" cx="30.55" cy="-306" rx="27" ry="18"/> <text text-anchor="middle" x="30.55" y="-302.3" font-family="FreeSans" font-size="14.00" fill="#000000">Mu</text> </a> </g> </g> <!-- Any --> <g id="node3" class="node"> <title>Any</title> <g id="a_node3"><a xlink:href="/type/Any" xlink:title="Any"> <ellipse fill="none" stroke="#000000" cx="30.55" cy="-234" rx="28.7" ry="18"/> <text text-anchor="middle" x="30.55" y="-230.3" font-family="FreeSans" font-size="14.00" fill="#000000">Any</text> </a> </g> </g> <!-- Any&#45;&gt;Mu --> <g id="edge2" class="edge"> <title>Any&#45;&gt;Mu</title> <path fill="none" stroke="#000000" d="M30.55,-252.3C30.55,-260.02 30.55,-269.29 30.55,-277.89"/> <polygon fill="#000000" stroke="#000000" points="27.05,-277.9 30.55,-287.9 34.05,-277.9 27.05,-277.9"/> </g> <!-- Cool --> <g id="node4" class="node"> <title>Cool</title> <g id="a_node4"><a xlink:href="/type/Cool" xlink:title="Cool"> <ellipse fill="none" stroke="#000000" cx="30.55" cy="-162" rx="30.59" ry="18"/> <text text-anchor="middle" x="30.55" y="-158.3" font-family="FreeSans" font-size="14.00" fill="#000000">Cool</text> </a> </g> </g> <!-- Cool&#45;&gt;Any --> <g id="edge3" class="edge"> <title>Cool&#45;&gt;Any</title> <path fill="none" stroke="#000000" d="M30.55,-180.3C30.55,-188.02 30.55,-197.29 30.55,-205.89"/> <polygon fill="#000000" stroke="#000000" points="27.05,-205.9 30.55,-215.9 34.05,-205.9 27.05,-205.9"/> </g> <!-- Positional --> <g id="node5" class="node"> <title>Positional</title> <g id="a_node5"><a xlink:href="/type/Positional" xlink:title="Positional"> <ellipse fill="none" stroke="#6666ff" cx="132.55" cy="-162" rx="53.89" ry="18"/> <text text-anchor="middle" x="132.55" y="-158.3" font-family="FreeSans" font-size="14.00" fill="#6666ff">Positional</text> </a> </g> </g> <!-- Iterable --> <g id="node6" class="node"> <title>Iterable</title> <g id="a_node6"><a xlink:href="/type/Iterable" xlink:title="Iterable"> <ellipse fill="none" stroke="#6666ff" cx="249.55" cy="-162" rx="45.49" ry="18"/> <text text-anchor="middle" x="249.55" y="-158.3" font-family="FreeSans" font-size="14.00" fill="#6666ff">Iterable</text> </a> </g> </g> <!-- List&#45;&gt;Cool --> <g id="edge4" class="edge"> <title>List&#45;&gt;Cool</title> <path fill="none" stroke="#000000" d="M114.31,-103.51C98.65,-114.26 75.85,-129.91 57.98,-142.17"/> <polygon fill="#000000" stroke="#000000" points="55.93,-139.34 49.66,-147.88 59.89,-145.11 55.93,-139.34"/> </g> <!-- List&#45;&gt;Positional --> <g id="edge5" class="edge"> <title>List&#45;&gt;Positional</title> <path fill="none" stroke="#6666ff" d="M132.55,-108.3C132.55,-116.02 132.55,-125.29 132.55,-133.89"/> <polygon fill="#6666ff" stroke="#6666ff" points="129.05,-133.9 132.55,-143.9 136.05,-133.9 129.05,-133.9"/> </g> <!-- List&#45;&gt;Iterable --> <g id="edge6" class="edge"> <title>List&#45;&gt;Iterable</title> <path fill="none" stroke="#6666ff" d="M152.13,-102.72C169.7,-113.23 195.83,-128.86 216.61,-141.29"/> <polygon fill="#6666ff" stroke="#6666ff" points="215.06,-144.45 225.44,-146.58 218.65,-138.44 215.06,-144.45"/> </g> </g> </svg> <p class="fallback"> <a rel="alternate" href="/assets/typegraphs/Slip.svg"> Expand chart above </a></p> </figure> </div></div></section> </div> </div> </div> <footer class="footer main-footer"> <div class="container px-4"> <nav class="level"> <div class="level-left"> <div class="level-item"> <a href="/about">About</a> </div> <div class="level-item"> <a id="toggle-theme">Toggle theme</a> </div> <div class="level-item" title="99c751d5d 2024-05-28"> <a>Commit</a> </div> </div> <div class="level-right"> <div class="level-item"> <a href="/license">License</a> </div> </div> </nav> </div> </footer> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10