(define spec-form-effects
  (fn
    (form)
    (let
      ((result (list)) (found false))
      (when
        (> (len form) 3)
        (for-each
          (fn
            (item)
            (if
              found
              (when
                (and (list? item) (empty? result))
                (for-each
                  (fn
                    (eff)
                    (append!
                      result
                      (if
                        (= (type-of eff) "symbol")
                        (symbol-name eff)
                        (str eff))))
                  item)
                (set! found false))
              (when
                (and
                  (= (type-of item) "keyword")
                  (= (keyword-name item) "effects"))
                (set! found true))))
          (slice form 2)))
      result)))
