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. > Alternatively, If you just want to open up the file, I usually just type > (require protobuf) in a buffer, and right-click to go to the collection’s > main.rkt. > I prefer Emacs to Dr Racket. Asking the user to open up a separate application just to find a module file is irritating. In Perl I could at least do this: perl -E 'say for @INC' and get a list of all the directories modules were being pulled from, all of which were rooted at a single directory which I could then run a 'find' against. I tried these: (current-library-collection-paths) '(#<path:/Users/dstorrs/Dropbox/dstorrs/personal/study/scheme> #<path:/Users/dstorrs/Library/Racket/6.6/collects> #<path:/Applications/Racket_v6.6/collects>) find /Users/dstorrs/Dropbox/dstorrs/personal/study /Users/dstorrs/Library/Racket/6.6/collects /Applications/Racket_v6.6/collects -name "*protobuf*" ;; no result I tried running raco pkg show ...stuff elided... planet-murphy-protobuf1 626ae27c7d28b132024c81... catalog...urphy-protobuf1 ...stuff elided... Which at least admits that the package is installed, but doesn't answer the question because what is probably the information I'm looking for is truncated. I can't believe there isn't an easy way to do this that doesn't require DrRacket. If there are significant functions of a programming language that can only be accessed via an IDE then that is a major problem. > > John > > > > > > I tried: > > > > (find-system-path 'collects-dir) ;; yields ../collects, which is useless > > /Applications/Racket_v6.6/collects ;; nothing > > /Library/Application Support/ ;; no directory for Racket > > ~/Library/Application Support/ ;; no directory for Racket > > > > I'm looking for a way to do this programmatically so I'm not flailing > around in the future. Where should I be looking? > > > > > > > > > > -- > > 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. > > > > -- > 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. > -- 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.

