GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Try online
  • GitLab
  • GitHub

This view

  • Original page
  • New address

GeezerVison is showing urn-lang.com — compiler/pattern | Urn

compiler/pattern

(match ptrn expr)

Defined at lib/compiler/pattern.lisp:107:2

Determine whether EXPR matches the provided pattern PTRN, returning nil or a lookup of capture names to captured expressions.

(matcher ptrn)

Macro defined at lib/compiler/pattern.lisp:117:2

Create a matcher for the given pattern literal PTRN.

This is intended for views case expressions.

(matches? ptrn expr)

Defined at lib/compiler/pattern.lisp:113:2

Determine whether EXPR matches the provided pattern PTRN.

(pattern ptrn)

Macro defined at lib/compiler/pattern.lisp:44:2

Quote the provided pattern PTRN, suitable for matching with i matches?.

This provides several “magic” symbol prefixes to aid matching:

  • ? marks a metavar, and will be captured. If the second character is &, then this will capture zero or more values.

  • % marks a genvar, which will result in a randomly generated symbol being used in substitutions.

  • $ marks a fullvar, where one can provide the full name to a variable. Use of this is discouraged and should only be used if you really need to detect hidden symbols.

Undocumented symbols

  • (match-always ptrn expr) Defined at lib/compiler/pattern.lisp:124:2

Tutorial

  • An Introduction to Urn
  • Guess the number
  • Finding errors
  • Macros and more
  • How do I do X?
  • Integrating with Lua
  • The compiler API

Reference

  • Syntax
  • Special forms
  • CLI
  • The REPL

Recent News

  • Version 0.7.0 released
  • Version 0.6.1 released
  • Version 0.6.0 released

All libraries

  • Symbol index
  • compiler/helpers
  • compiler
  • compiler/nodes
  • compiler/optimise
  • compiler/pass
  • compiler/pattern
  • compiler/resolve
  • control/comparison
  • control/prompt
  • control/setq
  • core/base
  • core/binders
  • core/demand
  • core/list
  • core/match
  • core/method
  • core/prelude
  • core/string
  • core/symbol
  • core/table
  • core/type
  • data/alist
  • data/bitset
  • data/format
  • data/function
  • data/graph
  • data/set
  • data/struct
  • io/argparse
  • io/foreign
  • io
  • io/term
  • lua/basic
  • lua/bit32
  • lua/coroutine
  • lua/debug
  • lua/io
  • lua/math
  • lua/os
  • lua/package
  • lua/string
  • lua/table
  • lua/utf8
  • luajit/bit
  • luajit/ffi
  • luajit/jit
  • math/bignum
  • math/bit32
  • math/complex
  • math
  • math/matrix
  • math/numerics
  • math/rational
  • math/vector
  • prelude
  • test/assert
  • test/check
  • test
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.