Urbit
  • Introduction
  • Development

    • Getting Started
    • Environment Setup
    • Grants Program
    • Project Repositories
    • Precepts
    • System Overview

      • Arvo
      • Hoon
      • Nock
      • Vere
      • Azimuth
      • Cryptography
      • Arvo

        • Overview
        • Reference

          • Cryptography
          • Filesystem Hierarchy
          • Ames

            • Overview
            • Cryptography
            • API Reference
            • Behn

              • Overview
              • API Reference
              • Clay

                • Overview
                • Architecture
                • Using Clay
                • Data Types
                • Scry Reference
                • API Reference
                • Examples
                • Dill

                  • Overview
                  • API Reference
                  • Eyre

                    • Overview
                    • External API Reference
                    • Internal API Reference
                    • Scry Reference
                    • Data Types
                    • Examples
                    • Ford

                      • Overview
                      • Gall

                        • Overview
                        • Iris

                          • API Reference
                          • Jael

                            • API Reference
                            • Concepts

                              • Subscriptions
                              • Tutorials

                                • Move Trace
                              • Userspace

                                • Overview
                                • Gall

                                  • Overview
                                  • Tutorial
                                  • API Reference
                                  • Graph Store

                                    • Graph Store Overview
                                    • Data Structure Overview
                                    • Validator Walkthrough
                                    • Advanced Info
                                    • Threads

                                      • Overview
                                      • HTTP API
                                      • Reference
                                      • Basics

                                        • Fundamentals
                                        • Bind
                                        • Input
                                        • Output
                                        • Summary
                                        • Gall

                                          • Start Thread
                                          • Take Result
                                          • Take Facts
                                          • Stop Thread
                                          • Poke Thread
                                          • Examples

                                            • Fetch JSON
                                            • Child Thread
                                            • Main-loop
                                            • Poke Agent
                                            • Scry
                                            • Take Fact
                                          • Landscape

                                            • Overview
                                            • API Reference

                                              • Graph Store
                                          • Hoon

                                            • Overview
                                            • Hoon School

                                              • 1.1 Setup
                                              • 1.1.1 Walkthrough: List of Numbers
                                              • 1.2 Nouns
                                              • 1.3 Hoon Syntax
                                              • 1.3.1 Walkthrough: Conditionals
                                              • 1.4 Gates (Hoon Functions)
                                              • 1.4.1 Walkthrough: Recursion
                                              • 1.5 Lists
                                              • 1.5.1 Walkthrough: Fibonacci Sequence
                                              • 1.6 The Subject and Its Legs
                                              • 1.6.1 Walkthrough: Ackermann Function
                                              • 1.7 Arms and Cores
                                              • 1.7.1 Walkthrough: Caesar Cipher
                                              • 1.8 Doors
                                              • 1.8.1 Bank Account
                                              • 1.9 Generators
                                              • 2.1 Atoms, Auras, and Simple Cell Types
                                              • 2.2 Type Checking and Type Inference
                                              • 2.3 Structures and Complex Types
                                              • 2.3.1 Walkthrough: Libraries
                                              • 2.3.2 Molds
                                              • 2.4 Standard Library: Trees, Sets, and Maps
                                              • 2.5 Type Polymorphism
                                              • 2.5.1 Walkthrough: Iron Polymorphism and Wet Polymorphism
                                              • 2.5.2 Walkthrough: Lead Polymorphism
                                              • 2.6 Behn
                                              • 2.7 Gall
                                              • 2.7.1 Gall Walkthrough: Egg Timer
                                              • Guides

                                                • CLI apps
                                                • Parsing
                                                • Writing Aqua Tests
                                                • Reference

                                                  • Cheat Sheet
                                                  • Irregular forms
                                                  • Hoon Errors
                                                  • Hoon Style Guide
                                                  • Basic Types
                                                  • Advanced Types
                                                  • Auras
                                                  • Runes

                                                    • Atoms and strings
                                                    • Nock . ('dot')
                                                    • Wild ! ('zap')
                                                    • Change Subject = ('tis')
                                                    • Conditionals ? ('wut')
                                                    • Cores | ('bar')
                                                    • Arms + ('lus')
                                                    • Cells : ('col')
                                                    • Calls % ('cen')
                                                    • Casts ^ ('ket')
                                                    • Structures $ ('buc')
                                                    • Make ; ('mic')
                                                    • Hints ~ ('sig')
                                                    • Terminators -- and ==
                                                    • Limbs and wings

                                                      • Limbs
                                                      • Wings
                                                      • Standard library

                                                        • Table of Contents
                                                        • 1a: Basic Arithmetic
                                                        • 1b: Tree Addressing
                                                        • 1c: Molds and Mold-Builders
                                                        • 2a: Unit Logic
                                                        • 2b: List Logic
                                                        • 2c: Bit Arithmetic
                                                        • 2d: Bit Logic
                                                        • 2e: Insecure Hashing
                                                        • 2f: Noun Ordering
                                                        • 2g: Unsigned Powers
                                                        • 2h: Set Logic
                                                        • 2i: Map Logic
                                                        • 2j: Jar and Jug Logic
                                                        • 2k: Queue Logic
                                                        • 2l: Container from Container
                                                        • 2m: Container from Noun
                                                        • 2n: Functional Hacks
                                                        • 2o: Normalizing Containers
                                                        • 2p: Serialization
                                                        • 2q: Molds and Mold-Builders
                                                        • 3a: Modular and Signed Ints
                                                        • 3b: Floating Point
                                                        • 3c: Urbit Time
                                                        • 3d: SHA Hash Family
                                                        • 3e: AES encryption (Removed)
                                                        • 3f: Scrambling
                                                        • 3g: Molds and Mold-Builders
                                                        • 4a: Exotic Bases
                                                        • 4b: Text Processing
                                                        • 4c: Tank Printer
                                                        • 4d: Parsing (Tracing)
                                                        • 4e: Parsing (Combinators)
                                                        • 4f: Parsing (Rule-Builders)
                                                        • 4g: Parsing (Outside Caller)
                                                        • 4h: Parsing (ASCII Glyphs)
                                                        • 4i: Parsing (Useful Idioms)
                                                        • 4j: Parsing (Bases and Base Digits)
                                                        • 4k: Atom Printing
                                                        • 4l: Atom Parsing
                                                        • 4m: Formatting Functions
                                                        • 4n: Virtualization
                                                        • 4o: Molds
                                                        • 5a: Compiler Utilities
                                                        • 5b: Macro Expansion
                                                        • 5c: Compiler Backend & Prettyprinter
                                                        • 5d: Parser
                                                        • 5e: Caching Compiler
                                                        • 5f: Molds and Mold-Builders
                                                        • 5g: profiling support
                                                    • Nock

                                                      • Nock Definition
                                                      • Explanation
                                                      • Example
                                                      • Implementations
                                                      • Vere

                                                        • C Runtime System
                                                        • Land of Nouns
                                                        • API overview by prefix
                                                        • C in Urbit
                                                        • Writing Jets
                                                        • Cryptography
                                                        • Azimuth

                                                          • Overview
                                                          • Life and Rift
                                                          • Advanced Azimuth Tools
                                                          • Glossary

                                                            • Ames
                                                            • Aqua
                                                            • Arm
                                                            • Arvo
                                                            • Atom
                                                            • Azimuth
                                                            • Battery
                                                            • Behn
                                                            • Breach
                                                            • Bridge
                                                            • Censures
                                                            • Ceremony
                                                            • chat
                                                            • Claims
                                                            • Clay
                                                            • Comet
                                                            • Core
                                                            • Delegated Sending
                                                            • Desk
                                                            • Dill
                                                            • Document Proposal
                                                            • Dojo
                                                            • Door
                                                            • Ecliptic
                                                            • Event Log
                                                            • Eyre
                                                            • Ford
                                                            • Galaxy
                                                            • Gall
                                                            • Gate
                                                            • HD Wallet
                                                            • Hoon
                                                            • Invite Tree
                                                            • Iris
                                                            • Jael
                                                            • Jaque
                                                            • Keyfile
                                                            • Landscape
                                                            • Mark
                                                            • Moon
                                                            • Nock
                                                            • Noun
                                                            • OTA Updates
                                                            • Payload
                                                            • pH
                                                            • Pier
                                                            • Pill
                                                            • Planet
                                                            • Proxies
                                                            • Replay
                                                            • Sail/Udon
                                                            • Senate
                                                            • Ship
                                                            • ship.arvo.network
                                                            • Star
                                                            • |sync
                                                            • Trap
                                                            • Upgrade Proposal
                                                            • Vane
                                                            • Vere
                                                            • Voting
                                                            • Wallet-Generator
                                                            Urbit
                                                            • Introduction
                                                            • Development

                                                              • Getting Started
                                                              • Environment Setup
                                                              • Grants Program
                                                              • Project Repositories
                                                              • Precepts
                                                              • System Overview

                                                                • Arvo
                                                                • Hoon
                                                                • Nock
                                                                • Vere
                                                                • Azimuth
                                                                • Cryptography
                                                                • Arvo

                                                                  • Overview
                                                                  • Reference

                                                                    • Cryptography
                                                                    • Filesystem Hierarchy
                                                                    • Ames

                                                                      • Overview
                                                                      • Cryptography
                                                                      • API Reference
                                                                      • Behn

                                                                        • Overview
                                                                        • API Reference
                                                                        • Clay

                                                                          • Overview
                                                                          • Architecture
                                                                          • Using Clay
                                                                          • Data Types
                                                                          • Scry Reference
                                                                          • API Reference
                                                                          • Examples
                                                                          • Dill

                                                                            • Overview
                                                                            • API Reference
                                                                            • Eyre

                                                                              • Overview
                                                                              • External API Reference
                                                                              • Internal API Reference
                                                                              • Scry Reference
                                                                              • Data Types
                                                                              • Examples
                                                                              • Ford

                                                                                • Overview
                                                                                • Gall

                                                                                  • Overview
                                                                                  • Iris

                                                                                    • API Reference
                                                                                    • Jael

                                                                                      • API Reference
                                                                                      • Concepts

                                                                                        • Subscriptions
                                                                                        • Tutorials

                                                                                          • Move Trace
                                                                                        • Userspace

                                                                                          • Overview
                                                                                          • Gall

                                                                                            • Overview
                                                                                            • Tutorial
                                                                                            • API Reference
                                                                                            • Graph Store

                                                                                              • Graph Store Overview
                                                                                              • Data Structure Overview
                                                                                              • Validator Walkthrough
                                                                                              • Advanced Info
                                                                                              • Threads

                                                                                                • Overview
                                                                                                • HTTP API
                                                                                                • Reference
                                                                                                • Basics

                                                                                                  • Fundamentals
                                                                                                  • Bind
                                                                                                  • Input
                                                                                                  • Output
                                                                                                  • Summary
                                                                                                  • Gall

                                                                                                    • Start Thread
                                                                                                    • Take Result
                                                                                                    • Take Facts
                                                                                                    • Stop Thread
                                                                                                    • Poke Thread
                                                                                                    • Examples

                                                                                                      • Fetch JSON
                                                                                                      • Child Thread
                                                                                                      • Main-loop
                                                                                                      • Poke Agent
                                                                                                      • Scry
                                                                                                      • Take Fact
                                                                                                    • Landscape

                                                                                                      • Overview
                                                                                                      • API Reference

                                                                                                        • Graph Store
                                                                                                    • Hoon

                                                                                                      • Overview
                                                                                                      • Hoon School

                                                                                                        • 1.1 Setup
                                                                                                        • 1.1.1 Walkthrough: List of Numbers
                                                                                                        • 1.2 Nouns
                                                                                                        • 1.3 Hoon Syntax
                                                                                                        • 1.3.1 Walkthrough: Conditionals
                                                                                                        • 1.4 Gates (Hoon Functions)
                                                                                                        • 1.4.1 Walkthrough: Recursion
                                                                                                        • 1.5 Lists
                                                                                                        • 1.5.1 Walkthrough: Fibonacci Sequence
                                                                                                        • 1.6 The Subject and Its Legs
                                                                                                        • 1.6.1 Walkthrough: Ackermann Function
                                                                                                        • 1.7 Arms and Cores
                                                                                                        • 1.7.1 Walkthrough: Caesar Cipher
                                                                                                        • 1.8 Doors
                                                                                                        • 1.8.1 Bank Account
                                                                                                        • 1.9 Generators
                                                                                                        • 2.1 Atoms, Auras, and Simple Cell Types
                                                                                                        • 2.2 Type Checking and Type Inference
                                                                                                        • 2.3 Structures and Complex Types
                                                                                                        • 2.3.1 Walkthrough: Libraries
                                                                                                        • 2.3.2 Molds
                                                                                                        • 2.4 Standard Library: Trees, Sets, and Maps
                                                                                                        • 2.5 Type Polymorphism
                                                                                                        • 2.5.1 Walkthrough: Iron Polymorphism and Wet Polymorphism
                                                                                                        • 2.5.2 Walkthrough: Lead Polymorphism
                                                                                                        • 2.6 Behn
                                                                                                        • 2.7 Gall
                                                                                                        • 2.7.1 Gall Walkthrough: Egg Timer
                                                                                                        • Guides

                                                                                                          • CLI apps
                                                                                                          • Parsing
                                                                                                          • Writing Aqua Tests
                                                                                                          • Reference

                                                                                                            • Cheat Sheet
                                                                                                            • Irregular forms
                                                                                                            • Hoon Errors
                                                                                                            • Hoon Style Guide
                                                                                                            • Basic Types
                                                                                                            • Advanced Types
                                                                                                            • Auras
                                                                                                            • Runes

                                                                                                              • Atoms and strings
                                                                                                              • Nock . ('dot')
                                                                                                              • Wild ! ('zap')
                                                                                                              • Change Subject = ('tis')
                                                                                                              • Conditionals ? ('wut')
                                                                                                              • Cores | ('bar')
                                                                                                              • Arms + ('lus')
                                                                                                              • Cells : ('col')
                                                                                                              • Calls % ('cen')
                                                                                                              • Casts ^ ('ket')
                                                                                                              • Structures $ ('buc')
                                                                                                              • Make ; ('mic')
                                                                                                              • Hints ~ ('sig')
                                                                                                              • Terminators -- and ==
                                                                                                              • Limbs and wings

                                                                                                                • Limbs
                                                                                                                • Wings
                                                                                                                • Standard library

                                                                                                                  • Table of Contents
                                                                                                                  • 1a: Basic Arithmetic
                                                                                                                  • 1b: Tree Addressing
                                                                                                                  • 1c: Molds and Mold-Builders
                                                                                                                  • 2a: Unit Logic
                                                                                                                  • 2b: List Logic
                                                                                                                  • 2c: Bit Arithmetic
                                                                                                                  • 2d: Bit Logic
                                                                                                                  • 2e: Insecure Hashing
                                                                                                                  • 2f: Noun Ordering
                                                                                                                  • 2g: Unsigned Powers
                                                                                                                  • 2h: Set Logic
                                                                                                                  • 2i: Map Logic
                                                                                                                  • 2j: Jar and Jug Logic
                                                                                                                  • 2k: Queue Logic
                                                                                                                  • 2l: Container from Container
                                                                                                                  • 2m: Container from Noun
                                                                                                                  • 2n: Functional Hacks
                                                                                                                  • 2o: Normalizing Containers
                                                                                                                  • 2p: Serialization
                                                                                                                  • 2q: Molds and Mold-Builders
                                                                                                                  • 3a: Modular and Signed Ints
                                                                                                                  • 3b: Floating Point
                                                                                                                  • 3c: Urbit Time
                                                                                                                  • 3d: SHA Hash Family
                                                                                                                  • 3e: AES encryption (Removed)
                                                                                                                  • 3f: Scrambling
                                                                                                                  • 3g: Molds and Mold-Builders
                                                                                                                  • 4a: Exotic Bases
                                                                                                                  • 4b: Text Processing
                                                                                                                  • 4c: Tank Printer
                                                                                                                  • 4d: Parsing (Tracing)
                                                                                                                  • 4e: Parsing (Combinators)
                                                                                                                  • 4f: Parsing (Rule-Builders)
                                                                                                                  • 4g: Parsing (Outside Caller)
                                                                                                                  • 4h: Parsing (ASCII Glyphs)
                                                                                                                  • 4i: Parsing (Useful Idioms)
                                                                                                                  • 4j: Parsing (Bases and Base Digits)
                                                                                                                  • 4k: Atom Printing
                                                                                                                  • 4l: Atom Parsing
                                                                                                                  • 4m: Formatting Functions
                                                                                                                  • 4n: Virtualization
                                                                                                                  • 4o: Molds
                                                                                                                  • 5a: Compiler Utilities
                                                                                                                  • 5b: Macro Expansion
                                                                                                                  • 5c: Compiler Backend & Prettyprinter
                                                                                                                  • 5d: Parser
                                                                                                                  • 5e: Caching Compiler
                                                                                                                  • 5f: Molds and Mold-Builders
                                                                                                                  • 5g: profiling support
                                                                                                              • Nock

                                                                                                                • Nock Definition
                                                                                                                • Explanation
                                                                                                                • Example
                                                                                                                • Implementations
                                                                                                                • Vere

                                                                                                                  • C Runtime System
                                                                                                                  • Land of Nouns
                                                                                                                  • API overview by prefix
                                                                                                                  • C in Urbit
                                                                                                                  • Writing Jets
                                                                                                                  • Cryptography
                                                                                                                  • Azimuth

                                                                                                                    • Overview
                                                                                                                    • Life and Rift
                                                                                                                    • Advanced Azimuth Tools
                                                                                                                    • Glossary

                                                                                                                      • Ames
                                                                                                                      • Aqua
                                                                                                                      • Arm
                                                                                                                      • Arvo
                                                                                                                      • Atom
                                                                                                                      • Azimuth
                                                                                                                      • Battery
                                                                                                                      • Behn
                                                                                                                      • Breach
                                                                                                                      • Bridge
                                                                                                                      • Censures
                                                                                                                      • Ceremony
                                                                                                                      • chat
                                                                                                                      • Claims
                                                                                                                      • Clay
                                                                                                                      • Comet
                                                                                                                      • Core
                                                                                                                      • Delegated Sending
                                                                                                                      • Desk
                                                                                                                      • Dill
                                                                                                                      • Document Proposal
                                                                                                                      • Dojo
                                                                                                                      • Door
                                                                                                                      • Ecliptic
                                                                                                                      • Event Log
                                                                                                                      • Eyre
                                                                                                                      • Ford
                                                                                                                      • Galaxy
                                                                                                                      • Gall
                                                                                                                      • Gate
                                                                                                                      • HD Wallet
                                                                                                                      • Hoon
                                                                                                                      • Invite Tree
                                                                                                                      • Iris
                                                                                                                      • Jael
                                                                                                                      • Jaque
                                                                                                                      • Keyfile
                                                                                                                      • Landscape
                                                                                                                      • Mark
                                                                                                                      • Moon
                                                                                                                      • Nock
                                                                                                                      • Noun
                                                                                                                      • OTA Updates
                                                                                                                      • Payload
                                                                                                                      • pH
                                                                                                                      • Pier
                                                                                                                      • Pill
                                                                                                                      • Planet
                                                                                                                      • Proxies
                                                                                                                      • Replay
                                                                                                                      • Sail/Udon
                                                                                                                      • Senate
                                                                                                                      • Ship
                                                                                                                      • ship.arvo.network
                                                                                                                      • Star
                                                                                                                      • |sync
                                                                                                                      • Trap
                                                                                                                      • Upgrade Proposal
                                                                                                                      • Vane
                                                                                                                      • Vere
                                                                                                                      • Voting
                                                                                                                      • Wallet-Generator
                                                                                                                      Urbit/Documentation/Hoon/Reference/Standard library

                                                                                                                      4n: Virtualization

                                                                                                                      ++mack

                                                                                                                      Nock subject to unit

                                                                                                                      Accepts a nock subject-formula cell and wraps it into a ++unit. fol is pure nock, meaning that nock 11 operations result in a block, producing a ~.

                                                                                                                      Accepts

                                                                                                                      sub is a subject noun.

                                                                                                                      fol is a formula noun, which is generally a ++nock.

                                                                                                                      Produces

                                                                                                                      The ++unit of a noun.

                                                                                                                      Source

                                                                                                                      ++  mack
                                                                                                                            |=  {sub/* fol/*}
                                                                                                                            ^-  (unit)
                                                                                                                            =+  ton=(mink [sub fol] |=({* *} ~))
                                                                                                                            ?.(?=({$0 *} ton) ~ [~ p.ton])
                                                                                                                          ::
                                                                                                                      

                                                                                                                      Examples

                                                                                                                          > (mack [[1 2 3] [0 1]])
                                                                                                                          [~ [1 2 3]]
                                                                                                                          > (mack [41 4 0 1])
                                                                                                                          [~ 42]
                                                                                                                          > (mack [4 0 4])
                                                                                                                          ~
                                                                                                                          > (mack [[[0 2] [1 3]] 4 4 4 4 0 5])
                                                                                                                          [~ 6]
                                                                                                                          > ;;((unit @tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
                                                                                                                          [~ %no]

                                                                                                                      ++mink

                                                                                                                      Mock interpreter

                                                                                                                      Bottom-level mock (virtual nock) interpreter. Produces a ++tone, a nock computation result. If nock 11 is invoked, sky computes on the subject and produces a ++unit result. An empty result becomes a %1 ++tone, indicating a block.

                                                                                                                      Accepts

                                                                                                                      sub is the subject as a noun.

                                                                                                                      fol is the formula as a noun.

                                                                                                                      sky is an %iron gate invoked with nock operator 11.

                                                                                                                      Produces

                                                                                                                      A ++tone.

                                                                                                                      Source

                                                                                                                      ++  mink
                                                                                                                            ~/  %mink
                                                                                                                            |=  {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
                                                                                                                            =+  tax=*(list {@ta *})
                                                                                                                            |-  ^-  tone
                                                                                                                            ?@  fol
                                                                                                                              [%2 tax]
                                                                                                                            ?:  ?=(^ -.fol)
                                                                                                                              =+  hed=$(fol -.fol)
                                                                                                                              ?:  ?=($2 -.hed)
                                                                                                                                hed
                                                                                                                              =+  tal=$(fol +.fol)
                                                                                                                              ?-  -.tal
                                                                                                                                $0  ?-(-.hed $0 [%0 p.hed p.tal], $1 hed)
                                                                                                                                $1  ?-(-.hed $0 tal, $1 [%1 (weld p.hed p.tal)])
                                                                                                                                $2  tal
                                                                                                                              ==
                                                                                                                            ?+    fol
                                                                                                                              [%2 tax]
                                                                                                                            ::
                                                                                                                                {$0 b/@}
                                                                                                                              ?:  =(0 b.fol)  [%2 tax]
                                                                                                                              ?:  =(1 b.fol)  [%0 sub]
                                                                                                                              ?:  ?=(@ sub)   [%2 tax]
                                                                                                                              =+  [now=(cap b.fol) lat=(mas b.fol)]
                                                                                                                              $(b.fol lat, sub ?:(=(2 now) -.sub +.sub))
                                                                                                                            ::
                                                                                                                                {$1 b/*}
                                                                                                                              [%0 b.fol]
                                                                                                                            ::
                                                                                                                                {$2 b/{^ *}}
                                                                                                                              =+  ben=$(fol b.fol)
                                                                                                                              ?.  ?=($0 -.ben)  ben
                                                                                                                              ?>(?=(^ p.ben) $(sub -.p.ben, fol +.p.ben))
                                                                                                                              ::?>(?=(^ p.ben) $([sub fol] p.ben)
                                                                                                                            ::
                                                                                                                                {$3 b/*}
                                                                                                                              =+  ben=$(fol b.fol)
                                                                                                                              ?.  ?=($0 -.ben)  ben
                                                                                                                              [%0 .?(p.ben)]
                                                                                                                            ::
                                                                                                                                {$4 b/*}
                                                                                                                              =+  ben=$(fol b.fol)
                                                                                                                              ?.  ?=($0 -.ben)  ben
                                                                                                                              ?.  ?=(@ p.ben)  [%2 tax]
                                                                                                                              [%0 .+(p.ben)]
                                                                                                                            ::
                                                                                                                                {$5 b/*}
                                                                                                                              =+  ben=$(fol b.fol)
                                                                                                                              ?.  ?=($0 -.ben)  ben
                                                                                                                              ?.  ?=(^ p.ben)  [%2 tax]
                                                                                                                              [%0 =(-.p.ben +.p.ben)]
                                                                                                                            ::
                                                                                                                                {$6 b/* c/* d/*}
                                                                                                                              $(fol =>(fol [2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]))
                                                                                                                            ::
                                                                                                                                {$7 b/* c/*}       $(fol =>(fol [2 b 1 c]))
                                                                                                                                {$8 b/* c/*}       $(fol =>(fol [7 [[0 1] b] c]))
                                                                                                                                {$9 b/* c/*}       $(fol =>(fol [7 c 0 b]))
                                                                                                                                {$10 @ c/*}        $(fol c.fol)
                                                                                                                                {$10 {b/* c/*} d/*}
                                                                                                                              =+  ben=$(fol c.fol)
                                                                                                                              ?.  ?=($0 -.ben)  ben
                                                                                                                              ?:  ?=(?($hunk $hand $lose $mean $spot) b.fol)
                                                                                                                                $(fol d.fol, tax [[b.fol p.ben] tax])
                                                                                                                              $(fol d.fol)
                                                                                                                            ::
                                                                                                                                {$11 b/* c/*}
                                                                                                                              =+  ref=$(fol b.fol)
                                                                                                                              =+  ben=$(fol c.fol)
                                                                                                                              ?.  ?=($0 -.ref)  ref
                                                                                                                              ?.  ?=($0 -.ben)  ben
                                                                                                                              =+  val=(gul p.ref p.ben)
                                                                                                                              ?~(val [%1 p.ben ~] ?~(u.val [%2 [[%hunk (mush p.ben)] tax]] [%0 u.u.val]))
                                                                                                                            ==
                                                                                                                          ::
                                                                                                                      

                                                                                                                      Examples

                                                                                                                          > (mink [20 [4 0 1]] $~)
                                                                                                                          [%0 p=21]
                                                                                                                          > (mink [[90 5 3] [0 3]] $~)
                                                                                                                          [%0 p=[5 3]]
                                                                                                                          > (mink 20^[4 0 1] $~)
                                                                                                                          [%0 p=21]
                                                                                                                          > (mink [90 5 3]^[0 3] $~)
                                                                                                                          [%0 p=[5 3]]
                                                                                                                          > (mink [0]^[11 1 20] $~)
                                                                                                                          [%1 p=~[20]]
                                                                                                                          > (mink [0]^[11 1 20] |=(a=* `[40 a]))
                                                                                                                          [%0 p=[40 20]]
                                                                                                                          > (mink [5]^[0 2] $~)
                                                                                                                          [%2 p=~]
                                                                                                                          > (mink [5]^[10 yelp/[0 1] 0 0] $~)
                                                                                                                          [%2 p=~[[~.yelp 5]]]

                                                                                                                      ++mock

                                                                                                                      Compute formula on subject with hint

                                                                                                                      Produces a ++toon, which is either a sucessful, blocked, or crashed result. If nock 11 is invoked, sky computes on the subject and produces a ++unit result. An empty result becomes a %1 ++tune, indicating a block.

                                                                                                                      Accepts

                                                                                                                      sub is the subject as a noun.

                                                                                                                      fol is the formula as a noun.

                                                                                                                      sky is an %iron gate invoked with nock operator 11.

                                                                                                                      Produces

                                                                                                                      The ++unit of a noun.

                                                                                                                      Source

                                                                                                                      ++  mock
                                                                                                                            |=  {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
                                                                                                                            (mook (mink [sub fol] gul))
                                                                                                                          ::
                                                                                                                      

                                                                                                                      Examples

                                                                                                                          > (mock [5 4 0 1] ,~)
                                                                                                                          [%0 p=6]
                                                                                                                          > (mock [~ 11 1 0] |=(* `999))
                                                                                                                          [%0 p=999]
                                                                                                                          > (mock [~ 0 1.337] ,~)
                                                                                                                          [%2 p=~]
                                                                                                                          > (mock [~ 11 1 1.337] ,~)
                                                                                                                          [%1 p=~[1.337]]
                                                                                                                          > (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[+<]))
                                                                                                                          [%0 p=14]
                                                                                                                          > (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>]))
                                                                                                                          [%0 p=[49 52 0]]
                                                                                                                          > ;;(tape +:(mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>])))
                                                                                                                          "14"

                                                                                                                      ++mong

                                                                                                                      Slam gate with sample

                                                                                                                      Produces a ++toon computation result from slamming gat with sam, using sky to compute or block on nock 11 when applicable.

                                                                                                                      Accepts

                                                                                                                      gat is a noun that is generally a gate.

                                                                                                                      sam is a sample noun.

                                                                                                                      sky is an %iron gate invoked with nock operator 11.

                                                                                                                      Produces

                                                                                                                      A ++toon.

                                                                                                                      Source

                                                                                                                      ++  mong
                                                                                                                            |=  {{gat/* sam/*} gul/$-({* *} (unit (unit)))}
                                                                                                                            ^-  toon
                                                                                                                            ?.  &(?=(^ gat) ?=(^ +.gat))
                                                                                                                              [%2 ~]
                                                                                                                            (mock [[-.gat [sam +>.gat]] -.gat] gul)
                                                                                                                          ::
                                                                                                                      

                                                                                                                      Examples

                                                                                                                          > (mong [|=(@ 20) ~] ,~)
                                                                                                                          [%0 p=20]
                                                                                                                          > (mong [|=(@ !!) ~] ,~)
                                                                                                                          [%2 p=~]
                                                                                                                          > (mong [|=(a/@ (add 20 a)) ~] ,~)
                                                                                                                          [%0 p=20]
                                                                                                                          > (mong [|=(a/[@ @] (add 20 -.a)) ~] ,~)
                                                                                                                          [%2 p=~]
                                                                                                                          > (mong [|=(a/[@ @] (add 20 -.a)) [4 6]] ,~)
                                                                                                                          [%0 p=24]
                                                                                                                          > (mong [|=(a/@ .^(a)) ~] ,~)
                                                                                                                          [%1 p=~[0]]
                                                                                                                          > (mong [|=(a/@ .^(a)) ~] ,[~ %42])
                                                                                                                          [%0 p=42]
                                                                                                                          > (mong [|=(a/@ .^(a)) ~] |=(a/* [~ a 6]))
                                                                                                                          [%0 p=[0 6]]
                                                                                                                          > (mong [|=(a/@ .^(a)) 8] |=(a/* [~ a 6]))
                                                                                                                          [%0 p=[8 6]]

                                                                                                                      ++mook

                                                                                                                      Intelligently render crash annotation

                                                                                                                      Converts a %2 ++tone nock stack trace to a list of ++tank. Each may be a tank, cord, ++spot, or trapped tank.

                                                                                                                      Accepts

                                                                                                                      ton is a ++tone.

                                                                                                                      Produces

                                                                                                                      A ++toon.

                                                                                                                      Source

                                                                                                                      ++  mook
                                                                                                                            |=  ton/tone
                                                                                                                            ^-  toon
                                                                                                                            ?.  ?=({$2 *} ton)  ton
                                                                                                                            :-  %2
                                                                                                                            :: =.  p.ton  (moop p.ton)
                                                                                                                            =+  yel=(lent p.ton)
                                                                                                                            =.  p.ton
                                                                                                                              ?.  (gth yel 256)  p.ton
                                                                                                                              %+  weld
                                                                                                                                (scag 128 p.ton)
                                                                                                                              ^-  (list {@ta *})
                                                                                                                              :_  (slag (sub yel 128) p.ton)
                                                                                                                              :-  %lose
                                                                                                                              %+  rap  3
                                                                                                                              "[skipped {(scow %ud (sub yel 256))} frames]"
                                                                                                                            |-  ^-  (list tank)
                                                                                                                            ?~  p.ton  ~
                                                                                                                            =+  rep=$(p.ton t.p.ton)
                                                                                                                            ?+    -.i.p.ton  rep
                                                                                                                                $hunk  [(tank +.i.p.ton) rep]
                                                                                                                                $lose  [[%leaf (rip 3 (@ +.i.p.ton))] rep]
                                                                                                                                $hand  [[%leaf (scow %p (mug +.i.p.ton))] rep]
                                                                                                                                $mean  :_  rep
                                                                                                                                       ?@  +.i.p.ton  [%leaf (rip 3 (@ +.i.p.ton))]
                                                                                                                                       =+  mac=(mack +.i.p.ton +<.i.p.ton)
                                                                                                                                       ?~(mac [%leaf "####"] (tank u.mac))
                                                                                                                                $spot  :_  rep
                                                                                                                                       =+  sot=(spot +.i.p.ton)
                                                                                                                                       :+  %rose  [":" ~ ~]
                                                                                                                                       :~  (smyt p.sot)
                                                                                                                                           =>  [ud=|=(a/@u (scow %ud a)) q.sot]
                                                                                                                                           leaf+"<[{(ud p.p)} {(ud q.p)}].[{(ud p.q)} {(ud q.q)}]>"
                                                                                                                            ==         ==
                                                                                                                          ::
                                                                                                                      

                                                                                                                      Examples

                                                                                                                          > (mook [%0 5 4 5 1])
                                                                                                                          [%0 p=[5 4 5 1]]
                                                                                                                          > (mook [%2 ~[[%hunk %rose ["<" "," ">"] ~[[%leaf "err"]]]]])
                                                                                                                          [%2 p=~[[%rose p=[p="<" q="," r=">"] q=[i=[%leaf p="err"] t=~]]]]
                                                                                                                          > (mook [%2 ~[[%malformed %elem] [%lose 'do print']]])
                                                                                                                          [%2 p=~[[%leaf p="do print"]]]
                                                                                                                          > (mook [%2 ~[[%mean |.(>(add 5 6)<)]]])
                                                                                                                          [%2 p=~[[%leaf p="11"]]]
                                                                                                                          > (mook [%2 ~[[%spot /b/repl [1 1]^[1 2]] [%mean |.(!!)]]])
                                                                                                                          [%2 p=~[[%leaf p="/b/repl/:<[1 1].[1 2]>"] [%leaf p="####"]]]

                                                                                                                      ++mule

                                                                                                                      Typed virtual

                                                                                                                      Kicks a ++trap, producing its results or any errors that occur along the way. Used to lazily compute stack traces.

                                                                                                                      Accepts

                                                                                                                      taq is a ++trap, generally producing a list of ++tanks.

                                                                                                                      Produces

                                                                                                                      XX

                                                                                                                      Source

                                                                                                                      ++  mule                                                ::  typed virtual
                                                                                                                            ~/  %mule
                                                                                                                            |*  taq/_|.(**)
                                                                                                                            =+  mud=(mute taq)
                                                                                                                            ?-  -.mud
                                                                                                                              $&  [%& p=$:taq]                                    ::  XX transition
                                                                                                                              $|  [%| p=p.mud]
                                                                                                                            ==
                                                                                                                          ::
                                                                                                                      

                                                                                                                      Examples

                                                                                                                          > (mule |.(leaf/"hello"))
                                                                                                                          [%.y p=[%leaf "hello"]]
                                                                                                                          > (mule |.(!!))
                                                                                                                          [%.n p=~]
                                                                                                                          > (mule |.(.^(a//=pals/1)))
                                                                                                                          [ %.n
                                                                                                                              p
                                                                                                                            ~[
                                                                                                                              [ %rose
                                                                                                                                p=[p="/" q="/" r="/"]
                                                                                                                                  q
                                                                                                                                [ i=[%leaf p="a"]
                                                                                                                                  t=[i=[%leaf p="~zod"] t=[i=[%leaf p="pals"] t=[i=[%leaf p="1"] t=~]]]
                                                                                                                                ]
                                                                                                                              ]
                                                                                                                            ]
                                                                                                                          ]

                                                                                                                      ++mute

                                                                                                                      Untyped virtual

                                                                                                                      Kicks a ++trap, producing its result as a noun or the tanks of any error that occurs. Similar to ++mule, but preserves no type information.

                                                                                                                      Accepts

                                                                                                                      taq is a ++trap.

                                                                                                                      Produces

                                                                                                                      Either a noun or a ++list of ++tank.

                                                                                                                      Source

                                                                                                                      ++  mute                                                ::  untyped virtual
                                                                                                                            |=  taq/_^?(|.(**))
                                                                                                                            ^-  (each * (list tank))
                                                                                                                            =+  ton=(mock [taq 9 2 0 1] |=({* *} ~))
                                                                                                                            ?-  -.ton
                                                                                                                              $0  [%& p.ton]
                                                                                                                              $1  [%| (turn p.ton |=(a/* (smyt (path a))))]
                                                                                                                              $2  [%| p.ton]
                                                                                                                            ==
                                                                                                                      

                                                                                                                      Examples

                                                                                                                          >  (mute |.(leaf/"hello"))
                                                                                                                          [%.y p=[1.717.658.988 104 101 108 108 111 0]]
                                                                                                                          > (mute |.(!!))
                                                                                                                          [%.n p=~]

                                                                                                                      <-

                                                                                                                      4m: Formatting Functions

                                                                                                                      4o: Molds

                                                                                                                      ->