
I get a strange error when I try to raco pkg update
one of my packages today: $ raco pkg update text-block
Resolving "text-block" via <https://download.racket-lang.org/releases/8.2/catalog/>
Resolving "text-block" via <https://pkgs.racket-lang.org>
Updating:
text-block
Downloading repository <https://github.com/Metaxal/text-block.git>
git: could not find requested reference
reference: master
repo: Metaxal/text-block.git
context...:
/usr/share/racket/collects/net/git-checkout.rkt:403:0: select-commits
[repeats 1 more time]
/usr/share/racket/collects/net/git-checkout.rkt:73:8
/usr/share/racket/collects/net/git-checkout.rkt:54:2: retry-loop
/usr/share/racket/collects/pkg/private/download.rkt:102:2: download!
while the pkgs server doesn’t show any issue with it. Is the issue somewhere on my side?

that looks like the name of the branch. Did it get changed to main? maybe update the url on the package server?

The problem will go away after the pkg server catches up to the latest commit. It’s a problem with the raco pkg
client that’s fixed for v8.3.

ok great, thanks

it’s fixed now

@spdegabrielle ooh, rename an identifier quickscript! Awesome! This is one of the things that I really wish DrRacket had out-of-the-box and is definitely something that I will use because I often change my mind about the name of a function. Other IDEs can do this kind of out-of-the-box.


Any chance of extending it to rename an identifier that is used in other modules? For example: rename an identifier across a collection.

@jesse697 There are a number of extensions in quickscript that I believe should be included in the Racket Distribution (cc: @laurent.orseau @robby)

this is something I use a fair amount in PHPStorm, an IDE for PHP. You can just rename a method in a class and all uses of it get renamed, too, not just in the current file

How does PHP storm know about the uses of the identifier?

@jesse697 Note that it was already in DrRacket, but only in the right-click context menu. Also, it’s based on check-syntax, which means the program must compile.

I’m not sure about multifile, because of complicated things like rename-out
and such.

PHP and friends won’t do better I guess in such situations, since their replacements are based on strings rather than syntax

if you want string-based replacement, you always have sed -i s/old/new/g *.rkt
or similar :wink:

Does the compiler build a index of identifiers and aliases? Is this index inspectable?

wow, I didn’t even know about the Rename Identifier feature in DrRacket

right I see how the feature could be defeated by rename-out
. You could pop up a giant flame out screen in such a case: “Rename defeated by rename-out
! Ouch”

(there is so much in DrRacket that 99% of racketeers never see)

- The compiler does not build such an index. DrRacket builds such an index as part of check syntax.

OTOH, you could make the feature smarter and handle rename-out
(though I think the complexity is increasing rapidly now)

rename-out
is not a problem. The problem is that you don’t know where to look for files that might need to change.

right, we don’t know the whole scope, but I think the feature could make a reasonable assumption about where it might appear. I imagine using this feature only for work on a single package, and for identifiers that aren’t provided externally. In my own sandbox, so to speak

macros could defeat the feature too

Right, that’s the usual way this sort of feature works. DrRacket traditionally has not had a notion of “project” and has instead looked only at the files it has open. Additionally, you’d need to run a potentially expensive computation on all of the files in the project (expanding them and running check syntax). I think this would be a good feature to add but that’s why it doesn’t exist.

I take it PHPstorm has a ‘project’ or does it replace on everything in the files folder and and subfolders?

yeah, it has projects

@jesse697 You may want to take a look at other quickscripts here: https://github.com/racket/racket/wiki/Quickscript-Scripts-for-DrRacket And if you write yourself one that may be useful to others, don’t forget to share it, it’s extremely simple (gist, gitlab snippets, etc.) :wink:

Ok. If we take the idea that if something is part of a project is should be a language feature…what would it be in this case?

@ryanc is there a way to make pslide
work with widescreen slides?

Or, I should say, to default to it, so that passing the --widescreen
option isn’t necessary

No, I think you have to run the talk with --widescreen
.

It would be nice if there was some analog to slideshow/widescreen

I suppose one could add modules like that that just defined variants of pslide
.

Our of curiosity, is there an obstacle to using --widescreen
?

sufficient for my purposes would be to just support #:aspect
as an argument to pslide

The only problem is that it isn’t what C-c C-c does in Racket Mode

Okay, I’ve added an #:aspect
argument to pslide
.

Thanks!