anchor.diff:  (in-package :cl-user)
   
   (defpackage #:wf/ipfs
  -  (:use #:cl #:gadgets #:alexandria #:access))
  +  (:use #:cl #:gadgets #:alexandria #:access)
  +  (:export
  +   #:target-text
  +   #:suggest-target-title
  +   #:target-title
  +   #:text-comments-tree-p
  +   #:title-comments-tree-p
  +   #:text-script
  +   #:title-script
  +   #:general-script
  +   #:participants))
   
   (in-package :wf/ipfs)
   
  
positive.code: (defun general-script (tree)
    (remove-if (lambda (itm) (or (text-comments-tree-p itm) (title-comments-tree-p itm))) tree))
  
  
  
negative.code:              (error "Unknown symbol in score script"))))))
  
  
  
  ;;FIXME: add a score-script type and some type checking. Important for safety.
  
  (defun prep-scsc-for-execution (code)
    "Symbols must be safetied before running"
    (proto:mapbranch
     (lambda (node)
       (if (member (car node) *safe-symbols*)
           (multiple-value-bind (main children) (splitfilter #'listp node)
             (append
              main
              `(:modifiers
                (lambda ()
                  ,@children))))
           node))
     code))
  
  (defun text-comments-tree-p (tree)
    (when (member (car tree) '(scsc:target-text scsc:suggest-target-text))
      (return-from text-comments-tree-p t))
    (some (lambda (itm)
            (and (listp itm)
                 (member (car itm) '(scsc:target-text scsc:suggest-target-text))
                 (equal (gadgets:fetch-keyword :iid itm :in-list nil)
                        (gadgets:fetch-keyword :iid tree :in-list nil))))
          tree))
  
  (defun title-comments-tree-p (tree)
    (when (member (car tree) '(scsc:target-title scsc:suggest-target-title))
      (return-from title-comments-tree-p t))
    (some (lambda (itm)
            (and (listp itm)
                 (member (car itm) '(scsc:target-title scsc:suggest-target-title))
                 (equal (gadgets:fetch-keyword :iid itm :in-list nil)
                        (gadgets:fetch-keyword :iid tree :in-list nil))))
          tree))
  