[racket] newbie drracket usage questions

49 views
Skip to first unread message

D Herring

unread,
Jul 31, 2012, 12:53:52 AM7/31/12
to us...@racket-lang.org
Hi,

How would one accomplish the following in DrRacket?

"apropos" (CL/shell) or "lookfor" (Matlab)
Given a search string, return a list of symbols with matching name or
documentation.
I found that XRepl has the ,apropos command; but I haven't figured out
an easy way to invoke it in DrRacket.


Finding the source of definitions.
a la ctags or
http://common-lisp.net/project/slime/doc/html/Finding-definitions.html
Given a function or global parameter, open the file that defined it
and scroll to the definition.
I found documentation for storing source locations, but nothing on how
to query the information.


Thanks,
Daniel

____________________
Racket Users list:
http://lists.racket-lang.org/users

Richard Cleis

unread,
Jul 31, 2012, 1:15:44 AM7/31/12
to D Herring, us...@racket-lang.org

On Jul 30, 2012, at 10:53 PM, D Herring wrote:

> Hi,
>
> How would one accomplish the following in DrRacket?
>
> "apropos" (CL/shell) or "lookfor" (Matlab)
> Given a search string, return a list of symbols with matching name or documentation.
> I found that XRepl has the ,apropos command; but I haven't figured out an easy way to invoke it in DrRacket.

Do you mean: do that within Racket, or from Racket?

You can use the shell with (system "apropos ..."), but I don't know how useful that is for Racket docs.

Within Racket you can use the F1 key to get to the docs that tell you where a function lives. That
opens a web browser that allows you to type strings for more searching (locally and not).

I fear I am telling you things that you already know. :O)

rac

D Herring

unread,
Jul 31, 2012, 1:52:19 AM7/31/12
to us...@racket-lang.org
On 07/31/2012 01:15 AM, Richard Cleis wrote:
>
> On Jul 30, 2012, at 10:53 PM, D Herring wrote:
>
>> Hi,
>>
>> How would one accomplish the following in DrRacket?
>>
>> "apropos" (CL/shell) or "lookfor" (Matlab)
>> Given a search string, return a list of symbols with matching name or documentation.
>> I found that XRepl has the ,apropos command; but I haven't figured out an easy way to invoke it in DrRacket.
>
> Do you mean: do that within Racket, or from Racket?
>
> You can use the shell with (system "apropos ..."), but I don't know how useful that is for Racket docs.
>
> Within Racket you can use the F1 key to get to the docs that tell you where a function lives. That
> opens a web browser that allows you to type strings for more searching (locally and not).
>
> I fear I am telling you things that you already know. :O)

Thanks for the quick response. Unfortunately, I had found the web
browser thingy (and had to enable javascript for it to work). :)

I am looking for functions that search for racket functions and return
racket data structures that describe them. The key pieces of
information is the name (so it can be used) and the source location
(so the implementation can be learned and possibly modified).

Thanks,
Daniel

Pierpaolo Bernardi

unread,
Jul 31, 2012, 3:45:00 AM7/31/12
to D Herring, us...@racket-lang.org
On Tue, Jul 31, 2012 at 7:52 AM, D Herring <dher...@tentpost.com> wrote:
> On 07/31/2012 01:15 AM, Richard Cleis wrote:
>>

> I am looking for functions that search for racket functions and return
> racket data structures that describe them. The key pieces of information is
> the name (so it can be used) and the source location (so the implementation
> can be learned and possibly modified).

I don't know about the return data structures part, but, if finding
manually the definition of functions suffices you, you can "check
syntax" and then right clicking on a symbol offers the "jump to
definition" command.

HTH

Matthias Felleisen

unread,
Jul 31, 2012, 8:38:19 AM7/31/12
to D Herring, us...@racket-lang.org

On Jul 31, 2012, at 1:52 AM, D Herring wrote:

> Thanks for the quick response. Unfortunately, I had found the web browser thingy (and had to enable javascript for it to work). :)
>
> I am looking for functions that search for racket functions and return racket data structures that describe them. The key pieces of information is the name (so it can be used) and the source location (so the implementation can be learned and possibly modified).


As someone mentioned, DrRacket provides a GUI-version of this functionality with 'check syntax'. In #lang programs, 'check syntax' is always on and the information is always available.

If you want a programmatic way to access this information, you'd have to hook into 'check syntax' before it colors the editor.

-- Matthias

Robby Findler

unread,
Jul 31, 2012, 8:44:49 AM7/31/12
to Matthias Felleisen, us...@racket-lang.org, D Herring
Since no one mentioned it yet: if you want a shell-script based way to
tell the docs what to search for, you can use 'raco docs lambda' to
search for 'lambda'.

Robby

D Herring

unread,
Jul 31, 2012, 7:39:33 PM7/31/12
to us...@racket-lang.org
On 07/31/2012 03:45 AM, Pierpaolo Bernardi wrote:

> I don't know about the return data structures part, but, if finding
> manually the definition of functions suffices you, you can "check
> syntax" and then right clicking on a symbol offers the "jump to
> definition" command.

Thanks to everyone for their help. Together with the documentation,
this check-syntax technique satisfies my current needs.

- Daniel
Reply all
Reply to author
Forward
0 new messages