renaming
This commit is contained in:
parent
c9b706d866
commit
4668038355
|
@ -2,7 +2,7 @@
|
||||||
(require datalog/runtime
|
(require datalog/runtime
|
||||||
(prefix-in stx: datalog/stx)
|
(prefix-in stx: datalog/stx)
|
||||||
(for-syntax racket/base
|
(for-syntax racket/base
|
||||||
remix/raw-stx0
|
remix/stx/raw0
|
||||||
datalog/private/compiler
|
datalog/private/compiler
|
||||||
datalog/parse
|
datalog/parse
|
||||||
syntax/parse))
|
syntax/parse))
|
||||||
|
|
29
remix/stx/singleton-struct0.rkt
Normal file
29
remix/stx/singleton-struct0.rkt
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#lang racket/base
|
||||||
|
(require syntax/parse/define)
|
||||||
|
|
||||||
|
(module singleton racket/base
|
||||||
|
(require (for-syntax racket/base
|
||||||
|
syntax/parse
|
||||||
|
racket/syntax))
|
||||||
|
(define-syntax (singleton-struct stx)
|
||||||
|
(syntax-parse stx
|
||||||
|
[(singleton-struct . struct-args)
|
||||||
|
(with-syntax ([the-singleton (generate-temporary (syntax-local-name))])
|
||||||
|
(syntax/loc stx
|
||||||
|
(let ()
|
||||||
|
(struct the-singleton () . struct-args)
|
||||||
|
(the-singleton))))]))
|
||||||
|
(provide singleton-struct))
|
||||||
|
(require (submod "." singleton)
|
||||||
|
(for-syntax (submod "." singleton)))
|
||||||
|
|
||||||
|
(define-simple-macro (define/singleton-struct singleton:id . struct-args)
|
||||||
|
(define singleton (singleton-struct . struct-args)))
|
||||||
|
(define-simple-macro (define-syntax/singleton-struct singleton:id . struct-args)
|
||||||
|
(define-syntax singleton (singleton-struct . struct-args)))
|
||||||
|
|
||||||
|
(provide
|
||||||
|
singleton-struct
|
||||||
|
(for-syntax singleton-struct)
|
||||||
|
define/singleton-struct
|
||||||
|
define-syntax/singleton-struct)
|
|
@ -6,6 +6,7 @@
|
||||||
racket/syntax
|
racket/syntax
|
||||||
syntax/parse)
|
syntax/parse)
|
||||||
syntax/parse/define
|
syntax/parse/define
|
||||||
|
remix/stx/singleton-struct0
|
||||||
racket/stxparam)
|
racket/stxparam)
|
||||||
|
|
||||||
;; xxx add extensibility
|
;; xxx add extensibility
|
||||||
|
@ -51,27 +52,6 @@
|
||||||
(syntax/loc stx
|
(syntax/loc stx
|
||||||
(remix-block . body))]))
|
(remix-block . body))]))
|
||||||
|
|
||||||
(module singleton racket/base
|
|
||||||
(require (for-syntax racket/base
|
|
||||||
syntax/parse
|
|
||||||
racket/syntax))
|
|
||||||
(define-syntax (singleton-struct stx)
|
|
||||||
(syntax-parse stx
|
|
||||||
[(singleton-struct . struct-args)
|
|
||||||
(with-syntax ([the-singleton (generate-temporary (syntax-local-name))])
|
|
||||||
(syntax/loc stx
|
|
||||||
(let ()
|
|
||||||
(struct the-singleton () . struct-args)
|
|
||||||
(the-singleton))))]))
|
|
||||||
(provide singleton-struct))
|
|
||||||
(require (submod "." singleton)
|
|
||||||
(for-syntax (submod "." singleton)))
|
|
||||||
|
|
||||||
(define-simple-macro (define/singleton-struct singleton:id . struct-args)
|
|
||||||
(define singleton (singleton-struct . struct-args)))
|
|
||||||
(define-simple-macro (define-syntax/singleton-struct singleton:id . struct-args)
|
|
||||||
(define-syntax singleton (singleton-struct . struct-args)))
|
|
||||||
|
|
||||||
(begin-for-syntax
|
(begin-for-syntax
|
||||||
(define-generics binary-operator
|
(define-generics binary-operator
|
||||||
(binary-operator-precedence binary-operator))
|
(binary-operator-precedence binary-operator))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user