musings on defsig added by zbigniew the maladjusted on Thu Feb 14 01:27:15 2013

;; defsigs are not very SXML-like; primarily, as (procedure body . alist) takes >= 2 positional arguments,
;;  it's hard to represent in zmarkup without :(...).  For example, :'(foo bar baz) must be quoted
;;  with :' or :"..." because if "foo" is an inline tag, it will switch to text mode and
;;  screw up the positional args.  (Also, svnwiki-sxml expects a string there.)

>def >sig :(procedure "(foo bar baz)" (id foo))
          :(syntax "(#foo P)" (id "#foo"))
 This is the body for foo and #foo.

 -->
  (def (sig (procedure "(foo bar baz)" (id foo))
            (syntax "(#foo P)" (id "#foo")))
       ("This is the body for foo and #foo."))



;; An alternative.  Has an annoying anonymous list, but doesn't require :(...) notation,
;; as all lists are tagged.

>def >sig > :procedure (foo bar baz) :id foo
          > :syntax    "(#foo P)"    :id "#foo"
 This is the body for foo and #foo.

 -->
  (def (sig ((procedure (foo bar baz)) (id foo))
            ((syntax "(#foo P)") (id "#foo")))
       ("This is the body for foo and #foo."))




;; Another alternative, without anonymous lists.
;; SIGs must now be collected from front of DEF, but it's less noisy.
;; Also introduce a types.db like signature.

>def >sig :procedure (foo bar baz) :id foo     
          :types     (symbol number -> boolean)
     >sig :syntax    "(#foo P)"    :id "#foo"
 This is the body for foo and #foo.

 -->
  (def (sig (procedure (foo bar baz))
            (id foo)
            (types (symbol number -> boolean)))
       (sig (syntax "(#foo P)") (id "#foo"))
       ("This is the body for foo and #foo."))