Urbit
  • Introduction
  • Development

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

      • Arvo
      • Hoon
      • Nock
      • Vere
      • Azimuth
      • Cryptography
      • 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
                  • Ford

                    • Overview
                    • Gall

                      • Overview
                      • API Reference
                      • Data Types
                      • Iris

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

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

                            • Scries
                            • Subscriptions
                            • Tutorials

                              • Move Trace
                              • Reference

                                • Cryptography
                                • Filesystem Hierarchy
                              • Userspace

                                • Overview
                                • HTTP API Guide
                                • Gall Guide

                                  • Introduction
                                  • 1. Arvo
                                  • 2. The Agent Core
                                  • 3. Imports and Aliases
                                  • 4. Lifecycle
                                  • 5. Cards
                                  • 6. Pokes
                                  • 7. Structures and Marks
                                  • 8. Subscriptions
                                  • 9. Vanes
                                  • 10. Scries
                                  • 11. Failure
                                  • 12. Next Steps
                                  • Appendix: Types
                                  • Full-Stack Walkthrough

                                    • 1. Introduction
                                    • 2. Types
                                    • 3. Agent
                                    • 4. JSON
                                    • 5. Marks
                                    • 6. Eyre
                                    • 7. React app setup
                                    • 8. React app logic
                                    • 9. Desk and glob
                                    • 10. Summary
                                    • Graph Store

                                      • Graph Store Overview
                                      • Data Structure Overview
                                      • Validator Walkthrough
                                      • Sample Application: Library
                                      • Graph Store - Reference
                                      • Advanced Info
                                      • Threads

                                        • Overview
                                        • HTTP API
                                        • Reference
                                        • Basics

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

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

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

                                              • Overview
                                              • Guide
                                              • Docket File
                                              • Glob
                                              • Dojo Tools
                                            • Hoon

                                              • Overview
                                              • Hoon School

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

                                                  • CLI apps
                                                  • Parsing
                                                  • JSON
                                                  • Strings
                                                  • Sail (HTML)
                                                  • Writing Aqua Tests
                                                  • Reference

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

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

                                                        • Limbs
                                                        • Wings
                                                        • Standard library

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

                                                            • Table of Contents
                                                            • 2d(1-5): To JSON, Wains
                                                            • 2d(6): From JSON
                                                            • 2d(7): From JSON (unit)
                                                            • 2e(2-3): Print & Parse JSON
                                                        • 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

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

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

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

                                                                      • Overview
                                                                      • 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
                                                                                • Ford

                                                                                  • Overview
                                                                                  • Gall

                                                                                    • Overview
                                                                                    • API Reference
                                                                                    • Data Types
                                                                                    • Iris

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

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

                                                                                          • Scries
                                                                                          • Subscriptions
                                                                                          • Tutorials

                                                                                            • Move Trace
                                                                                            • Reference

                                                                                              • Cryptography
                                                                                              • Filesystem Hierarchy
                                                                                            • Userspace

                                                                                              • Overview
                                                                                              • HTTP API Guide
                                                                                              • Gall Guide

                                                                                                • Introduction
                                                                                                • 1. Arvo
                                                                                                • 2. The Agent Core
                                                                                                • 3. Imports and Aliases
                                                                                                • 4. Lifecycle
                                                                                                • 5. Cards
                                                                                                • 6. Pokes
                                                                                                • 7. Structures and Marks
                                                                                                • 8. Subscriptions
                                                                                                • 9. Vanes
                                                                                                • 10. Scries
                                                                                                • 11. Failure
                                                                                                • 12. Next Steps
                                                                                                • Appendix: Types
                                                                                                • Full-Stack Walkthrough

                                                                                                  • 1. Introduction
                                                                                                  • 2. Types
                                                                                                  • 3. Agent
                                                                                                  • 4. JSON
                                                                                                  • 5. Marks
                                                                                                  • 6. Eyre
                                                                                                  • 7. React app setup
                                                                                                  • 8. React app logic
                                                                                                  • 9. Desk and glob
                                                                                                  • 10. Summary
                                                                                                  • Graph Store

                                                                                                    • Graph Store Overview
                                                                                                    • Data Structure Overview
                                                                                                    • Validator Walkthrough
                                                                                                    • Sample Application: Library
                                                                                                    • Graph Store - Reference
                                                                                                    • Advanced Info
                                                                                                    • Threads

                                                                                                      • Overview
                                                                                                      • HTTP API
                                                                                                      • Reference
                                                                                                      • Basics

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

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

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

                                                                                                            • Overview
                                                                                                            • Guide
                                                                                                            • Docket File
                                                                                                            • Glob
                                                                                                            • Dojo Tools
                                                                                                          • Hoon

                                                                                                            • Overview
                                                                                                            • Hoon School

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

                                                                                                                • CLI apps
                                                                                                                • Parsing
                                                                                                                • JSON
                                                                                                                • Strings
                                                                                                                • Sail (HTML)
                                                                                                                • Writing Aqua Tests
                                                                                                                • Reference

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

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

                                                                                                                      • Limbs
                                                                                                                      • Wings
                                                                                                                      • Standard library

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

                                                                                                                          • Table of Contents
                                                                                                                          • 2d(1-5): To JSON, Wains
                                                                                                                          • 2d(6): From JSON
                                                                                                                          • 2d(7): From JSON (unit)
                                                                                                                          • 2e(2-3): Print & Parse JSON
                                                                                                                      • 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

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

                                                                                                                              Calls % ('cen')

                                                                                                                              The % family of runes is used for making 'function calls' in Hoon. To be more precise, these runes evaluate the $ arm in cores, usually after modifying the sample. (The default sample is replaced with the input values given in the call.)

                                                                                                                              These runes reduce to the %= rune.

                                                                                                                              %_ "cencab"

                                                                                                                              Resolve a wing with changes, preserving type.

                                                                                                                              Syntax

                                                                                                                              One fixed argument, then a variable number of pairs.

                                                                                                                              FormSyntax
                                                                                                                              Tall style #1
                                                                                                                              %_  a=wing
                                                                                                                                b=wing  c=hoon
                                                                                                                                d=wing  e=hoon
                                                                                                                                f=wing  g=hoon
                                                                                                                              ==
                                                                                                                              
                                                                                                                              Tall style #2
                                                                                                                              %_    a=wing
                                                                                                                                  b=wing
                                                                                                                                c=hoon
                                                                                                                              ::
                                                                                                                                  d=wing
                                                                                                                                e=hoon
                                                                                                                              ::
                                                                                                                                  f=wing
                                                                                                                                g=hoon
                                                                                                                              ==
                                                                                                                              
                                                                                                                              Wide
                                                                                                                              %_(a=wing b=wing c=hoon, d=wing e=hoon, ...)
                                                                                                                              
                                                                                                                              Irregular None.

                                                                                                                              AST

                                                                                                                              [%cncb p=wing q=(list (pair wing hoon))]
                                                                                                                              

                                                                                                                              Expands to

                                                                                                                              ^+(a %=(a b c, d e, ...))
                                                                                                                              

                                                                                                                              Semantics

                                                                                                                              A %_ expression resolves to the value of the subject at wing a, but modified according to a series of changes: b is replaced with the product of c, d with the product of e, and so on. At compile time a type check is performed to ensure that the resulting value is of the same type as a.

                                                                                                                              Discussion

                                                                                                                              %_ is different from %= because %= can change the type of a wing with mutations. %_ preserves the wing type.

                                                                                                                              See how wings are resolved.

                                                                                                                              Examples

                                                                                                                              > =foo [p=42 q=6]
                                                                                                                              
                                                                                                                              > foo(p %baz)
                                                                                                                              [p=%baz q=6]
                                                                                                                              
                                                                                                                              > foo(p [55 99])
                                                                                                                              [p=[55 99] q=6]
                                                                                                                              
                                                                                                                              > %_(foo p %baz)
                                                                                                                              [p=7.496.034 99]
                                                                                                                              
                                                                                                                              > %_(foo p [55 99])
                                                                                                                              ! nest-fail

                                                                                                                              %: "cencol"

                                                                                                                              Call a gate with many arguments.

                                                                                                                              Syntax

                                                                                                                              One fixed argument, then a variable number of arguments.

                                                                                                                              FormSyntax
                                                                                                                              Tall
                                                                                                                              %:  a=hoon
                                                                                                                                b=hoon
                                                                                                                                c=hoon
                                                                                                                                 ...
                                                                                                                                d=hoon
                                                                                                                              ==
                                                                                                                              
                                                                                                                              Wide
                                                                                                                              %:(a b c d)
                                                                                                                              
                                                                                                                              Irregular
                                                                                                                              (a b c d)
                                                                                                                              

                                                                                                                              AST

                                                                                                                              [%cncl p=hoon q=(list hoon)]
                                                                                                                              

                                                                                                                              Semantics

                                                                                                                              A %: expression calls a gate with many arguments. a is the gate to be called, and b through d are the arguments. If there is only one subexpression after a, its product is the sample. Otherwise, a single argument is constructed by evaluating all of b through d -- however many subexpressions there are -- and putting the result in a cell: [b c ... d].

                                                                                                                              Discussion

                                                                                                                              When %: is used in tall-form syntax, the series of expressions after p must be terminated with ==.

                                                                                                                              Examples

                                                                                                                              > %:  add  22  33  ==
                                                                                                                              55
                                                                                                                              
                                                                                                                              > =adder |=  a=*
                                                                                                                                       =+  c=0
                                                                                                                                       |-
                                                                                                                                       ?@  a  (add a c)
                                                                                                                                       ?^  -.a  !!
                                                                                                                                       $(c (add -.a c), a +.a)
                                                                                                                              
                                                                                                                              > %:  adder  22  33  44  ==
                                                                                                                              99
                                                                                                                              
                                                                                                                              > %:  adder  22  33  44  55  ==
                                                                                                                              154
                                                                                                                              
                                                                                                                              > %:(adder 22 33 44)
                                                                                                                              99
                                                                                                                              
                                                                                                                              > (adder 22 33 44)
                                                                                                                              99

                                                                                                                              %. "cendot"

                                                                                                                              Call a gate (function), inverted.

                                                                                                                              Syntax

                                                                                                                              Two arguments, fixed.

                                                                                                                              FormSyntax
                                                                                                                              Tall
                                                                                                                              %.  a  b
                                                                                                                              
                                                                                                                              Wide
                                                                                                                              %.(a b)
                                                                                                                              
                                                                                                                              Irregular None.

                                                                                                                              AST

                                                                                                                              [%cndt p=hoon q=hoon]
                                                                                                                              

                                                                                                                              Semantics

                                                                                                                              The %. rune is for evaluating the $ arm of a gate, i.e., calling a function. a is for the desired sample value (i.e., input value), and b is the gate.

                                                                                                                              Expands to

                                                                                                                              %-(b=hoon a=hoon)
                                                                                                                              

                                                                                                                              Discussion

                                                                                                                              %. is just like %-, but with its subexpressions reversed; the argument comes first, and then the gate.

                                                                                                                              Examples

                                                                                                                              > =add-triple |=([a=@ b=@ c=@] :(add a b c))
                                                                                                                              
                                                                                                                              > %.([1 2 3] add-triple)
                                                                                                                              6

                                                                                                                              %- "cenhep"

                                                                                                                              Call a gate (function).

                                                                                                                              Syntax

                                                                                                                              FormSyntax
                                                                                                                              Tall
                                                                                                                              %-  a
                                                                                                                              b
                                                                                                                              
                                                                                                                              Wide
                                                                                                                              %-(a b)
                                                                                                                              
                                                                                                                              Irregular
                                                                                                                              (a b)
                                                                                                                              

                                                                                                                              AST

                                                                                                                              [%cnhp p=hoon q=hoon]
                                                                                                                              

                                                                                                                              Semantics

                                                                                                                              This rune is for evaluating the $ arm of a gate, i.e., calling a gate as a function. a is the gate, and b is the desired sample value (i.e., input value) for the gate.

                                                                                                                              Expands to

                                                                                                                              %~($ a b)
                                                                                                                              

                                                                                                                              Discussion

                                                                                                                              %- is used to call a function; a is the function (gate, q the argument. %- is a special case of %~ ("censig"), and a gate is a special case of a door.

                                                                                                                              Examples

                                                                                                                              > =add-triple |=([a=@ b=@ c=@] :(add a b c))
                                                                                                                              
                                                                                                                              > (add-triple 1 2 3)
                                                                                                                              6
                                                                                                                              
                                                                                                                              > %-(add-triple [1 2 3])
                                                                                                                              6

                                                                                                                              %^ "cenket"

                                                                                                                              Call gate with triple sample.

                                                                                                                              Syntax

                                                                                                                              Four arguments, fixed.

                                                                                                                              FormSyntax
                                                                                                                              Tall
                                                                                                                              %^    a
                                                                                                                                  b
                                                                                                                                c
                                                                                                                              d
                                                                                                                              
                                                                                                                              Wide
                                                                                                                              %^(a b c d)
                                                                                                                              
                                                                                                                              Irregular
                                                                                                                              (a b c d)
                                                                                                                              

                                                                                                                              AST

                                                                                                                              [%cnkt p=hoon q=hoon r=hoon s=hoon]
                                                                                                                              

                                                                                                                              Expands to

                                                                                                                              %-(a=hoon [b=hoon c=hoon d=hoon])
                                                                                                                              

                                                                                                                              Examples

                                                                                                                              > =add-triple |=([a=@ b=@ c=@] :(add a b c))
                                                                                                                              
                                                                                                                              > %^(add-triple 1 2 3)
                                                                                                                              6

                                                                                                                              %+ "cenlus"

                                                                                                                              Call gate with a cell sample.

                                                                                                                              Syntax

                                                                                                                              Three arguments, fixed.

                                                                                                                              FormSyntax
                                                                                                                              Tall
                                                                                                                              %+  a
                                                                                                                                b
                                                                                                                              c
                                                                                                                              
                                                                                                                              Wide
                                                                                                                              %+(a b c)
                                                                                                                              
                                                                                                                              Irregular
                                                                                                                              (a b c)
                                                                                                                              

                                                                                                                              AST

                                                                                                                              [%cnls p=hoon q=hoon r=hoon]
                                                                                                                              

                                                                                                                              Semantics

                                                                                                                              A %+ expression is for calling a gate with a cell sample. a is the gate to be called, b is for the head of the sample, and c is for the sample tail.

                                                                                                                              Expands to

                                                                                                                              %-(a=hoon [b=hoon c=hoon])
                                                                                                                              

                                                                                                                              Examples

                                                                                                                              > =add-triple |=([a=@ b=@ c=@] :(add a b c))
                                                                                                                              
                                                                                                                              > %+(add-triple 1 [2 3])
                                                                                                                              6

                                                                                                                              %~ "censig"

                                                                                                                              Evaluate an arm in a door.

                                                                                                                              Syntax

                                                                                                                              Three arguments, fixed.

                                                                                                                              FormSyntax
                                                                                                                              Tall
                                                                                                                              %~  p  q
                                                                                                                              r
                                                                                                                              
                                                                                                                              Wide
                                                                                                                              %~(p q r)
                                                                                                                              
                                                                                                                              Irregular
                                                                                                                              ~(p q r1 r2 rn)
                                                                                                                              

                                                                                                                              In the irregular form, r may be split into multiple parts. Multiple parts of r will be formed into a cell.

                                                                                                                              Semantics

                                                                                                                              A %~ expression evaluates the arm of a door (i.e., a core with a sample). a is a wing that resolves to the arm from within the door in question. b is the door itself. c is the sample of the door.

                                                                                                                              Discussion

                                                                                                                              %~ is the general case of a function call, %-. In both, we replace the sample (+6) of a core. In %- the core is a gate and the $ arm is evaluated. In %~ the core is a door and any arm may be evaluated. You must identify the arm to be run: %~(arm door arg).

                                                                                                                              See also |_.

                                                                                                                              Examples

                                                                                                                              > =mycore |_  a=@
                                                                                                                                        ++  plus-two  (add 2 a)
                                                                                                                                        ++  double  (mul 2 a)
                                                                                                                                        --
                                                                                                                              
                                                                                                                              > ~(plus-two mycore 10)
                                                                                                                              12
                                                                                                                              
                                                                                                                              > ~(double mycore 10)
                                                                                                                              20

                                                                                                                              %* "centar"

                                                                                                                              Evaluate an expression, then resolve a wing with changes.

                                                                                                                              Syntax

                                                                                                                              Two fixed arguments, then a variable number of pairs.

                                                                                                                              FormSyntax
                                                                                                                              Tall style #1
                                                                                                                              %*  a=wing  b=hoon
                                                                                                                                c=wing  d=hoon
                                                                                                                                e=wing  f=hoon
                                                                                                                                     ...
                                                                                                                                g=wing  h=hoon
                                                                                                                              ==
                                                                                                                              
                                                                                                                              Tall style #2
                                                                                                                              %*    a=wing  b=hoon
                                                                                                                                  c=wing
                                                                                                                                d=hoon
                                                                                                                              ::
                                                                                                                                  e=wing
                                                                                                                                f=hoon
                                                                                                                              ::
                                                                                                                                  g=wing
                                                                                                                                h=hoon
                                                                                                                              ==
                                                                                                                              
                                                                                                                              Wide
                                                                                                                              %*(a b c d, e f, g h)
                                                                                                                              
                                                                                                                              IrregularNone.

                                                                                                                              AST

                                                                                                                              [%cntr p=wing q=hoon r=(list (pair wing hoon))]
                                                                                                                              

                                                                                                                              Semantics

                                                                                                                              A %* expression evaluates some arbitrary Hoon expression, b, and then resolves a wing of that result, with changes. a is the wing to be resolved, and one or more changes is defined by the subexpressions after b.

                                                                                                                              Expands to

                                                                                                                              =+  b=hoon
                                                                                                                              %=  a=wing
                                                                                                                                c=wing  d=hoon
                                                                                                                                e=wing  f=hoon
                                                                                                                                     ...
                                                                                                                                g=wing  h=hoon
                                                                                                                              ==
                                                                                                                              

                                                                                                                              Examples

                                                                                                                              > %*($ add a 2, b 3)
                                                                                                                              5
                                                                                                                              
                                                                                                                              > %*(b [a=[12 14] b=[c=12 d=44]] c 11)
                                                                                                                              [c=11 d=44]
                                                                                                                              
                                                                                                                              > %*(b [a=[12 14] b=[c=12 d=44]] c 11, d 33)
                                                                                                                              [c=11 d=33]
                                                                                                                              
                                                                                                                              > =foo [a=1 b=2 c=3 d=4]
                                                                                                                              
                                                                                                                              > %*(+ foo c %hello, d %world)
                                                                                                                              [b=2 c=%hello d=%world]
                                                                                                                              
                                                                                                                              > =+(foo=[a=1 b=2 c=3] foo(b 7, c 10))
                                                                                                                              [a=1 b=7 c=10]
                                                                                                                              
                                                                                                                              > %*(foo [foo=[a=1 b=2 c=3]] b 7, c 10)
                                                                                                                              [a=1 b=7 c=10]

                                                                                                                              %= "centis"

                                                                                                                              Resolve a wing with changes.

                                                                                                                              Syntax

                                                                                                                              One fixed argument, then a variable number of pairs.

                                                                                                                              FormSyntax
                                                                                                                              Tall style #1
                                                                                                                              %=  a=wing
                                                                                                                                b=wing  c=hoon
                                                                                                                                d=wing  e=hoon
                                                                                                                                     ...
                                                                                                                                f=wing  g=hoon
                                                                                                                              ==
                                                                                                                              
                                                                                                                              Tall style #2
                                                                                                                              %=    a=wing
                                                                                                                                  b=wing
                                                                                                                                c=hoon
                                                                                                                              ::
                                                                                                                                  d=wing
                                                                                                                                e=hoon
                                                                                                                              ::
                                                                                                                                  f=wing
                                                                                                                                g=hoon
                                                                                                                              ==
                                                                                                                              
                                                                                                                              Wide
                                                                                                                              %=(a b c, d e, f g)
                                                                                                                              
                                                                                                                              Irregular
                                                                                                                              a(b c, d e, f g)
                                                                                                                              

                                                                                                                              AST

                                                                                                                              [%cnts p=wing q=(list (pair wing hoon))]
                                                                                                                              

                                                                                                                              Semantics

                                                                                                                              A %= expression resolves a wing of the subject, but with changes made.

                                                                                                                              If a resolves to a leg, a series of changes are made to wings of that leg (b, d, and f above are replaced with the respective products of c, e, and g above). The modified leg is returned.

                                                                                                                              If a resolves to an arm, a series of changes are made to wings of the parent core of that arm. (Again, b, d, and f are replaced with the respective products of c, e, and g.) The arm is computed with the modified core as the subject, and the product is returned.

                                                                                                                              Discussion

                                                                                                                              Note that a is a wing, not just any expression. Knowing that a function call (foo baz) involves evaluating foo, replacing its sample at slot +6 with baz, and then resolving to the $ limb, you might think (foo baz) would mean %=(foo +6 baz).

                                                                                                                              But it's actually =+(foo =>(%=(+2 +6 baz) $)). Even if foo is a wing, we would just be mutating +6 within the core that defines the foo arm. Instead we want to modify the product of foo -- the gate -- so we have to pin it into the subject.

                                                                                                                              Here's that again in tall form:

                                                                                                                              =+  foo
                                                                                                                              =>  %=  +2
                                                                                                                                    +6  baz
                                                                                                                                  ==
                                                                                                                                $
                                                                                                                              

                                                                                                                              Examples

                                                                                                                              > =foo [p=5 q=6]
                                                                                                                              
                                                                                                                              > foo(p 42)
                                                                                                                              [p=42 q=6]
                                                                                                                              
                                                                                                                              > foo(+3 99)
                                                                                                                              [p=5 99]

                                                                                                                              <-

                                                                                                                              Cells : ('col')

                                                                                                                              Casts ^ ('ket')

                                                                                                                              ->

                                                                                                                              Edit this page on GitHub