add sugar dependency

dev-validator
Matthew Butterick 11 years ago
parent f27957c3f3
commit 12fa0e11f7

@ -1,4 +1,4 @@
#lang info #lang info
(define collection "txexpr") (define collection "txexpr")
(define deps '("sugar"))
(define scribblings '(("scribblings/txexpr.scrbl" ()))) (define scribblings '(("scribblings/txexpr.scrbl" ())))

@ -1,20 +1,9 @@
#lang racket/base #lang racket/base
(require (for-syntax racket/base))
(require racket/match xml) (require racket/match xml)
(require sugar/define)
(module+ safe (require racket/contract))
(define-syntax (define+provide+safe stx)
(syntax-case stx ()
[(_ (proc arg ... . rest-arg) contract body ...)
#'(define+provide+safe proc contract
(λ(arg ... . rest-arg) body ...))]
[(_ name contract body ...)
#'(begin
(define name body ...)
(provide name)
(module+ safe (module+ safe
(provide (contract-out [name contract]))))])) (require racket/contract))
(define+provide+safe (txexpr-tag? x) (define+provide+safe (txexpr-tag? x)
(any/c . -> . boolean?) (any/c . -> . boolean?)
@ -222,3 +211,10 @@
(define tx-extracted (do-extraction tx)) ;; do this first to fill matches (define tx-extracted (do-extraction tx)) ;; do this first to fill matches
(values tx-extracted (reverse matches))) (values tx-extracted (reverse matches)))
#|
(module+ main
(define tx '(root (meta ((here "pollen"))) (meta ((here-path "/Users/mb/Desktop/pollen.pm"))) "\n" "\n" (make-table ("" "writer" "reader") ("Attention span" "Long" "Short") ("Interest in topic" "High" "Low") ("Persuadable by other opinions" "No" "Yes") ("Cares about your happiness" "Yes" "No"))))
(splitf-txexpr tx (λ(x) (and (txexpr? x) (equal? 'meta (car x))))))
|#
Loading…
Cancel
Save