Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (17 sloc) 0.692 kb
#lang racket/base
(require (for-syntax racket/base)
(for-syntax "record.rkt"))
(define-syntax (require-permission stx)
(syntax-case stx ()
[(_ perms ...)
(andmap (compose string? syntax-e) (syntax->list #'(perms ...)))
(with-syntax ([permissions (datum->syntax stx 'permissions)]
[src (syntax-source stx)])
(syntax/loc stx
(begin
(begin-for-syntax
(let* ([this-module (variable-reference->resolved-module-path (#%variable-reference))]
[key (resolved-module-path-name this-module)])
(record! key (list perms ...))))
(void))))]))
(provide require-permission)
Jump to Line
Something went wrong with that request. Please try again.