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/Standard library

                                                                                                                              4c: Tank Printer

                                                                                                                              ++wash

                                                                                                                              Render tank at width

                                                                                                                              Render tac with indent tab and maximum width edg. If tac cannot be rendered in-line in less than tac characters, it will be split into multiple lines if possible. If tac cannot be made to fit, wash will crash.

                                                                                                                              Accepts

                                                                                                                              [tab=@ edg=@] - tab is the number of characters of indentation and edge is the maximum number of characters of width.

                                                                                                                              tac is a tank.

                                                                                                                              Produces

                                                                                                                              A wall (list of tapes).

                                                                                                                              Source

                                                                                                                              ++  wash
                                                                                                                                |=  [[tab=@ edg=@] tac=tank]  ^-  wall
                                                                                                                                (~(win re tac) tab edg)
                                                                                                                              

                                                                                                                              Examples

                                                                                                                              > =rose `tank`[%rose [" " "[" "]"] ~['abc' 'def' 'ghi']]
                                                                                                                              
                                                                                                                              > ((slog (crip (of-wall:format (wash [0 80] rose))) ~) ~)
                                                                                                                              [abc def ghi]
                                                                                                                              
                                                                                                                              
                                                                                                                              > ((slog (crip (of-wall:format (wash [0 8] rose))) ~) ~)
                                                                                                                              [ abc
                                                                                                                                def
                                                                                                                                ghi
                                                                                                                              ]
                                                                                                                              
                                                                                                                              > ((slog (crip (of-wall:format (wash [3 15] rose))) ~) ~)
                                                                                                                                 [ abc
                                                                                                                                   def
                                                                                                                                   ghi
                                                                                                                                 ]

                                                                                                                              ++re

                                                                                                                              Pretty-printing engine

                                                                                                                              Container core for a pretty-printing engine that accepts a tank sample and contains arms that perform computation on it.

                                                                                                                              Accepts

                                                                                                                              tac is a tank.

                                                                                                                              Source

                                                                                                                              ++  re
                                                                                                                                |_  tac=tank
                                                                                                                              

                                                                                                                              ++ram:re

                                                                                                                              Flatten to tape

                                                                                                                              Flatten tank out into a tape.

                                                                                                                              Accepts

                                                                                                                              tac is a tank, taken from sample of ++re core.

                                                                                                                              Produces

                                                                                                                              A tape.

                                                                                                                              Source

                                                                                                                              ++  ram
                                                                                                                                ^-  tape
                                                                                                                                ?@  tac
                                                                                                                                  (trip tac)
                                                                                                                                ?-    -.tac
                                                                                                                                    %leaf  p.tac
                                                                                                                                ::
                                                                                                                                ::  flat %palm rendered as %rose with welded openers
                                                                                                                                ::
                                                                                                                                    %palm
                                                                                                                                  =*  mid  p.p.tac
                                                                                                                                  =*  for  (weld q.p.tac r.p.tac)
                                                                                                                                  =*  end  s.p.tac
                                                                                                                                  ram(tac [%rose [mid for end] q.tac])
                                                                                                                                ::
                                                                                                                                ::  flat %rose rendered with open/mid/close
                                                                                                                                ::
                                                                                                                                    %rose
                                                                                                                                  =*  mid  p.p.tac
                                                                                                                                  =*  for  q.p.tac
                                                                                                                                  =*  end  r.p.tac
                                                                                                                                  =*  lit  q.tac
                                                                                                                                  %+  weld
                                                                                                                                    for
                                                                                                                                  |-  ^-  tape
                                                                                                                                  ?~  lit
                                                                                                                                    end
                                                                                                                                  %+  weld
                                                                                                                                    ram(tac i.lit)
                                                                                                                                  =*  voz  $(lit t.lit)
                                                                                                                                  ?~(t.lit voz (weld mid voz))
                                                                                                                                ==
                                                                                                                              

                                                                                                                              Examples

                                                                                                                              > ~(ram re leaf+"foo")
                                                                                                                              "foo"
                                                                                                                              
                                                                                                                              > ~(ram re [%rose [" " "[" "]"] ~['abc' 'def' 'ghi']])
                                                                                                                              "[abc def ghi]"

                                                                                                                              ++win:re

                                                                                                                              Render at indent

                                                                                                                              Render at indent level tab and width edg.

                                                                                                                              Accepts

                                                                                                                              tac is a tank, taken from sample of ++re core.

                                                                                                                              tab and edg are atoms.

                                                                                                                              Produces

                                                                                                                              A wall (list of tape).

                                                                                                                              Source

                                                                                                                              ++  win
                                                                                                                                |=  [tab=@ud edg=@ud]
                                                                                                                                ::  output stack
                                                                                                                                ::
                                                                                                                                =|  lug=wall
                                                                                                                                |^  ^-  wall
                                                                                                                                    ?@  tac
                                                                                                                                      (rig (trip tac))
                                                                                                                                    ?-    -.tac
                                                                                                                                        %leaf  (rig p.tac)
                                                                                                                                    ::
                                                                                                                                        %palm
                                                                                                                                      =/  hom  ram
                                                                                                                                      ?:  (lte (lent hom) (sub edg tab))
                                                                                                                                        (rig hom)
                                                                                                                                      ::
                                                                                                                                      =*  for  q.p.tac
                                                                                                                                      =*  lit  q.tac
                                                                                                                                      ?~  lit
                                                                                                                                        (rig for)
                                                                                                                                      ?~  t.lit
                                                                                                                                        =:  tab  (add 2 tab)
                                                                                                                                            lug  $(tac i.lit)
                                                                                                                                          ==
                                                                                                                                        (rig for)
                                                                                                                                      ::
                                                                                                                                      =>  .(lit `(list tank)`lit)
                                                                                                                                      =/  lyn  (mul 2 (lent lit))
                                                                                                                                      =.  lug
                                                                                                                                        |-  ^-  wall
                                                                                                                                        ?~  lit
                                                                                                                                          lug
                                                                                                                                        =/  nyl  (sub lyn 2)
                                                                                                                                        %=  ^$
                                                                                                                                          tac  i.lit
                                                                                                                                          tab  (add tab nyl)
                                                                                                                                          lug  $(lit t.lit, lyn nyl)
                                                                                                                                        ==
                                                                                                                                      (wig for)
                                                                                                                                    ::
                                                                                                                                        %rose
                                                                                                                                      =/  hom  ram
                                                                                                                                      ?:  (lte (lent hom) (sub edg tab))
                                                                                                                                        (rig hom)
                                                                                                                                      ::
                                                                                                                                      =*  for  q.p.tac
                                                                                                                                      =*  end  r.p.tac
                                                                                                                                      =*  lit  q.tac
                                                                                                                                      =.  lug
                                                                                                                                        |-  ^-  wall
                                                                                                                                        ?~  lit
                                                                                                                                          ?~(end lug (rig end))
                                                                                                                                        %=  ^$
                                                                                                                                          tac  i.lit
                                                                                                                                          tab  (mod (add 2 tab) (mul 2 (div edg 3)))
                                                                                                                                          lug  $(lit t.lit)
                                                                                                                                        ==
                                                                                                                                      ?~(for lug (wig for))
                                                                                                                                    ==
                                                                                                                                ::  +rig: indent tape and cons with output stack
                                                                                                                                ::
                                                                                                                                ++  rig
                                                                                                                                  |=  hom=tape
                                                                                                                                  ^-  wall
                                                                                                                                  [(runt [tab ' '] hom) lug]
                                                                                                                                ::  +wig: indent tape and cons with output stack
                                                                                                                                ::
                                                                                                                                ::    joined with the top line if whitespace/indentation allow
                                                                                                                                ::
                                                                                                                                ++  wig
                                                                                                                                  |=  hom=tape
                                                                                                                                  ^-  wall
                                                                                                                                  ?~  lug
                                                                                                                                    (rig hom)
                                                                                                                                  =/  wug  :(add 1 tab (lent hom))
                                                                                                                                  ?.  =+  mir=i.lug
                                                                                                                                      |-  ^-  ?
                                                                                                                                      ?~  mir  |
                                                                                                                                      ?|  =(0 wug)
                                                                                                                                          ?&(=(' ' i.mir) $(mir t.mir, wug (dec wug)))
                                                                                                                                      ==
                                                                                                                                    (rig hom)       :: ^ XX regular form?
                                                                                                                                  :_  t.lug
                                                                                                                                  %+  runt  [tab ' ']
                                                                                                                                  (weld hom `tape`[' ' (slag wug i.lug)])
                                                                                                                                --
                                                                                                                              

                                                                                                                              Examples

                                                                                                                              > =rose `tank`[%rose [" " "[" "]"] ~['abc' 'def' 'ghi']]
                                                                                                                              
                                                                                                                              > ((slog (crip (of-wall:format (~(win re rose) 0 80))) ~) ~)
                                                                                                                              [abc def ghi]
                                                                                                                              
                                                                                                                              > ((slog (crip (of-wall:format (~(win re rose) 3 80))) ~) ~)
                                                                                                                                 [abc def ghi]
                                                                                                                              
                                                                                                                              > ((slog (crip (of-wall:format (~(win re rose) 0 10))) ~) ~)
                                                                                                                              [ abc
                                                                                                                                def
                                                                                                                                ghi
                                                                                                                              ]
                                                                                                                              
                                                                                                                              > ((slog (crip (of-wall:format (~(win re rose) 3 15))) ~) ~)
                                                                                                                                 [ abc
                                                                                                                                   def
                                                                                                                                   ghi
                                                                                                                                 ]

                                                                                                                              ++show

                                                                                                                              Pretty-printer (deprecated)

                                                                                                                              Pretty prints noun vem, producing a tank. This function is deprecated and in most cases produces outdated syntax or incorrect results.

                                                                                                                              Accepts

                                                                                                                              vem is a noun.

                                                                                                                              Produces

                                                                                                                              A tank.

                                                                                                                              Source

                                                                                                                              ++  show
                                                                                                                                |=  vem=*
                                                                                                                                |^  ^-  tank
                                                                                                                                    ?:  ?=(@ vem)
                                                                                                                                      [%leaf (mesc (trip vem))]
                                                                                                                                    ?-    vem
                                                                                                                                        [s=~ c=*]
                                                                                                                                      [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
                                                                                                                                    ::
                                                                                                                                        [s=%a c=@]        [%leaf (mesc (trip c.vem))]
                                                                                                                                        [s=%b c=*]        (shop c.vem |=(a=@ ~(rub at a)))
                                                                                                                                        [s=[%c p=@] c=*]
                                                                                                                                      :+  %palm
                                                                                                                                        [['.' ~] ['-' ~] ~ ~]
                                                                                                                                      [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
                                                                                                                                    ::
                                                                                                                                        [s=%d c=*]        (shop c.vem |=(a=@ ~(rud at a)))
                                                                                                                                        [s=%k c=*]        (tank c.vem)
                                                                                                                                        [s=%h c=*]
                                                                                                                                      :+  %rose
                                                                                                                                        [['/' ~] ['/' ~] ~]
                                                                                                                                      =+  yol=((list @ta) c.vem)
                                                                                                                                      (turn yol |=(a=@ta [%leaf (trip a)]))
                                                                                                                                    ::
                                                                                                                                        [s=%l c=*]        (shol c.vem)
                                                                                                                                        [s=%o c=*]
                                                                                                                                      %=    $
                                                                                                                                          vem
                                                                                                                                        :-  [%m '%h::[%d %d].[%d %d]>']
                                                                                                                                        [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
                                                                                                                                      ==
                                                                                                                                    ::
                                                                                                                                        [s=%p c=*]        (shop c.vem |=(a=@ ~(rup at a)))
                                                                                                                                        [s=%q c=*]        (shop c.vem |=(a=@ ~(r at a)))
                                                                                                                                        [s=%r c=*]        $(vem [[%r ' ' '{' '}'] c.vem])
                                                                                                                                        [s=%t c=*]        (shop c.vem |=(a=@ ~(rt at a)))
                                                                                                                                        [s=%v c=*]        (shop c.vem |=(a=@ ~(ruv at a)))
                                                                                                                                        [s=%x c=*]        (shop c.vem |=(a=@ ~(rux at a)))
                                                                                                                                        [s=[%m p=@] c=*]  (shep p.s.vem c.vem)
                                                                                                                                        [s=[%r p=@] c=*]
                                                                                                                                      $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
                                                                                                                                    ::
                                                                                                                                        [s=[%r p=@ q=@ r=@] c=*]
                                                                                                                                      :+  %rose
                                                                                                                                        :*  p=(mesc (trip p.s.vem))
                                                                                                                                            q=(mesc (trip q.s.vem))
                                                                                                                                            r=(mesc (trip r.s.vem))
                                                                                                                                        ==
                                                                                                                                      |-  ^-  (list tank)
                                                                                                                                      ?@  c.vem
                                                                                                                                        ~
                                                                                                                                      [^$(vem -.c.vem) $(c.vem +.c.vem)]
                                                                                                                                    ::
                                                                                                                                        [s=%z c=*]        $(vem [[%r %$ %$ %$] c.vem])
                                                                                                                                        *                 !!
                                                                                                                                    ==
                                                                                                                                ++  shep
                                                                                                                                  |=  [fom=@ gar=*]
                                                                                                                                  ^-  tank
                                                                                                                                  =+  l=(met 3 fom)
                                                                                                                                  =+  i=0
                                                                                                                                  :-  %leaf
                                                                                                                                  |-  ^-  tape
                                                                                                                                  ?:  (gte i l)
                                                                                                                                    ~
                                                                                                                                  =+  c=(cut 3 [i 1] fom)
                                                                                                                                  ?.  =(37 c)
                                                                                                                                    (weld (mesc [c ~]) $(i +(i)))
                                                                                                                                  =+  d=(cut 3 [+(i) 1] fom)
                                                                                                                                  ?.  .?(gar)
                                                                                                                                    ['\\' '#' $(i (add 2 i))]
                                                                                                                                  (weld ~(ram re (show d -.gar)) $(i (add 2 i), gar +.gar))
                                                                                                                                ::
                                                                                                                                ++  shop
                                                                                                                                  |=  [aug=* vel=$-(a=@ tape)]
                                                                                                                                  ^-  tank
                                                                                                                                  ?:  ?=(@ aug)
                                                                                                                                    [%leaf (vel aug)]
                                                                                                                                  :+  %rose
                                                                                                                                    [[' ' ~] ['[' ~] [']' ~]]
                                                                                                                                  =>  .(aug `*`aug)
                                                                                                                                  |-  ^-  (list tank)
                                                                                                                                  ?:  ?=(@ aug)
                                                                                                                                    [^$ ~]
                                                                                                                                  [^$(aug -.aug) $(aug +.aug)]
                                                                                                                                ::
                                                                                                                                ++  shol
                                                                                                                                  |=  lim=*
                                                                                                                                  :+  %rose
                                                                                                                                    [['.' ~] ~ ~]
                                                                                                                                  |-    ^-  (list tank)
                                                                                                                                  ?:  ?=(@ lim)  ~
                                                                                                                                  :_  $(lim +.lim)
                                                                                                                                  ?+  -.lim  (show '#')
                                                                                                                                      ~   (show '$')
                                                                                                                                      c=@  (show c.lim)
                                                                                                                                      [%& %1]  (show '.')
                                                                                                                                      [%& c=@]
                                                                                                                                    [%leaf '+' ~(rud at c.lim)]
                                                                                                                                  ::
                                                                                                                                      [%| @ ~]  (show ',')
                                                                                                                                      [%| n=@ ~ c=@]
                                                                                                                                    [%leaf (weld (reap n.lim '^') ?~(c.lim "$" (trip c.lim)))]
                                                                                                                                  ==
                                                                                                                                --
                                                                                                                              

                                                                                                                              <-

                                                                                                                              4b: Text Processing

                                                                                                                              4d: Parsing (Tracing)

                                                                                                                              ->

                                                                                                                              Edit this page on GitHub