unstable/syntax: added explode-module-path-index
This commit is contained in:
parent
dc0138bcb7
commit
56bb28dfc6
|
@ -18,6 +18,20 @@
|
||||||
|
|
||||||
@unstable[@author+email["Ryan Culpepper" "ryanc@racket-lang.org"]]
|
@unstable[@author+email["Ryan Culpepper" "ryanc@racket-lang.org"]]
|
||||||
|
|
||||||
|
@defproc[(explode-module-path-index [mpi module-path-index?])
|
||||||
|
(listof (or/c module-path? resolved-module-path? #f))]{
|
||||||
|
|
||||||
|
Unfolds @racket[mpi] using @racket[module-path-index-split], returning
|
||||||
|
a list of the relative module paths together with the terminal
|
||||||
|
resolved module path or @racket[#f] for the ``self'' module.
|
||||||
|
|
||||||
|
@examples[#:eval the-eval
|
||||||
|
(explode-module-path-index (car (identifier-binding #'lambda)))
|
||||||
|
(explode-module-path-index (caddr (identifier-binding #'lambda)))
|
||||||
|
(explode-module-path-index (car (identifier-binding #'define-values)))
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
@;{----}
|
@;{----}
|
||||||
|
|
||||||
@margin-note{This binding was added by Vincent St-Amour.}
|
@margin-note{This binding was added by Vincent St-Amour.}
|
||||||
|
|
|
@ -7,13 +7,14 @@
|
||||||
syntax-list
|
syntax-list
|
||||||
|
|
||||||
;; by cce:
|
;; by cce:
|
||||||
|
|
||||||
syntax-source-file-name
|
syntax-source-file-name
|
||||||
syntax-source-directory
|
syntax-source-directory
|
||||||
|
|
||||||
;; by stamourv:
|
;; by stamourv:
|
||||||
|
format-unique-id
|
||||||
|
|
||||||
format-unique-id)
|
;; by ryanc
|
||||||
|
explode-module-path-index)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;
|
;;
|
||||||
|
@ -60,3 +61,12 @@
|
||||||
((make-syntax-introducer) (apply format-id
|
((make-syntax-introducer) (apply format-id
|
||||||
lctx #:source src #:props props #:cert cert
|
lctx #:source src #:props props #:cert cert
|
||||||
fmt args)))
|
fmt args)))
|
||||||
|
|
||||||
|
;; by ryanc
|
||||||
|
|
||||||
|
(define (explode-module-path-index mpi)
|
||||||
|
(let-values ([(x y) (module-path-index-split mpi)])
|
||||||
|
(cons x
|
||||||
|
(if (module-path-index? y)
|
||||||
|
(explode-module-path-index y)
|
||||||
|
(list y)))))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user