[plt-scheme] arglist-on-space?

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Mon Aug 10 23:41:46 EDT 2009

Lee Spector wrote:
> 
> Thanks for the speedy and helpful responses.
> 
> F1, which I didn't know about previously, will help a lot. It doesn't 
> show the arglist right in the programming environment, and it only helps 
> for built-in definitions, but within these limits it provides pretty 
> quick access to the arglist and documentation.

Depends on what you mean by "built-in definitions". It shows 
documentation for anything for which there are Scribble docs, including 
the core language, the standard library collections (see "collections" 
in the Guide), and installed PLaneT packages.

It's possible to build documentation for standalone projects using the 
scribble command-line tool, but it requires more effort and the 
resulting docs are not quite integrated with the main docs. Another 
solution is to make PLT Scheme treat your standalone project as a 
special kind of locally-hosted PLaneT package (search "development 
link"). Then your project's Scribble docs will get integrated into the 
main documentation. You'll have to run setup-plt whenever you want to 
rebuild your docs, though.

Just wanted to expand on the possibilities of the documentation system.

> "cmd /" (yes, I'm on a mac) provides symbol completion -- not what I had 
> asked about, but also handy.
> 
> Getting to definitions from Check Syntax -> control-click -> Jump to 
> Definition also seems to be useful, although I'm having a hard time 
> experimenting with it at the moment because I haven't yet fully grokked 
> PLT namespaces, so my cross-file definitions aren't working as I expect. 
> ("#lang scheme/load" makes file loading work in the way that I expect 
> but then Check Syntax no longer provides the arrows/menus... I know I 
> need to read about namespaces.) In any event I'll keep this in mind as I 
> move forward.

It's probably not namespaces you should read about so much as modules. 
"#lang <language>" makes a module out of a whole file. The scheme/load 
language just interprets all of its contents as data to be dynamically 
eval'd at runtime, so there's no information available to tools like 
Check Syntax. As Robby suggests, you'll get more information if you use 
the scheme or scheme/base language.

Modules are for writing programs. Namespaces are for writing programs 
that run other programs (like DrSchemes and web-servers). Roughly.

Ryan

> Thanks again, and if anyone knows of a way to get more complete 
> arglist-on-space behavior (that is, in the programming environment and 
> for all functions) I'd love to hear about it.
> 
>  -Lee
> 
> PS Mike: glad to hear you've seen the GP stuff, some of which will 
> inevitably migrate to Scheme as I spend more time writing Scheme code...
> 
> 
> On Aug 10, 2009, at 8:50 PM, Robby Findler wrote:
> 
>> For the arguments, DrScheme doesn't really do that (altho, as always,
>> patches are welcome), but th next best thing is to hit f1. That'll
>> send you to the docs, searching for whatever is around the insertion
>> point in the editor.
>>
>> For the other, you have to run check syntax first and then you can
>> jump directly to the definition of any function (no matter where it is
>> defined-- check syntax re-uses the compiler to get its lexical
>> information so you can be sure you're jumping precisely).
>>
>> Robby
>>
>> On Mon, Aug 10, 2009 at 6:19 PM, Lee Spector<lspector at hampshire.edu> 
>> wrote:
>>>
>>> Is there any way to get "arglist-on-space" behavior in DrScheme or any
>>> editor working with PLT scheme? What I mean by this is that when you 
>>> type
>>> the name of a function and then a space the argument list for the 
>>> function
>>> appears in a mini-buffer (or anywhere -- I just want to see it). I'd be
>>> happy to have this functionality either in an editor (e.g. the DrScheme
>>> definitions pane) or listener (e.g. the DrScheme interactions pane) 
>>> or both.
>>>
>>> I am a DrScheme/PLT newbie, adopting it for a course I'm teaching in the
>>> fall, but I'm a long-time Common Lisper and this is one of things I miss
>>> most from my favorite CL environments. Next on my list would be a way 
>>> to get
>>> from a function name to the definition of the function with a couple 
>>> of key
>>> strokes, rather than searching in files. Both of these things require 
>>> the
>>> runtime environment to keep information around that maybe PLT isn't 
>>> keeping
>>> around... but I don't know.
>>>
>>> Thanks,
>>>
>>>  -Lee
>>>
>>> -- 
>>> Lee Spector, Professor of Computer Science
>>> School of Cognitive Science, Hampshire College
>>> 893 West Street, Amherst, MA 01002-3359
>>> lspector at hampshire.edu, http://hampshire.edu/lspector/
>>> Phone: 413-559-5352, Fax: 413-559-5438
>>>
>>> Check out Genetic Programming and Evolvable Machines:
>>> http://www.springer.com/10710 - http://gpemjournal.blogspot.com/
>>>
>>> _________________________________________________
>>>  For list-related administrative tasks:
>>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>>
> 
> -- 
> Lee Spector, Professor of Computer Science
> School of Cognitive Science, Hampshire College
> 893 West Street, Amherst, MA 01002-3359
> lspector at hampshire.edu, http://hampshire.edu/lspector/
> Phone: 413-559-5352, Fax: 413-559-5438
> 
> Check out Genetic Programming and Evolvable Machines:
> http://www.springer.com/10710 - http://gpemjournal.blogspot.com/
> 
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.