Documentation
¶
Overview ¶
Package sexp contains helper function to work with s-expression in an alien environment.
Index ¶
- Variables
- func CheckSymbol(obj sx.Object, name string) error
- func EncodeMetaRights(mr api.MetaRights) *sx.Pair
- func EncodeZettel(zettel api.ZettelData) sx.Object
- func ParseList(obj sx.Object, spec string) (sx.Vector, error)
- func ParseMeta(pair *sx.Pair) (api.ZettelMeta, error)
- func ParseRights(obj sx.Object) (api.ZettelRights, error)
- func ParseZettel(obj sx.Object) (api.ZettelData, error)
Constants ¶
This section is empty.
Variables ¶
ErrElementsMissing is returned, if ParseList is called with a list smaller than the number of type specifications.
ErrNoSpec is returned, if ParseList if called with a list greater than the number of type specifications.
Functions ¶
func CheckSymbol ¶
CheckSymbol ensures that the given object is a symbol with the given name.
func EncodeMetaRights ¶
func EncodeMetaRights(mr api.MetaRights) *sx.Pair
EncodeMetaRights translates metadata/rights into a sx object.
func EncodeZettel ¶
func EncodeZettel(zettel api.ZettelData) sx.Object
EncodeZettel transforms zettel data into a sx object.
func ParseList ¶
ParseList parses the given object as a proper list, based on a type specification.
'b' expects a boolean, 'i' an int64, 'o' any object, 'p' a pair, 's' a string, and 'y' expects a symbol. A 'r' as the last type spracification matches all remaining values, including a non existent object.
func ParseMeta ¶
func ParseMeta(pair *sx.Pair) (api.ZettelMeta, error)
ParseMeta translates the given list to metadata.
Types ¶
This section is empty.