Re: [racket-users] listing the identifiers from "all-defined-out" and "all-from-out"

2015-12-22 Thread Benjamin Greenman
You might also like `filtered-out` from `racket/provide` [1]. The code
sample below prints two identifiers (at compile-time):

a:x

y


[1]
http://docs.racket-lang.org/reference/require.html#%28mod-path._racket%2Fprovide%29


#lang racket/base

(module a racket/base
  (provide x)
  (define x 1))

(require 'a)
(require racket/provide)
(require (for-syntax racket/base))

(define y 4)

(define-for-syntax (print-provide str)
  (displayln str)
  str)

(provide
  (filtered-out print-provide (prefix-out a: (all-from-out 'a)))
  (filtered-out print-provide (all-defined-out)))

On Tue, Dec 22, 2015 at 5:21 PM, Asumu Takikawa  wrote:

> On 2015-12-18 17:27:54 -0800, Sanjeev Sharma wrote:
> > how can I get lists of identifiers im/exported when one uses
> >
> > all-defined-out
> > all-from-out
> >
> > I can't yet make sense of regprov.rkt
>
> Do you mean how can you tell what's exported given a particular module
> someone
> has written? Or do you mean something more specific?
>
> For the former, you can just call `module->exports` to get a list of
> exports:
>
>   -> (require data/gvector)
>   -> (module->exports 'data/gvector)
>   '()
>   '((0
>  (for*/gvector ())
>  (for/gvector ())
>  (gvector ())
>  (gvector->list ())
>  (gvector->vector ())
>  (gvector-add! ())
>  (gvector-count ())
>  (gvector-ref ())
>  (gvector-remove! ())
>  (gvector-remove-last! ())
>  (gvector-set! ())
>  (gvector? ())
>  (in-gvector ())
>  (make-gvector (
>
> Cheers,
> Asumu
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] listing the identifiers from "all-defined-out" and "all-from-out"

2015-12-22 Thread Asumu Takikawa
On 2015-12-18 17:27:54 -0800, Sanjeev Sharma wrote:
> how can I get lists of identifiers im/exported when one uses
> 
> all-defined-out 
> all-from-out
> 
> I can't yet make sense of regprov.rkt 

Do you mean how can you tell what's exported given a particular module someone
has written? Or do you mean something more specific?

For the former, you can just call `module->exports` to get a list of exports:

  -> (require data/gvector)
  -> (module->exports 'data/gvector)
  '()
  '((0
 (for*/gvector ())
 (for/gvector ())
 (gvector ())
 (gvector->list ())
 (gvector->vector ())
 (gvector-add! ())
 (gvector-count ())
 (gvector-ref ())
 (gvector-remove! ())
 (gvector-remove-last! ())
 (gvector-set! ())
 (gvector? ())
 (in-gvector ())
 (make-gvector (

Cheers,
Asumu

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] listing the identifiers from "all-defined-out" and "all-from-out"

2015-12-18 Thread Sanjeev Sharma
how can I get lists of identifiers im/exported when one uses

all-defined-out 
all-from-out

I can't yet make sense of regprov.rkt 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.