changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/obj/cfg.lisp

changeset 698: 96958d3eb5b0
parent: d3e2829521a3
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 ;;; obj/cfg.lisp --- Configuration flavors
2 
3 ;;
4 
5 ;;; Commentary:
6 ;; The goal of this package is to make it easy to map an object in
7 ;; memory to a 'user config interface' - which could be a
8 ;; configuration file, a datagram, CLI flags, etc.
9 ;;
10 ;; This package only provides the CFG protocol, for other packages to
11 ;; consume.
12 
13 ;;; Usage:
14 #|
15 |#
16 ;;; Code:
17 (in-package :obj/cfg)
18 (defclass cfg ()
19  ())
20 
21 (defgeneric make-cfg (obj &rest args &key &allow-other-keys))
22 (defgeneric find-cfg (obj &rest args &key &allow-other-keys))
23 (defgeneric cfg-find (obj key &key &allow-other-keys))
24 (defgeneric cfg-get (obj key))
25 (defgeneric (setf cfg-get) (obj key val))
26 
27 (defmacro defcfg (name direct-superclasses direct-slots &rest options)
28  `(defclass ,name ,(append direct-superclasses '(obj/cfg::cfg))
29  ,direct-slots
30  ,@options))