Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v0 state

Back to all declarations

scenario

type

scenario is one fixed pair of documents, chosen to show one property.

Value

v0.scenario

scenarios

[]v0.scenario (len=4)

scenarios are deliberately fixed rather than caller-supplied: output that moves with the caller or the block height cannot be pinned by an example test, and this realm's whole job is to be comparable from one render to the next.

Open
OID
058620…8499:4
scenarios details (len=4)

+4 more Inspect slice

defaultContext

untyped bigint

Value

(2 <untyped> bigint)

maxContext

untyped bigint

Value

(6 <untyped> bigint)

realmPath

untyped string

Value

"/r/moul/x/daily/myersdiffdemo/v0"

Render

func(path string) string

Render implements the gnoweb view. - "" or "/" : the index, with every scenario summarized. - "/\<key>" : one scenario at the default context width. - "/\<key>/\<context>" : the same, with 0 to 6 lines of context.

Open
OID
058620…8499:9
Render details

Inspect func

parsePath

func(path string) (string, int)

parsePath returns the scenario key and the context width. It never returns anything it was handed: the key is matched against the table by the caller and the width is an integer, clamped.

Open
OID
058620…8499:11
parsePath details

Inspect func

renderScenario

func(sc v0.scenario, context int) string
Open
OID
058620…8499:13
renderScenario details

Inspect func

diffOf

func(sc v0.scenario) v0.Script
Open
OID
058620…8499:14
diffOf details

Inspect func

applies

func(sc v0.scenario, s v0.Script) bool

applies is the demo asserting the library's own claim rather than repeating it: the rendered answer comes from running Apply, not from a constant.

Open
OID
058620…8499:15
applies details

Inspect func
scenario : type =v0.scenario
scenarios : []v0.scenario (len=4) Inspect
defaultContext : untyped bigint =(2 <untyped> bigint)
maxContext : untyped bigint =(6 <untyped> bigint)
realmPath : untyped string ="/r/moul/x/daily/myersdiffdemo/v0"
Render : func(path string) string Inspect
parsePath : func(path string) (string, int) Inspect
renderIndex : func() string Inspect
renderScenario : func(sc v0.scenario, context int) string Inspect
diffOf : func(sc v0.scenario) v0.Script Inspect
applies : func(sc v0.scenario, s v0.Script) bool Inspect
lines : func(s string) []string Inspect
yesNo : func(b bool) string Inspect