Urbit Developers
  • Hoon

    • Overview
    • Cheat Sheet
    • Irregular forms
    • Hoon Errors
    • Hoon Style Guide
    • Basic Types
    • Advanced Types
    • Auras
    • Arvo
    • Standard Library

      • 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: Molds and mold builders
      • 5f: Profiling support
      • Runes

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

          • Limbs
          • Wings
          • Zuse

            • 2d(1-5): To JSON, Wains
            • 2d(6): From JSON
            • 2d(7): From JSON (unit)
            • 2e(2-3): Print & Parse JSON
            • 2m: Ordered Maps
          • Arvo

            • Overview
            • Ames

              • Overview
              • Cryptography
              • API Reference
              • Scry Reference
              • Data Types
              • Behn

                • Overview
                • API Reference
                • Scry Reference
                • Examples
                • Clay

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

                    • Overview
                    • Writing Marks
                    • Using Marks
                    • Examples
                  • Dill

                    • Overview
                    • API Reference
                    • Scry Reference
                    • Data Types
                    • Eyre

                      • Overview
                      • External API Reference
                      • Internal API Reference
                      • Scry Reference
                      • Data Types
                      • Guide
                      • Gall

                        • Overview
                        • API Reference
                        • Data Types
                        • Threads Reference
                        • Iris

                          • Overview
                          • API Reference
                          • Data Types
                          • Example
                          • Jael

                            • Overview
                            • API Reference
                            • Scry Reference
                            • Data Types
                            • Examples
                            • Khan

                              • Overview
                              • API Reference
                              • Data Types
                              • Example
                              • Threads

                                • Overview
                                • HTTP API
                                • Reference
                                • Gall

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

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

                                    • Scries
                                    • Subscriptions
                                    • Tutorials

                                      • Move Trace
                                      • Reference

                                        • Cryptography
                                        • Filesystem Hierarchy
                                      • 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
                                            • Urbit HD Wallet
                                            • Azimuth Data Flow
                                            • Azimuth.eth
                                            • Ecliptic.eth
                                            • Advanced Azimuth Tools
                                            • Life and Rift
                                            • Layer 2

                                              • Layer 2 Overview
                                              • Layer 2 Actions
                                              • Transaction Format
                                              • Rollers
                                              • Roller HTTP RPC-API
                                              • Custom Roller Tutorial
                                            • Glossary

                                              • Agent
                                              • Ames
                                              • API
                                              • Aqua
                                              • Arm
                                              • Arvo
                                              • Atom
                                              • Aura
                                              • Aural ASCII
                                              • Azimuth
                                              • Battery
                                              • Behn
                                              • Bowl
                                              • Bridge
                                              • Bunt
                                              • Card
                                              • Case
                                              • Cask
                                              • Cell
                                              • Censures
                                              • Claims
                                              • Clay
                                              • Cold atom
                                              • Comet
                                              • Commit
                                              • Cons
                                              • Context
                                              • Cord
                                              • Core
                                              • Delegated Sending
                                              • Desk
                                              • Dill
                                              • Document Proposal
                                              • Dojo
                                              • Door
                                              • Double-boot
                                              • Dry Gate
                                              • Duct
                                              • Ecliptic
                                              • Entropy
                                              • Event Log
                                              • Eyre
                                              • Face
                                              • Fact
                                              • Foo Bar Baz
                                              • Galaxy
                                              • Gall
                                              • Garden
                                              • Gate
                                              • Generator
                                              • Gift
                                              • Glob
                                              • HD Wallet
                                              • Helm
                                              • Hood
                                              • Hoon
                                              • Invite Tree
                                              • Iris
                                              • Jael
                                              • Jet
                                              • Kelvin versioning
                                              • Kelvin versioning
                                              • Keyfile
                                              • Keywords
                                              • Khan
                                              • Kiln
                                              • Landscape
                                              • Leg
                                              • List
                                              • Loobean
                                              • Lull
                                              • Mark
                                              • Metals
                                              • Mold
                                              • Monad
                                              • Moon
                                              • Move
                                              • Nock
                                              • Noun
                                              • ~
                                              • OTA Updates
                                              • Path Prefix
                                              • Path
                                              • @p
                                              • Payload
                                              • Peek
                                              • pH
                                              • Pier
                                              • Pill
                                              • Planet
                                              • Poke
                                              • Proxies
                                              • Replay
                                              • Factory Reset
                                              • Roller
                                              • Naive rollups
                                              • Rune
                                              • Runtime
                                              • Sail
                                              • Sample
                                              • Scry
                                              • Senate
                                              • Ship
                                              • Slam
                                              • Spider
                                              • Sponsor
                                              • Star
                                              • String
                                              • Subject Oriented Programming
                                              • Subject
                                              • Subscription
                                              • Tape
                                              • Thread
                                              • Trap
                                              • Udon
                                              • Upgrade Proposal
                                              • Userspace
                                              • Vane
                                              • Vase
                                              • Vere
                                              • Voting
                                              • Warm atom
                                              • Wet Gate
                                              • Wing
                                              • Wire
                                              • Wrapper
                                              • ~zod
                                              • Zuse
                                              • Additional

                                                • Cryptography
                                                • Mips (Maps of Maps)
                                                • Software Distribution

                                                  • Overview
                                                  • Docket File
                                                  • Glob
                                                Urbit Developers
                                                • Hoon

                                                  • Overview
                                                  • Cheat Sheet
                                                  • Irregular forms
                                                  • Hoon Errors
                                                  • Hoon Style Guide
                                                  • Basic Types
                                                  • Advanced Types
                                                  • Auras
                                                  • Arvo
                                                  • Standard Library

                                                    • 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: Molds and mold builders
                                                    • 5f: Profiling support
                                                    • Runes

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

                                                        • Limbs
                                                        • Wings
                                                        • Zuse

                                                          • 2d(1-5): To JSON, Wains
                                                          • 2d(6): From JSON
                                                          • 2d(7): From JSON (unit)
                                                          • 2e(2-3): Print & Parse JSON
                                                          • 2m: Ordered Maps
                                                        • Arvo

                                                          • Overview
                                                          • Ames

                                                            • Overview
                                                            • Cryptography
                                                            • API Reference
                                                            • Scry Reference
                                                            • Data Types
                                                            • Behn

                                                              • Overview
                                                              • API Reference
                                                              • Scry Reference
                                                              • Examples
                                                              • Clay

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

                                                                  • Overview
                                                                  • Writing Marks
                                                                  • Using Marks
                                                                  • Examples
                                                                • Dill

                                                                  • Overview
                                                                  • API Reference
                                                                  • Scry Reference
                                                                  • Data Types
                                                                  • Eyre

                                                                    • Overview
                                                                    • External API Reference
                                                                    • Internal API Reference
                                                                    • Scry Reference
                                                                    • Data Types
                                                                    • Guide
                                                                    • Gall

                                                                      • Overview
                                                                      • API Reference
                                                                      • Data Types
                                                                      • Threads Reference
                                                                      • Iris

                                                                        • Overview
                                                                        • API Reference
                                                                        • Data Types
                                                                        • Example
                                                                        • Jael

                                                                          • Overview
                                                                          • API Reference
                                                                          • Scry Reference
                                                                          • Data Types
                                                                          • Examples
                                                                          • Khan

                                                                            • Overview
                                                                            • API Reference
                                                                            • Data Types
                                                                            • Example
                                                                            • Threads

                                                                              • Overview
                                                                              • HTTP API
                                                                              • Reference
                                                                              • Gall

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

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

                                                                                  • Scries
                                                                                  • Subscriptions
                                                                                  • Tutorials

                                                                                    • Move Trace
                                                                                    • Reference

                                                                                      • Cryptography
                                                                                      • Filesystem Hierarchy
                                                                                    • 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
                                                                                          • Urbit HD Wallet
                                                                                          • Azimuth Data Flow
                                                                                          • Azimuth.eth
                                                                                          • Ecliptic.eth
                                                                                          • Advanced Azimuth Tools
                                                                                          • Life and Rift
                                                                                          • Layer 2

                                                                                            • Layer 2 Overview
                                                                                            • Layer 2 Actions
                                                                                            • Transaction Format
                                                                                            • Rollers
                                                                                            • Roller HTTP RPC-API
                                                                                            • Custom Roller Tutorial
                                                                                          • Glossary

                                                                                            • Agent
                                                                                            • Ames
                                                                                            • API
                                                                                            • Aqua
                                                                                            • Arm
                                                                                            • Arvo
                                                                                            • Atom
                                                                                            • Aura
                                                                                            • Aural ASCII
                                                                                            • Azimuth
                                                                                            • Battery
                                                                                            • Behn
                                                                                            • Bowl
                                                                                            • Bridge
                                                                                            • Bunt
                                                                                            • Card
                                                                                            • Case
                                                                                            • Cask
                                                                                            • Cell
                                                                                            • Censures
                                                                                            • Claims
                                                                                            • Clay
                                                                                            • Cold atom
                                                                                            • Comet
                                                                                            • Commit
                                                                                            • Cons
                                                                                            • Context
                                                                                            • Cord
                                                                                            • Core
                                                                                            • Delegated Sending
                                                                                            • Desk
                                                                                            • Dill
                                                                                            • Document Proposal
                                                                                            • Dojo
                                                                                            • Door
                                                                                            • Double-boot
                                                                                            • Dry Gate
                                                                                            • Duct
                                                                                            • Ecliptic
                                                                                            • Entropy
                                                                                            • Event Log
                                                                                            • Eyre
                                                                                            • Face
                                                                                            • Fact
                                                                                            • Foo Bar Baz
                                                                                            • Galaxy
                                                                                            • Gall
                                                                                            • Garden
                                                                                            • Gate
                                                                                            • Generator
                                                                                            • Gift
                                                                                            • Glob
                                                                                            • HD Wallet
                                                                                            • Helm
                                                                                            • Hood
                                                                                            • Hoon
                                                                                            • Invite Tree
                                                                                            • Iris
                                                                                            • Jael
                                                                                            • Jet
                                                                                            • Kelvin versioning
                                                                                            • Kelvin versioning
                                                                                            • Keyfile
                                                                                            • Keywords
                                                                                            • Khan
                                                                                            • Kiln
                                                                                            • Landscape
                                                                                            • Leg
                                                                                            • List
                                                                                            • Loobean
                                                                                            • Lull
                                                                                            • Mark
                                                                                            • Metals
                                                                                            • Mold
                                                                                            • Monad
                                                                                            • Moon
                                                                                            • Move
                                                                                            • Nock
                                                                                            • Noun
                                                                                            • ~
                                                                                            • OTA Updates
                                                                                            • Path Prefix
                                                                                            • Path
                                                                                            • @p
                                                                                            • Payload
                                                                                            • Peek
                                                                                            • pH
                                                                                            • Pier
                                                                                            • Pill
                                                                                            • Planet
                                                                                            • Poke
                                                                                            • Proxies
                                                                                            • Replay
                                                                                            • Factory Reset
                                                                                            • Roller
                                                                                            • Naive rollups
                                                                                            • Rune
                                                                                            • Runtime
                                                                                            • Sail
                                                                                            • Sample
                                                                                            • Scry
                                                                                            • Senate
                                                                                            • Ship
                                                                                            • Slam
                                                                                            • Spider
                                                                                            • Sponsor
                                                                                            • Star
                                                                                            • String
                                                                                            • Subject Oriented Programming
                                                                                            • Subject
                                                                                            • Subscription
                                                                                            • Tape
                                                                                            • Thread
                                                                                            • Trap
                                                                                            • Udon
                                                                                            • Upgrade Proposal
                                                                                            • Userspace
                                                                                            • Vane
                                                                                            • Vase
                                                                                            • Vere
                                                                                            • Voting
                                                                                            • Warm atom
                                                                                            • Wet Gate
                                                                                            • Wing
                                                                                            • Wire
                                                                                            • Wrapper
                                                                                            • ~zod
                                                                                            • Zuse
                                                                                            • Additional

                                                                                              • Cryptography
                                                                                              • Mips (Maps of Maps)
                                                                                              • Software Distribution

                                                                                                • Overview
                                                                                                • Docket File
                                                                                                • Glob
                                                                                              Reference/Hoon/Standard Library

                                                                                              5c: Compiler Backend & Prettyprinter

                                                                                              ++ut

                                                                                              Hoon compiler backend

                                                                                              Source

                                                                                              This core is too large to include here, refer to hoon.hoon for the source.


                                                                                              ++us

                                                                                              Pretty-printer backend

                                                                                              Source

                                                                                              This core is too large to include here, refer to hoon.hoon for the source.


                                                                                              ++cain

                                                                                              Tank pretty-print

                                                                                              Pretty-print a vase as a tank using ++deal. This is the same as ++sell.

                                                                                              Accepts

                                                                                              A vase.

                                                                                              Produces

                                                                                              A tank.

                                                                                              Source

                                                                                              ++ cain sell

                                                                                              Examples

                                                                                              > (cain !>(['foo' 'bar']))
                                                                                              [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="'foo'"] [%leaf p="'bar'"]]]

                                                                                              ++noah

                                                                                              Tape pretty-print

                                                                                              Pretty-print a vase as a tape. This is the same as ++text.

                                                                                              Accepts

                                                                                              A vase.

                                                                                              Produces

                                                                                              A tape.

                                                                                              Source

                                                                                              ++ noah text

                                                                                              Examples

                                                                                              > (noah !>(['foo' 'bar']))
                                                                                              "['foo' 'bar']"

                                                                                              ++onan

                                                                                              Vise to vase

                                                                                              Convert a vise (old vase) to the new vase. This is the same as ++seer.

                                                                                              Accepts

                                                                                              A vise.

                                                                                              Produces

                                                                                              A vase.

                                                                                              Source

                                                                                              ++ onan seer

                                                                                              Examples

                                                                                              > (onan `vise`!>(['foo' 'bar']))
                                                                                              [#t/[@t @t] q=[7.303.014 7.496.034]]

                                                                                              ++levi

                                                                                              Type nests or crash

                                                                                              Check if type b nests under type a. Produces %.y if it nests and crashes if it does not.

                                                                                              Accepts

                                                                                              a is a type.

                                                                                              b is a type.

                                                                                              Produces

                                                                                              A ?.

                                                                                              Source

                                                                                              ++ levi
                                                                                              |= [a=type b=type]
                                                                                              (~(nest ut a) & b)

                                                                                              Examples

                                                                                              > (levi -:!>('foo') -:!>(%foo))
                                                                                              %.y
                                                                                              > (levi -:!>(%foo) -:!>('foo'))
                                                                                              -need.%foo
                                                                                              [email protected]
                                                                                              nest-fail

                                                                                              ++text

                                                                                              Tape pretty-print

                                                                                              Pretty print vase vax as a tape.

                                                                                              Accepts

                                                                                              vax is a vase.

                                                                                              Produces

                                                                                              A tape.

                                                                                              Source

                                                                                              ++ text
                                                                                              |= vax=vase ^- tape
                                                                                              ~(ram re (sell vax))

                                                                                              Examples

                                                                                              > (text !>(['foo' 'bar']))
                                                                                              "['foo' 'bar']"

                                                                                              ++seem

                                                                                              Promote typo

                                                                                              Convert typo (old type) to the new type.

                                                                                              Accepts

                                                                                              toy is a typo.

                                                                                              Produces

                                                                                              A type.

                                                                                              Source

                                                                                              ++ seem |=(toy=typo `type`toy)

                                                                                              Examples

                                                                                              > (seem -:!>('foo'))
                                                                                              #t/@t

                                                                                              ++seer

                                                                                              Promote vise

                                                                                              Convert a vise (old vase) to the new vase.

                                                                                              Accepts

                                                                                              vix is a vise.

                                                                                              Produces

                                                                                              A vase.

                                                                                              Source

                                                                                              ++ seer |=(vix=vise `vase`vix)

                                                                                              Examples

                                                                                              > (seer !>('foo'))
                                                                                              [#t/@t q=7.303.014]

                                                                                              ++sell

                                                                                              Pretty-print vase to a tank

                                                                                              Pretty-print vase vax to a tank using ++deal:us.

                                                                                              Accepts

                                                                                              vax is a vase.

                                                                                              Produces

                                                                                              A tank.

                                                                                              Source

                                                                                              ++ sell
                                                                                              ~/ %sell
                                                                                              |= vax=vase
                                                                                              ^- tank
                                                                                              ~| %sell
                                                                                              (~(deal us p.vax) q.vax)

                                                                                              Examples

                                                                                              > (sell !>(['foo' 'bar']))
                                                                                              [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="'foo'"] [%leaf p="'bar'"]]]

                                                                                              ++skol

                                                                                              Pretty-print type to tank

                                                                                              Pretty-print type typ to a tank using ++duck:ut.

                                                                                              Accepts

                                                                                              typ is a type.

                                                                                              Produces

                                                                                              A tank.

                                                                                              Source

                                                                                              ++ skol
                                                                                              |= typ=type
                                                                                              ^- tank
                                                                                              ~(duck ut typ)

                                                                                              Examples

                                                                                              > (skol -:!>(['foo' 'bar']))
                                                                                              [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="@t"] [%leaf p="@t"]]]

                                                                                              ++slam

                                                                                              Slam a gate

                                                                                              Slam gat, a gate in a vase, with sam, a sample in a vase. Produces a vase containing the result.

                                                                                              Accepts

                                                                                              gat is a gate in a vase.

                                                                                              sam is a noun in a vase.

                                                                                              Produces

                                                                                              A vase.

                                                                                              Source

                                                                                              ++ slam
                                                                                              |= [gat=vase sam=vase] ^- vase
                                                                                              =+ :- ^= typ ^- type
                                                                                              [%cell p.gat p.sam]
                                                                                              ^= gen ^- hoon
                                                                                              [%cnsg [%$ ~] [%$ 2] [%$ 3] ~]
                                                                                              =+ gun=(~(mint ut typ) %noun gen)
                                                                                              [p.gun (slum q.gat q.sam)]

                                                                                              Examples

                                                                                              > (slam !>(|=([[email protected] [email protected]] [b a])) !>([1 2]))
                                                                                              [#t/[@ud @ud] q=[2 1]]

                                                                                              ++slab

                                                                                              Test if contains

                                                                                              States whether you can access named wing cog in type typ using access method way.

                                                                                              Accepts

                                                                                              way is a ?(%read %rite %both) (A $vial without %free). This represents the access method (read, write, or both read and write).

                                                                                              cog is a @tas, the name of a wing.

                                                                                              typ is a type.

                                                                                              Produces

                                                                                              A ?.

                                                                                              Source

                                                                                              ++ slab
                                                                                              |= [way=?(%read %rite %both) cog=@tas typ=type]
                                                                                              ?= [%& *]
                                                                                              (~(fond ut typ) way ~[cog])
                                                                                              > =au |=([email protected] +(a))
                                                                                              > (slab %read %a -:!>(au))
                                                                                              %.y
                                                                                              > (slab %rite %a -:!>(au))
                                                                                              %.y
                                                                                              > (slab %both %a -:!>(au))
                                                                                              %.y
                                                                                              > (slab %both %blah -:!>(au))
                                                                                              %.n
                                                                                              > =fe ^|(|=([email protected] +(a)))
                                                                                              > (slab %read %a -:!>(fe))
                                                                                              %.n
                                                                                              > (slab %rite %a -:!>(fe))
                                                                                              %.y
                                                                                              > (slab %both %a -:!>(fe))
                                                                                              %.n

                                                                                              ++slap

                                                                                              Untyped vase .*

                                                                                              Compile hoon gen with subject vax using .*, producing a vase of the result.

                                                                                              Accepts

                                                                                              vax is a noun in a vase, and is the subject.

                                                                                              gen is some hoon.

                                                                                              Produces

                                                                                              A vase.

                                                                                              Source

                                                                                              ++ slap
                                                                                              |= [vax=vase gen=hoon] ^- vase
                                                                                              =+ gun=(~(mint ut p.vax) %noun gen)
                                                                                              [p.gun .*(q.vax q.gun)]

                                                                                              Examples

                                                                                              > (slap !>(b='foo') (ream '|=([email protected] [a b])'))
                                                                                              [#t/<1.qgm [[email protected] [email protected]]> q=[[[0 6] 0 7] 0 7.303.014]]
                                                                                              > !<($-(@t [@t @t]) (slap !>(b='foo') (ream '|=([email protected] [a b])')))
                                                                                              <1|xpg [@t @t @t @t]>
                                                                                              > (!<($-(@t [@t @t]) (slap !>(b='foo') (ream '|=([email protected] [a b])'))) 'bar')
                                                                                              ['bar' 'foo']

                                                                                              ++slog

                                                                                              Deify printf

                                                                                              Prints stack trace a if the stack trace isn't null, then produces the other input. +slog first takes a, producing a gate. The gate then takes some hoon.

                                                                                              Accepts

                                                                                              a is a tang, and is the sample of +slog.

                                                                                              (slog a) takes some hoon.

                                                                                              Produces

                                                                                              The result of the hoon given to (slog a), with a printed to the terminal.

                                                                                              Source

                                                                                              ++ slog
                                                                                              =| pri=@
                                                                                              |= a=tang ^+ same
                                                                                              ?~(a same ~>(%slog.[pri i.a] $(a t.a)))

                                                                                              Examples

                                                                                              foo
                                                                                              > ((slog leaf+"foo" ~) (add 1 1))
                                                                                              2

                                                                                              Discussion

                                                                                              slog is intended to be put in the middle of a bunch of chained function calls that string a piece of data through them, so that an error message will be printed if there's one to print.


                                                                                              ++mean

                                                                                              Crash and printf

                                                                                              Ends the program and prints a, a tracing error message.

                                                                                              Accepts

                                                                                              a is a tang.

                                                                                              Produces

                                                                                              A crash, with a printed to the terminal.

                                                                                              Source

                                                                                              ++ mean
                                                                                              |= a=tang
                                                                                              ^+ !!
                                                                                              ?~ a !!
                                                                                              ~_(i.a $(a t.a))

                                                                                              Examples

                                                                                              > (mean leaf+"foo" ~)
                                                                                              foo
                                                                                              dojo: hoon expression failed

                                                                                              ++road

                                                                                              Evaluate trap

                                                                                              Evaluate a trap, producing the result if successful or else crashing with a trace.

                                                                                              Accepts

                                                                                              A trap.

                                                                                              Produces

                                                                                              A noun.

                                                                                              Source

                                                                                              ++ road
                                                                                              |* =(trap *)
                                                                                              ^+ $:trap
                                                                                              =/ res (mule trap)
                                                                                              ?- -.res
                                                                                              %& p.res
                                                                                              %| (mean p.res)
                                                                                              ==

                                                                                              Examples

                                                                                              > (road |.("foo"))
                                                                                              "foo"
                                                                                              > (road |.(~|('crash!' !!)))
                                                                                              'crash!'
                                                                                              dojo: hoon expression failed

                                                                                              ++slew

                                                                                              Get axis in vase

                                                                                              Get axis axe in vase vax, producing the resulting vase in a unit which is null if the axis cannot be retrieved.

                                                                                              Accepts

                                                                                              axe is an atom.

                                                                                              vax is a vase.

                                                                                              Produces

                                                                                              A (unit vase).

                                                                                              Source

                                                                                              ++ slew
                                                                                              |= [axe=@ vax=vase] ^- (unit vase)
                                                                                              ?. |- ^- ?
                                                                                              ?: =(1 axe) &
                                                                                              ?. ?=(^ q.vax) |
                                                                                              $(axe (mas axe), q.vax .*(q.vax [0 (cap axe)]))
                                                                                              ~
                                                                                              `[(~(peek ut p.vax) %free axe) .*(q.vax [0 axe])]

                                                                                              Examples

                                                                                              > (slew 3 !>(['foo' 'bar']))
                                                                                              [~ [#t/@t q=7.496.034]]
                                                                                              > !<(@t (need (slew 3 !>(['foo' 'bar']))))
                                                                                              'bar'
                                                                                              > (slew 7 !>(['foo' 'bar']))
                                                                                              ~

                                                                                              ++slim

                                                                                              Identical to ++seer

                                                                                              Convert a vise (old vase) to a vase. Identical to ++seer.

                                                                                              Accepts

                                                                                              old is a vise.

                                                                                              Produces

                                                                                              A vase.

                                                                                              Source

                                                                                              ++ slim
                                                                                              |= old=vise ^- vase
                                                                                              old

                                                                                              Examples

                                                                                              > (slim !>('foo'))
                                                                                              [#t/@t q=7.303.014]

                                                                                              ++slit

                                                                                              Type of slam

                                                                                              The type produced if a gate of type gat were slammed with a sample of type sam.

                                                                                              Accepts

                                                                                              gat is a type.

                                                                                              sam is a type.

                                                                                              Produces

                                                                                              A type.

                                                                                              Source

                                                                                              ++ slit
                                                                                              |= [gat=type sam=type]
                                                                                              ?> (~(nest ut (~(peek ut gat) %free 6)) & sam)
                                                                                              (~(play ut [%cell gat sam]) [%cnsg [%$ ~] [%$ 2] [%$ 3] ~])

                                                                                              Examples

                                                                                              > (slit -:!>(|*([email protected] [a a])) -:!>(42))
                                                                                              #t/[@ud @ud]
                                                                                              > (slit -:!>(|*([email protected] [a a])) -:!>('foo'))
                                                                                              #t/[@t @t]

                                                                                              ++slob

                                                                                              Superficial arm

                                                                                              Source

                                                                                              ++ slob
                                                                                              |= [cog=@tas typ=type]
                                                                                              ^- ?
                                                                                              ?+ typ |
                                                                                              [%hold *] $(typ ~(repo ut typ))
                                                                                              [%hint *] $(typ ~(repo ut typ))
                                                                                              [%core *]
                                                                                              |- ^- ?
                                                                                              ?~ q.r.q.typ |
                                                                                              ?| (~(has by q.q.n.q.r.q.typ) cog)
                                                                                              $(q.r.q.typ l.q.r.q.typ)
                                                                                              $(q.r.q.typ r.q.r.q.typ)
                                                                                              ==
                                                                                              ==

                                                                                              ++sloe

                                                                                              Get arms in core

                                                                                              Produces a list of the arms in a core of type typ.

                                                                                              Accepts

                                                                                              typ is a type.

                                                                                              Produces

                                                                                              A (list term).

                                                                                              Source

                                                                                              ++ sloe
                                                                                              |= typ=type
                                                                                              ^- (list term)
                                                                                              ?+ typ ~
                                                                                              [%hold *] $(typ ~(repo ut typ))
                                                                                              [%hint *] $(typ ~(repo ut typ))
                                                                                              [%core *]
                                                                                              %- zing
                                                                                              %+ turn ~(tap by q.r.q.typ)
                                                                                              |= [* b=tome]
                                                                                              %+ turn ~(tap by q.b)
                                                                                              |= [a=term *]
                                                                                              a
                                                                                              ==

                                                                                              Examples

                                                                                              > (sloe -:!>(|=(@ 1)))
                                                                                              ~[%$]
                                                                                              > =cr |%
                                                                                              ++ foo 1
                                                                                              ++ bar 2
                                                                                              ++ baz 3
                                                                                              --
                                                                                              > (sloe -:!>(cr))
                                                                                              ~[%foo %baz %bar]
                                                                                              > (sloe -:!>(42))
                                                                                              ~

                                                                                              ++slop

                                                                                              Cons two vases

                                                                                              Produce the vase of a cell of vases hed and tal.

                                                                                              Accepts

                                                                                              hed is a vase.

                                                                                              tal is a vase.

                                                                                              Produces

                                                                                              A vase.

                                                                                              Source

                                                                                              ++ slop
                                                                                              |= [hed=vase tal=vase]
                                                                                              ^- vase
                                                                                              [[%cell p.hed p.tal] [q.hed q.tal]]

                                                                                              Examples

                                                                                              > (slop !>('foo') !>(42))
                                                                                              [#t/[@t @ud] q=[7.303.014 42]]
                                                                                              > !<([@t @ud] (slop !>('foo') !>(42)))
                                                                                              ['foo' 42]

                                                                                              ++slot

                                                                                              Got axis in vase

                                                                                              Get axis axe in vase vax, returning it in a vase. Crashes if the axis cannot be retrieved.

                                                                                              Accepts

                                                                                              axe is an atom.

                                                                                              vax is a vase.

                                                                                              Produces

                                                                                              A vase.

                                                                                              Source

                                                                                              ++ slot
                                                                                              |= [axe=@ vax=vase] ^- vase
                                                                                              [(~(peek ut p.vax) %free axe) .*(q.vax [0 axe])]

                                                                                              Examples

                                                                                              > (slot 3 !>(['foo' 'bar']))
                                                                                              [#t/@t q=7.496.034]
                                                                                              > !<(@t (slot 3 !>(['foo' 'bar'])))
                                                                                              'bar'
                                                                                              > (slot 7 !>(['foo' 'bar']))
                                                                                              dojo: hoon expression failed

                                                                                              ++slym

                                                                                              Slam without sample-type

                                                                                              Slam gat, a gate in a vase, with sam, a noun. The type of sam is ignored and the type of the resulting vase is determined by the gate alone.

                                                                                              Accepts

                                                                                              gat is a vase.

                                                                                              sam is a noun.

                                                                                              Produces

                                                                                              A vase.

                                                                                              Source

                                                                                              ++ slym
                                                                                              |= [gat=vase sam=*] ^- vase
                                                                                              (slap gat(+<.q sam) [%limb %$])

                                                                                              Examples

                                                                                              > (slym !>(|*([email protected] [a a])) 'foo')
                                                                                              [#t/[@ux @ux] q=[7.303.014 7.303.014]]
                                                                                              > (slym !>(|*([email protected] [a a])) "foobar")
                                                                                              [#t/[@ux @ux] q=[[102 111 111 98 97 114 0] 102 111 111 98 97 114 0]]

                                                                                              ++sped

                                                                                              Reconstruct type

                                                                                              Source

                                                                                              ++ sped
                                                                                              |= vax=vase
                                                                                              ^- vase
                                                                                              :_ q.vax
                                                                                              ?@ q.vax (~(fuse ut p.vax) [%atom %$ ~])
                                                                                              ?@ -.q.vax
                                                                                              ^= typ
                                                                                              %- ~(play ut p.vax)
                                                                                              [%wtgr [%wtts [%leaf %tas -.q.vax] [%& 2]~] [%$ 1]]
                                                                                              (~(fuse ut p.vax) [%cell %noun %noun])

                                                                                              ++swat

                                                                                              Deferred ++slap

                                                                                              This is the same as ++slap except tap is the subject vase encapsulated in a trap, and a (trap vase) is produced.

                                                                                              Accepts

                                                                                              tap is a (trap vase).

                                                                                              gen is hoon.

                                                                                              Produces

                                                                                              A (trap vase).

                                                                                              Source

                                                                                              ++ swat
                                                                                              |= [tap=(trap vase) gen=hoon]
                                                                                              ^- (trap vase)
                                                                                              =/ gun (~(mint ut p:$:tap) %noun gen)
                                                                                              |. ~+
                                                                                              [p.gun .*(q:$:tap q.gun)]

                                                                                              Examples

                                                                                              > %. 10
                                                                                              !< $-(@ @)
                                                                                              %- road
                                                                                              %+ swat
                                                                                              |.(!>(add-42=(cury add 42)))
                                                                                              (ream '|=([email protected] (add-42 a))')
                                                                                              52

                                                                                              <-

                                                                                              5b: Macro Expansion

                                                                                              5d: Parser

                                                                                              ->

                                                                                              Edit this page on GitHub

                                                                                              Last modified March 29, 2023