DelveTalkcome in

Inspecting kind/garden · the kinds · the language · the modules

{name}

Go there its page the town

id
kind/garden
called
{name}
kind chain
kind/garden → record
owner
the town
made by
the town
version
5
pin
jivuk-zafof
state
6718 bytes

Its spells

  • makedelvetalk kind/garden make / name: <text, 1 to 64 characters>
    its Bend

To cast them, come in.

Who may do what

What its law admits now, before the spell's own Bend has its say.

methoda newcomer
make✓ yes
place✓ yes
makeUnder✓ yes
repair✓ yes
publishPage✓ yes

Its law

  • host opener the hand that opened the world may amend any lawrequest.kind == 2 and request.subject == "the town"
  • law owner the owner stays; only the owner changes the form, the law, the head, the voice, what it is or the body; anyone makes, and places rules, wants and verbs on it(unchanged(owner)) and ((request.subject == new.owner) or ((((((((request.kind == 0) or (request.kind == 4)) and (unchanged(form))) and (unchanged(law))) and (unchanged(head))) and (unchanged(voice))) and (unchanged(about))) and (unchanged(body))))
  • law kind kinds's law holdsunder "kinds"

Its Bend

what it runs: its entry module 16 lines
layer over ./Kind.obend
edition ObjectiveBend 1
import ./Abi.obend as Abi
import ./List.obend as Lists
import ./Form.obend as Form
import ./Rows.obend as Rows
type State = Super.State
form make:
  name: text 1..64
def make(state: State, input: MakeInput, context: Abi.Context) -> Activity<Super.Done>:
  Super.making(state, Lists.List.cons({head: {name: "name", value: input.name}, tail: Lists.List.nil()}), "", context)
form place:
  name: text 1..64
  id: text 1..64
def place(state: State, input: PlaceInput, context: Abi.Context) -> Activity<Super.Done>:
  Super.making(state, Lists.List.cons({head: {name: "name", value: input.name}, tail: Lists.List.cons({head: {name: "id", value: input.id}, tail: Lists.List.nil()})}), "", context)
the body this kind lays on what it makes 106 lines

Each thing of this kind runs this layer over what the kind is of.

set it in type, all 106 lines

Amend it in the workshop

Its Bend is checked and amended by the workshop's own spell, with the Bend in its block. To send it, come in; the box is here then.

Its fields

owner
the town
ownerHandle
the town
name
garden
of
record
form
name: text 1..64
law
want five "a garden of fewer than five bells": count(new.things) <= 4 asks delvetalk {request.object} plant
head
{name}
voice
green shade; things grow here at their own pace, changed not in kind but in degree
about
plants bells and digs cisterns
body
layer over ./Record.obend (6292 characters)
layer over ./Record.obend
edition ObjectiveBend 1
import ./Abi.obend as Abi
import ./List.obend as Lists
import ./Document.obend as Document
import ./Form.obend as Form
import ./Plan.obend as Plans
import ./Card.obend as Card
import ./World.obend as World
import ./Scenes.obend as Scenes
import ./Relation.obend as Relations
import ./Rows.obend as Rows
import ./Text.obend as Text
# The garden's body, over RECORD (docs/METAPHYSICS.md §7.2): a record that makes bells and
# cisterns under itself (`makes`: kind/bell, kind/cistern) and holds what it made among its
# `things`, newest first on its card. `plant` and `dig` are make by another word: each hands its
# fields to the kind (Record.making), which makes garden/<kind>/<n> with a door home. The weather
# the garden cites writes its `weather` line, shown under the head; it rains while the garden is
# tended, and planting or digging tends it.
type State = Super.State
form plant:
  colour: Rows.Colour
  seed: text 1..80
form dig:
  name: text 0..120
form write:
  text: text 1..280
form chime:
form lines:
  from: natural 0..1000000000
form door:
  label: text 1..32
  to: text 1..128
form undoor:
  label: text 1..32
def makes(state: State) -> Lists.List<String>:
  Text.words("kind/bell kind/cistern")
def colourName(c: Rows.Colour) -> String:
  match c:
    case red(_): "red"
    case orange(_): "orange"
    case yellow(_): "yellow"
    case green(_): "green"
    case cyan(_): "cyan"
    case blue(_): "blue"
    case violet(_): "violet"
    case amber(_): "amber"
    case silver(_): "silver"
    case magenta(_): "magenta"
    case purple(_): "purple"
    case pink(_): "pink"
# "an amber bell", "a green bell".
def article(colour: String) -> String:
  if colour == "amber" || colour == "orange" then "an" else "a"
def fieldOf(name: String, value: String) -> Rows.Field:
  {name: name, value: value}
# The planter is the turn's principal (the kind seeds it as the bell's maker); a planting tends the
# garden, which is what its weather reads; the card says where it grew and how to rain on it.
def plant(state: State, input: PlantInput, context: Abi.Context) -> Activity<Super.Made>:
  Super.making(state, "kind/bell", Lists.append(Lists.append(Lists.List.nil(), fieldOf("colour", colourName(input.colour))), fieldOf("seed", input.seed)), context, fn(object: String) -> Document.Document: planted(object, colourName(input.colour), input.seed, Relations.count(state.things) + 1n, context), fn(m: Super.Made) -> Super.Made: m)
def dig(state: State, input: DigInput, context: Abi.Context) -> Activity<Super.Made>:
  Super.making(state, "kind/cistern", Lists.List.nil(), context, dug, fn(m: Super.Made) -> Super.Made: m)
def planted(object: String, colour: String, seed: String, count: Nat, context: Abi.Context) -> Document.Document:
  Document.text("Planted, {Card.name(context.principal, context)}: {article(colour)} {colour} bell, “{seed}”, at {object}; {natText(count)} planted.\nRain on it:\n\n    delvetalk {object} rain\n    text: <1 to 200 characters>\n\nAnother:\n\n{plantSpell(Card.called(context, \"garden\"))}")
def dug(object: String) -> Document.Document:
  Document.text("The cistern is dug at {object}; it takes refusals.\n")
def plantSpell(id: String) -> String:
  "    delvetalk {id} plant\n    seed: <what might grow here, 1 to 80 characters>\n    colour: <red to violet, silver, magenta, purple or pink>\n"
def write(state: State, input: WriteInput, context: Abi.Context) -> Activity<Nat>:
  Super.write(state, {text: input.text}, context)
# Its bells rung together (RECORD's `ringTogether`): every bell it planted, the first sixteen.
def chime(state: State, context: Abi.Context) -> Activity<Nat>:
  Super.ringTogether(state, context)
def lines(state: State, input: LinesInput, context: Abi.Context) -> Activity<Card.Replied>:
  Super.lines(state, {from: input.from}, context)
def door(state: State, input: DoorInput, context: Abi.Context) -> Activity<Card.Replied>:
  Super.door(state, {label: input.label, to: input.to}, context)
def undoor(state: State, input: UndoorInput, context: Abi.Context) -> Activity<Card.Replied>:
  Super.undoor(state, {label: input.label}, context)
def actions(state: State, context: Abi.Context) -> Lists.List<String>:
  if context.principal == state.owner then Text.words("plant dig chime lines door undoor") else Text.words("plant dig chime lines")
# Derived views (`viewDerived {object, view}`): what grows here, by kind, one row a kind.
def views() -> Lists.List<String>:
  Text.words("byKind")
record Tally:
  kind: String
  count: Nat
def byKind(state: State, context: Abi.Context) -> Relations.Relation<Tally>:
  Relations.Relation.rows({items: Lists.map(Relations.group(state.things, fn(t: Plans.Reference) -> String: kindIn(t.object)), fn(g: Relations.Group<Plans.Reference, String>) -> Tally: {kind: Relations.groupKey(g), count: Lists.length(Relations.groupRows(g))})})
# garden/bell/3 is a bell: the segment before the number.
def kindIn(id: String) -> String:
  let rest = textDrop(id, textBreak(id, "/") + 1n)
  textTake(rest, textBreak(rest, "/"))
# The head: the garden's name, its weather, the count, the plant spell and what comes back; then
# what grows here, newest first, within the card's room.
def headLine(state: State, context: Abi.Context, id: String) -> Document.Document:
  let title = if state.head == "" then "A GARDEN" else state.head
  let weather = if state.weather == "" then "" else "Weather: {state.weather}\n"
  Document.text("✾ {title}\n\n{weather}{natText(Relations.count(state.things))} planted. Plant one:\n\n{plantSpell(id)}\n» a bell, {id}/bell/N; its colour is its tone. Or words; what is read is planted.\n{Super.chimed(state, id)}\nNewest first:\n")
def thingLine(t: Plans.Reference) -> Document.Document:
  Document.text("- {t.object}\n")
def render(state: State, context: Abi.Context) -> Document.Document:
  let id = Card.called(context, "garden")
  let head = headLine(state, context, id)
  let doors = Card.doorLines(state.cites)
  Document.Document.sequence({items: Document.Documents.cons({head: head, tail: Lists.concat(Card.clippedWithin(Lists.map(Lists.reverse(Relations.rows(state.things)), thingLine), 8n, Card.left(context, Document.size(head) + Document.size(Document.Document.sequence({items: doors})))), doors)})})
made
1 rows
  1. object
    garden/1
    n
    1
    about
    empty
count
1