jolly.core

Fns for converting Grimoire data stores to Grenada Things.

determine-aspects

(determine-aspects grim-meta)
Given a map of metadata as read from a Grimoire data store, returns the
appropriate Grenada Aspects for them.

get-all-coords

(get-all-coords grim-thing)
Given a Grimoire Thing, returns its coordinates.

This isn't as easy as in Grenada, because we have to traverse the Grimoire
Thing graph.

grim-t->gren-t-with-bars

(grim-t->gren-t-with-bars lib-grim-config grim-t)
Returns the corresponding Grenada thing for the Grimoire Thing GRIM-T,
reading data from the data store configured in LIB-GRIM-CONFIG.

Cmetadata Bars from the Cmetadata of the Grimoire Thing are attached as
Grenada Bars. Their validity is checked if the definitions of their types are
contained in grenada.bars or poomoo.bars. Bars of unknown type are
attached, but not checked. This will be improved in a visible future.

If the metadata for GRIM-T tell that it is a sentinel, return nil. Sentinels
are Grimoire Things that refer to other Things, because they're not really
Things, but syntax, like the 'catch' in a (try …) form. I don't want these to
be Grenada Things.

grim-tag->gren-tag

Maps Grimoire Thing tags to Grenada Main Aspect names.

grim-thing->gren-thing

multimethod

Converts Grimoire metadata and Thing to a Grenada Thing.

grim-ts->gren-ts-with-bars

(grim-ts->gren-ts-with-bars lib-grim-config grim-ts)
Converts all Grimoire Things in GRIM-TS into Grenada Things, skipping the
ones for which grim-t->gren-ts-with-bars returns nil.

maybe-attach

(maybe-attach bar-type-tag grim-sths gren-thing)
Attaches Grimoire examples or notes (GRIM-STHS) to GREN-THING as a Bar of the
type with name BAR-TYPE-TAG.

If GRIM-STHS is empty, attaches nothing.

sths … somethings

read-all-things

Reads all Things it can find in the Grimoire data store denoted by
LIB-GRIM-CONFIG.

read-examples

(read-examples config thing)
Reads and returns the examples for Grimoire THING from the datastore denoted
by CONFIG.

Returns an empty collection if no examples are found.

CONFIG is a :grimoire.api.fs/Config Tmap.

read-notes

(read-notes config thing)
Reads and returns the notes for Grimoire THING from the datastore denoted by
CONFIG.

CONFIG is a :grimoire.api.fs/Config Tmap.