[racket] Prabhalar Ragde's code

From: John Clements (clements at brinckerhoff.org)
Date: Wed Dec 11 14:35:42 EST 2013

On Dec 7, 2013, at 10:15 AM, Michael Jensen wrote:

> thank's for the replies!
> 
> my current understanding is that where John uses:  @(require "pr-math.rkt"), Prabhakar uses: @(require "math-utilities.rkt"), and that either one will work, if the file defined here:  https://github.com/soegaard/bracket/blob/master/docs/pr-math.rkt is saved locally under that name.
> 
> question 1:  it seems one standard way to get these "packages" or files is the one documented here:  http://docs.racket-lang.org/planet/Using_PLaneT.html .   however, the list of packages on planet is very long.  is there a way to search it?  or to jump to all packages starting with "k" for example?  
> 
> 
> question 2:   http://docs.racket-lang.org/pkg/Managing_Packages.html#%28def._%28%28lib._pkg/main..rkt%29._show%29%29 gives info on how to install packages from the command line, but I have not succeeded in doing so yet.  I think part of the problem is that I don't know how to specify what package I want.  there doesn't seem to be a function to list the available packages, at least not from the command line.  it would seem that this list of packages is provided by planet. however, I don't see any .rkt files there.  it seems to me like there must be a "slick" way of getting code like Prabhakar's, more slick than selecting, copying and pasting into a new file, naming it, then including it.  however, I don't see it yet.
> 
> I have now tried (following  http://docs.racket-lang.org/pkg/Package_Concepts.html#%28tech._package._source%29  ):
> 
> mikethe1wheelnut at mikethe1wheelnut-OptiPlex-9010:~$ raco pkg install -t github github://github.com/soegaard/bracket/blob/master/docs/pr-math.rkt
> raco pkg install: could not infer package name from source
>   source: github://github.com/soegaard/bracket/blob/master/docs/pr-math.rkt
> 
> mikethe1wheelnut at mikethe1wheelnut-OptiPlex-9010:~$ raco pkg install -t name github://github.com/soegaard/bracket/blob/master/docs/pr-math.rkt
> raco pkg install: could not infer package name from source
>   source: github://github.com/soegaard/bracket/blob/master/docs/pr-math.rkt
> 
> mikethe1wheelnut at mikethe1wheelnut-OptiPlex-9010:~$ raco pkg install -t file-url github://github.com/soegaard/bracket/blob/master/docs/pr-math.rkt
> URL scheme "github" not supported
> 
> mikethe1wheelnut at mikethe1wheelnut-OptiPlex-9010:~$ raco pkg install github://github.com/soegaard/bracket/blob/master/docs/pr-math.rkt
> raco pkg install: could not infer package name from source
>   source: github://github.com/soegaard/bracket/blob/master/docs/pr-math.rkt

Taking a step back, it appears that you have one (entirely reasonable) misconception, that PLaneT and the 'package' system are the same.

In fact, PLT/Racket is in the process of transitioning from an older package system (PLaneT) to a newer one (packages). They have different websites:

PLaneT:  planet.racket-lang.org
packages: pkg.racket-lang.org

I won't go into the details of the differences, but the new system is broadly speaking somewhat more intuitive and solves a number of problems that people had with the old system.

Next: the code that we're talking about has not been released as a package (or in PLaneT); it wouldn't be hard, but no one's done it. My guess is that no one has felt like this file really constitutes a package of its own.

For the moment, then, I believe you're best off just making a copy of the file in somewhere that's useful to you.

> 
> 
> questions 3: it would be nice if there was a way to 1) output the results of prabhakar's code to the "DrRacket’s bottom text area", as opposed to a separate pdf document, and similarly 2), to request math formulas from there as well, as I have tried to do here (screen-shot)

You might be interested in the "Scribble HTML" button, which renders to an HTML document, rather than a PDF. 

Or... you might not.

FWIW, I think that rendering scribble to the interactions pane would probably be quite a lot of work, and that for most folks, popping off to a PDF viewer or an HTML viewer isn't too painful.

Best,

John Clements



Posted on the users mailing list.