On Tue, Feb 14, 2017 at 12:14 PM, John Clements <[email protected]> wrote:
> > > On Feb 14, 2017, at 9:00 AM, David Storrs <[email protected]> > wrote: > > > > > > > > On Tue, Feb 14, 2017 at 11:41 AM, 'John Clements' via Racket Users < > [email protected]> wrote: > > > > > On Feb 14, 2017, at 8:36 AM, David Storrs <[email protected]> > wrote: > > > > > > I have murphy/protobuf installed and I'd like to look at the source > code. How do I find it? > > > > I think you’re looking for the ‘collection-file-path’ function, if you > want to do it programmatically. > > > > collection-file-path accepts two arguments: the path of the file and the > path of the collection. That doesn't help if what I'm looking for is the > path of the file. What I'd like would be a way to decompose a 'require', > so that I could say something like: > > > > (show-full-path murphy/protobuf) > > > > ...and get back the actually absolute filepath to the collection. > > Yes, I believe that’s what collection-file-path does. On my system: > > (collection-file-path "main.rkt" "rsound”) > > ==> #<path:/Users/clements/rsound/rsound/main.rkt> > > Note that I specified the collection name, not a path to the collection. > > Does this answer your question? > > John > > > Thanks, that's helpful. It works for some modules, but not for the one I'm actually looking for -- perhaps it's relevant that murphy/protobuf is a planet module, included as (planet murphy/protobuf)? My understanding was that those will still be cached locally. Here's my output: [dstorrs@MacBook-Pro:~/cancer/app:<dks*>]$ racket racket Welcome to Racket v6.6. -> (collection-file-path "list-utils.rkt" "dstorrs") (collection-file-path "list-utils.rkt" "dstorrs") #<path:/Users/dstorrs/Dropbox/dstorrs/personal/study/scheme/dstorrs/list-utils.rkt> -> (collection-file-path "main.rkt" "protobuf") (collection-file-path "main.rkt" "protobuf") ; collection-file-path: collection not found ; collection: "protobuf" ; in collection directories: ; /Users/dstorrs/Dropbox/dstorrs/personal/study/scheme ; /Users/dstorrs/Dropbox/dstorrs/personal/study/scheme ; /Users/dstorrs/Library/Racket/6.6/collects ; /Applications/Racket_v6.6/collects ; ... [171 additional linked and package directories] ; [,bt for context] -> (collection-file-path "main.rkt" "murphy/protobuf") (collection-file-path "main.rkt" "murphy/protobuf") ; collection-file-path: collection not found ; collection: "murphy/protobuf" ...same as above... -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

