macrotypes/stx-utils.rkt
Stephen Chang 71d65e1a44 stlc, sysf: make function tycon infix instead of prefix
- TODO: typecheck uses -> as datum-literal because it can't see the
        actual literal, fix this
2014-08-21 13:31:11 -04:00

15 lines
527 B
Racket

#lang racket/base
(require syntax/stx)
(provide (all-defined-out))
(define (stx-cadr stx) (car (stx-cdr stx)))
(define (stx-andmap f . stx-lsts)
(apply andmap f (map syntax->list stx-lsts)))
(define (stx-flatten stxs)
(apply append (stx-map syntax->list stxs)))
(define (curly-parens? stx)
(define paren-prop (syntax-property stx 'paren-shape))
(and paren-prop (char=? #\{ paren-prop)))
(define (stx-member v stx)
(member v (syntax->list stx) free-identifier=?))
(define (stx-length stx) (length (syntax->list stx)))