unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* grouping
@ 2002-05-06 21:23 Thien-Thi Nguyen
  0 siblings, 0 replies; only message in thread
From: Thien-Thi Nguyen @ 2002-05-06 21:23 UTC (permalink / raw)


folks,

API scanning is the first step in knowing yourself (if you are a package
like guile).  next is developing some discernment on how these interface
elements are grouped, for this is the basis for a more fine-grained and
robust philosophical development (this is applicable to humans, too).

to do this we use a mechanism that allows us to separate the expression
of group membership predicates from the mundane record-keeping task of
recording these in a reliable way (see new script annotate-api-groupings
for that (in cvs HEAD)).

please see below for a preliminary (experimental) set of definitions
that everyone is invited to augment and refine -- this will eventually
be checked into doc/groupings.alist and maintained there.

to play, grab annotate-api-groupings and some guile-api.alist file, and
invoke like so:

  annotate-api-groupings guile-api.alist groupings.alist

see commentary in annotate-api-groupings for more info.

thi


__________________________________________________
;; groupings.alist
;; -*-scheme-*-

;; This file describes groupings of available bindings (both Scheme and C).
;; The overall structure is an alist.  Each entry has the form:
;;
;;   (NAME (description "DESCRIPTION") (members SYM...))
;;
;; All of these should be proper subsets of guile-api.alist.
;; Because of this property, it is an SMOP to annotate that alist,
;; and so the Scheme/C distinction need not be maintained here.
;;
;; In addition to `description' and `members' forms, the entry may
;; optionally include:
;;
;;   (grok USE-MODULES (lambda (x) CODE))
;;
;; where CODE implements a group-membership predicate applied to `x', which is
;; an API element object (this will be encapsulated into a closure before
;; release).  If this "grok procedure" produces the same set as the `members'
;; form, you can omit the `members' form entirely.  [When evaluated, CODE can
;; assume (use-modules MODULE) has been executed where MODULE is an element of
;; USE-MODULES, a list.  [NOT YET IMPLEMENTED!]]
;;
;; Currently, there are two convenience predicates that operate on `x':
;;   (in-group? x GROUP)
;;   (name-prefix? x PREFIX)
;;
;;+ When `x' is converted into a closure, the names of these predicates
;;+ will be maintained as first arg keys, e.g., "(in-group? x GROUP)" will
;;+ be expressed as "(x 'in-group? GROUP)".
;;
;; TODO: Move this text to annotate-api-groupings commentary; point there.

(

(C+scheme			;; This group should have no members!
 (description "in both groups `scheme' and `C'")
 (grok () (lambda (x)
            (and (in-group? x 'scheme) (in-group? x 'C)))))

(libguile-internal
 (description "begins with scm_i_")
 (grok () (lambda (x)
            (name-prefix? x "scm_i_"))))

(math
 (description "math functions")
 (members $abs $acos $acosh $asin $asinh $atan $atan2 $atanh $cos $cosh
          $exp $expt $log $sin $sinh $sqrt $tan $tanh))

(favorite
 (description "my favorite procs")
 (grok () (lambda (x)
            (and (in-group? x 'math) (in-group? x 'scheme)))))

;; Add new grouping descriptions here.
)

;; groupings.alist ends here

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-06 21:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-06 21:23 grouping Thien-Thi Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).